aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-07-04 00:15:05 +0800
committerchriseth <c@ethdev.com>2015-07-04 00:15:05 +0800
commitaa6182ab87989ed50df2ec779237a2b708ccfd12 (patch)
tree67985eff7fa3a54989a1db19fdd65e2557351688
parente2d6e34f9c37488179ba5e3e9ae5dbe106bd57f0 (diff)
downloaddexon-solidity-aa6182ab87989ed50df2ec779237a2b708ccfd12.tar
dexon-solidity-aa6182ab87989ed50df2ec779237a2b708ccfd12.tar.gz
dexon-solidity-aa6182ab87989ed50df2ec779237a2b708ccfd12.tar.bz2
dexon-solidity-aa6182ab87989ed50df2ec779237a2b708ccfd12.tar.lz
dexon-solidity-aa6182ab87989ed50df2ec779237a2b708ccfd12.tar.xz
dexon-solidity-aa6182ab87989ed50df2ec779237a2b708ccfd12.tar.zst
dexon-solidity-aa6182ab87989ed50df2ec779237a2b708ccfd12.zip
Style and some assertion messages.
-rw-r--r--CompilerUtils.cpp2
-rw-r--r--ExpressionCompiler.cpp2
-rw-r--r--LValue.cpp2
-rw-r--r--Types.cpp7
4 files changed, 5 insertions, 8 deletions
diff --git a/CompilerUtils.cpp b/CompilerUtils.cpp
index eab20e0e..ed6a6cf7 100644
--- a/CompilerUtils.cpp
+++ b/CompilerUtils.cpp
@@ -481,7 +481,7 @@ void CompilerUtils::convertType(Type const& _typeOnStack, Type const& _targetTyp
}
break;
case DataLocation::CallData:
- solAssert(false, "");
+ solAssert(false, "Invalid type conversion target location CallData.");
break;
}
break;
diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp
index 81f5d08a..13cd4032 100644
--- a/ExpressionCompiler.cpp
+++ b/ExpressionCompiler.cpp
@@ -324,7 +324,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
FunctionTypePointer functionType;
if (_functionCall.isStructConstructorCall())
{
- TypeType const& type = dynamic_cast<TypeType const&>(*_functionCall.getExpression().getType());
+ auto const& type = dynamic_cast<TypeType const&>(*_functionCall.getExpression().getType());
auto const& structType = dynamic_cast<StructType const&>(*type.getActualType());
functionType = structType.constructorType();
}
diff --git a/LValue.cpp b/LValue.cpp
index 40944663..7b5879e4 100644
--- a/LValue.cpp
+++ b/LValue.cpp
@@ -294,7 +294,7 @@ void StorageItem::storeValue(Type const& _sourceType, SourceLocation const& _loc
else if (sourceType.getSizeOnStack() >= 1)
{
// remove the source ref
- solAssert(sourceStackSize <= 2, "");
+ solAssert(sourceStackSize <= 2, "Invalid stack size.");
m_context << eth::swapInstruction(sourceStackSize);
if (sourceStackSize == 2)
m_context << eth::Instruction::POP;
diff --git a/Types.cpp b/Types.cpp
index 96cf3f7e..5a949299 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -1020,13 +1020,10 @@ bool StructType::canLiveOutsideStorage() const
unsigned StructType::getSizeOnStack() const
{
- switch (location())
- {
- case DataLocation::Storage:
+ if (location() == DataLocation::Storage)
return 2; // slot and offset
- default:
+ else
return 1;
- }
}
string StructType::toString(bool _short) const