cppcheck fixes.

This commit is contained in:
Gav Wood 2015-02-20 21:00:13 +01:00
parent 26132363d5
commit 8524051166
2 changed files with 17 additions and 8 deletions

View File

@ -372,7 +372,7 @@ public:
static Value AssignmentToBinaryOp(Value op) static Value AssignmentToBinaryOp(Value op)
{ {
solAssert(isAssignmentOp(op) && op != Assign, ""); solAssert(isAssignmentOp(op) && op != Assign, "");
return Token::Value(op + (BitOr - AssignBitOr)); return Value(op + (BitOr - AssignBitOr));
} }
static bool isBitOp(Value op) { return (BitOr <= op && op <= SHR) || op == BitNot; } static bool isBitOp(Value op) { return (BitOr <= op && op <= SHR) || op == BitNot; }

23
Types.h
View File

@ -430,12 +430,21 @@ public:
Location _location = Location::Internal, bool _arbitraryParameters = false): Location _location = Location::Internal, bool _arbitraryParameters = false):
FunctionType(parseElementaryTypeVector(_parameterTypes), parseElementaryTypeVector(_returnParameterTypes), FunctionType(parseElementaryTypeVector(_parameterTypes), parseElementaryTypeVector(_returnParameterTypes),
_location, _arbitraryParameters) {} _location, _arbitraryParameters) {}
FunctionType(TypePointers const& _parameterTypes, TypePointers const& _returnParameterTypes, FunctionType(
Location _location = Location::Internal, TypePointers const& _parameterTypes,
bool _arbitraryParameters = false, bool _gasSet = false, bool _valueSet = false): TypePointers const& _returnParameterTypes,
m_parameterTypes(_parameterTypes), m_returnParameterTypes(_returnParameterTypes), Location _location = Location::Internal,
m_location(_location), bool _arbitraryParameters = false,
m_arbitraryParameters(_arbitraryParameters), m_gasSet(_gasSet), m_valueSet(_valueSet) {} bool _gasSet = false,
bool _valueSet = false
):
m_parameterTypes (_parameterTypes),
m_returnParameterTypes (_returnParameterTypes),
m_location (_location),
m_arbitraryParameters (_arbitraryParameters),
m_gasSet (_gasSet),
m_valueSet (_valueSet)
{}
TypePointers const& getParameterTypes() const { return m_parameterTypes; } TypePointers const& getParameterTypes() const { return m_parameterTypes; }
std::vector<std::string> const& getParameterNames() const { return m_parameterNames; } std::vector<std::string> const& getParameterNames() const { return m_parameterNames; }
@ -490,7 +499,7 @@ private:
bool const m_arbitraryParameters = false; bool const m_arbitraryParameters = false;
bool const m_gasSet = false; ///< true iff the gas value to be used is on the stack bool const m_gasSet = false; ///< true iff the gas value to be used is on the stack
bool const m_valueSet = false; ///< true iff the value to be sent is on the stack bool const m_valueSet = false; ///< true iff the value to be sent is on the stack
bool m_isConstant; bool m_isConstant = false;
mutable std::unique_ptr<MemberList> m_members; mutable std::unique_ptr<MemberList> m_members;
Declaration const* m_declaration = nullptr; Declaration const* m_declaration = nullptr;
}; };