diff options
author | arkpar <arkady.paronyan@gmail.com> | 2015-01-13 18:18:08 +0800 |
---|---|---|
committer | arkpar <arkady.paronyan@gmail.com> | 2015-01-13 18:18:08 +0800 |
commit | 80eec8b308e8af3b742e3da47ded927e4e4b388d (patch) | |
tree | db9bf42fd469fc4ee5707ddf374d8dc28e61bbc5 | |
parent | 24a2335c01fa2d0baeda97b795a9bf8b05b6529d (diff) | |
download | dexon-solidity-80eec8b308e8af3b742e3da47ded927e4e4b388d.tar dexon-solidity-80eec8b308e8af3b742e3da47ded927e4e4b388d.tar.gz dexon-solidity-80eec8b308e8af3b742e3da47ded927e4e4b388d.tar.bz2 dexon-solidity-80eec8b308e8af3b742e3da47ded927e4e4b388d.tar.lz dexon-solidity-80eec8b308e8af3b742e3da47ded927e4e4b388d.tar.xz dexon-solidity-80eec8b308e8af3b742e3da47ded927e4e4b388d.tar.zst dexon-solidity-80eec8b308e8af3b742e3da47ded927e4e4b388d.zip |
fixed warnings for msvc build
-rwxr-xr-x[-rw-r--r--] | AST.h | 0 | ||||
-rw-r--r-- | CompilerContext.cpp | 4 | ||||
-rw-r--r-- | CompilerContext.h | 6 | ||||
-rw-r--r-- | CompilerStack.cpp | 2 | ||||
-rw-r--r-- | Types.h | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | Utils.h | 6 |
6 files changed, 13 insertions, 7 deletions
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; @@ -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; @@ -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); +} + } } |