aboutsummaryrefslogtreecommitdiffstats
path: root/test/compilationTests/stringutils/strings.sol
diff options
context:
space:
mode:
Diffstat (limited to 'test/compilationTests/stringutils/strings.sol')
-rw-r--r--test/compilationTests/stringutils/strings.sol22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/compilationTests/stringutils/strings.sol b/test/compilationTests/stringutils/strings.sol
index 939a777a..fc46ec5a 100644
--- a/test/compilationTests/stringutils/strings.sol
+++ b/test/compilationTests/stringutils/strings.sol
@@ -135,7 +135,7 @@ library strings {
* @return A newly allocated string containing the slice's text.
*/
function toString(slice self) internal returns (string) {
- var ret = new string(self._len);
+ string memory ret = new string(self._len);
uint retptr;
assembly { retptr := add(ret, 32) }
@@ -153,8 +153,8 @@ library strings {
*/
function len(slice self) internal returns (uint) {
// Starting at ptr-31 means the LSB will be the byte we care about
- var ptr = self._ptr - 31;
- var end = ptr + self._len;
+ uint ptr = self._ptr - 31;
+ uint end = ptr + self._len;
uint len;
for (len = 0; ptr < end; len++) {
uint8 b;
@@ -199,8 +199,8 @@ library strings {
if (other._len < self._len)
shortest = other._len;
- var selfptr = self._ptr;
- var otherptr = other._ptr;
+ uint selfptr = self._ptr;
+ uint otherptr = other._ptr;
for (uint idx = 0; idx < shortest; idx += 32) {
uint a;
uint b;
@@ -211,7 +211,7 @@ library strings {
if (a != b) {
// Mask out irrelevant bytes and check again
uint mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
- var diff = (a & mask) - (b & mask);
+ uint diff = (a & mask) - (b & mask);
if (diff != 0)
return int(diff);
}
@@ -300,7 +300,7 @@ library strings {
// Load the rune into the MSBs of b
assembly { word:= mload(mload(add(self, 32))) }
- var b = word / div;
+ uint b = word / div;
if (b < 0x80) {
ret = b;
len = 1;
@@ -410,7 +410,7 @@ library strings {
return false;
}
- var selfptr = self._ptr + self._len - needle._len;
+ uint selfptr = self._ptr + self._len - needle._len;
if (selfptr == needle._ptr) {
return true;
@@ -438,7 +438,7 @@ library strings {
return self;
}
- var selfptr = self._ptr + self._len - needle._len;
+ uint selfptr = self._ptr + self._len - needle._len;
bool equal = true;
if (selfptr != needle._ptr) {
assembly {
@@ -668,7 +668,7 @@ library strings {
* @return The concatenation of the two strings.
*/
function concat(slice self, slice other) internal returns (string) {
- var ret = new string(self._len + other._len);
+ string memory ret = new string(self._len + other._len);
uint retptr;
assembly { retptr := add(ret, 32) }
memcpy(retptr, self._ptr, self._len);
@@ -692,7 +692,7 @@ library strings {
for(uint i = 0; i < parts.length; i++)
len += parts[i]._len;
- var ret = new string(len);
+ string memory ret = new string(len);
uint retptr;
assembly { retptr := add(ret, 32) }