Merge pull request #2114 from LianaHus/sol_byte0_in_storage

Sol removed bytes0
This commit is contained in:
chriseth 2015-06-10 15:35:28 +02:00
commit 6ad90719d8
2 changed files with 3 additions and 4 deletions

View File

@ -253,7 +253,6 @@ namespace solidity
K(UInt240, "uint240", 0) \
K(UInt248, "uint248", 0) \
K(UInt256, "uint256", 0) \
K(Bytes0, "bytes0", 0) \
K(Bytes1, "bytes1", 0) \
K(Bytes2, "bytes2", 0) \
K(Bytes3, "bytes3", 0) \
@ -306,7 +305,7 @@ namespace solidity
/* Identifiers (not keywords or future reserved words). */ \
T(Identifier, NULL, 0) \
\
/* Keywords reserved for future. use*/ \
/* Keywords reserved for future. use. */ \
K(As, "as", 0) \
K(Case, "case", 0) \
K(Catch, "catch", 0) \

View File

@ -121,7 +121,7 @@ TypePointer Type::fromElementaryTypeName(Token::Value _typeToken)
{
int offset = _typeToken - Token::Int;
int bytes = offset % 33;
if (bytes == 0 && _typeToken != Token::Bytes0)
if (bytes == 0 && _typeToken != Token::Bytes1)
bytes = 32;
int modifier = offset / 33;
switch(modifier)
@ -131,7 +131,7 @@ TypePointer Type::fromElementaryTypeName(Token::Value _typeToken)
case 1:
return make_shared<IntegerType>(bytes * 8, IntegerType::Modifier::Unsigned);
case 2:
return make_shared<FixedBytesType>(bytes);
return make_shared<FixedBytesType>(bytes + 1);
default:
solAssert(false, "Unexpected modifier value. Should never happen");
return TypePointer();