aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]AST.h0
-rw-r--r--CompilerContext.cpp4
-rw-r--r--CompilerContext.h6
-rw-r--r--CompilerStack.cpp2
-rw-r--r--Types.h2
-rwxr-xr-x[-rw-r--r--]Utils.h6
6 files changed, 13 insertions, 7 deletions
diff --git a/AST.h b/AST.h
index 95121d4c..95121d4c 100644..100755
--- a/AST.h
+++ b/AST.h
diff --git a/CompilerContext.cpp b/CompilerContext.cpp
index 18357bf0..5d10a5f9 100644
--- a/CompilerContext.cpp
+++ b/CompilerContext.cpp
@@ -53,8 +53,8 @@ void CompilerContext::addAndInitializeVariable(VariableDeclaration const& _decla
{
addVariable(_declaration);
- unsigned const size = _declaration.getType()->getSizeOnStack();
- for (unsigned i = 0; i < size; ++i)
+ int const size = _declaration.getType()->getSizeOnStack();
+ for (int i = 0; i < size; ++i)
*this << u256(0);
m_asm.adjustDeposit(-size);
}
diff --git a/CompilerContext.h b/CompilerContext.h
index 795f447a..14672c95 100644
--- a/CompilerContext.h
+++ b/CompilerContext.h
@@ -51,10 +51,10 @@ public:
void adjustStackOffset(int _adjustment) { m_asm.adjustDeposit(_adjustment); }
- bool isMagicGlobal(Declaration const* _declaration) const { return m_magicGlobals.count(_declaration); }
- bool isFunctionDefinition(Declaration const* _declaration) const { return m_functionEntryLabels.count(_declaration); }
+ bool isMagicGlobal(Declaration const* _declaration) const { return m_magicGlobals.count(_declaration) != 0; }
+ bool isFunctionDefinition(Declaration const* _declaration) const { return m_functionEntryLabels.count(_declaration) != 0; }
bool isLocalVariable(Declaration const* _declaration) const;
- bool isStateVariable(Declaration const* _declaration) const { return m_stateVariables.count(_declaration); }
+ bool isStateVariable(Declaration const* _declaration) const { return m_stateVariables.count(_declaration) != 0; }
eth::AssemblyItem getFunctionEntryLabel(FunctionDefinition const& _function) const;
/// Returns the distance of the given local variable from the top of the local variable stack.
diff --git a/CompilerStack.cpp b/CompilerStack.cpp
index 174f9cd2..904c77c5 100644
--- a/CompilerStack.cpp
+++ b/CompilerStack.cpp
@@ -39,7 +39,7 @@ namespace solidity
bool CompilerStack::addSource(string const& _name, string const& _content)
{
- bool existed = m_sources.count(_name);
+ bool existed = m_sources.count(_name) != 0;
reset(true);
m_sources[_name].scanner = make_shared<Scanner>(CharStream(_content), _name);
return existed;
diff --git a/Types.h b/Types.h
index deabe116..1ccdd706 100644
--- a/Types.h
+++ b/Types.h
@@ -178,7 +178,7 @@ public:
int getNumBits() const { return m_bits; }
bool isHash() const { return m_modifier == Modifier::HASH || m_modifier == Modifier::ADDRESS; }
bool isAddress() const { return m_modifier == Modifier::ADDRESS; }
- int isSigned() const { return m_modifier == Modifier::SIGNED; }
+ bool isSigned() const { return m_modifier == Modifier::SIGNED; }
static const MemberList AddressMemberList;
diff --git a/Utils.h b/Utils.h
index 8d6a3ab0..1411f66b 100644..100755
--- a/Utils.h
+++ b/Utils.h
@@ -45,5 +45,11 @@ inline void solAssertAux(bool _condition, std::string const& _errorDescription,
<< ::boost::throw_line(_line));
}
+inline void solAssertAux(void const* _pointer, std::string const& _errorDescription, unsigned _line,
+ char const* _file, char const* _function)
+{
+ solAssertAux(_pointer != nullptr, _errorDescription, _line, _file, _function);
+}
+
}
}