From 95e161bfc99c2f83a8b9f522679c101de7fa8b98 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 15 Apr 2015 14:09:39 +0200 Subject: [PATCH] style fixes --- libevmcore/Assembly.cpp | 16 ++++++++-------- libevmcore/Assembly.h | 18 ++++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/libevmcore/Assembly.cpp b/libevmcore/Assembly.cpp index cb4af28c9..a5ea0211e 100644 --- a/libevmcore/Assembly.cpp +++ b/libevmcore/Assembly.cpp @@ -189,35 +189,35 @@ Json::Value Assembly::streamAsmJson(ostream& _out, string const& _prefix, String { case Operation: currentCollection.push_back( - createJsonValue(instructionInfo(i.instruction()).name, i.getLocation().start, i.getLocation().end, i.getJumpTypeAsString())); + createJsonValue(instructionInfo(i.instruction()).name, i.getLocation().start, i.getLocation().end, i.getJumpTypeAsString())); break; case Push: { std::stringstream hexStr; - hexStr << hex << (unsigned)i.data(); + hexStr << hex << i.data(); currentCollection.push_back( - createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, hexStr.str(), i.getJumpTypeAsString())); + createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, hexStr.str(), i.getJumpTypeAsString())); } break; case PushString: currentCollection.push_back( - createJsonValue(string("PUSH tag"), i.getLocation().start, i.getLocation().end, m_strings.at((h256)i.data()))); + createJsonValue(string("PUSH tag"), i.getLocation().start, i.getLocation().end, m_strings.at((h256)i.data()))); break; case PushTag: currentCollection.push_back( - createJsonValue(string("PUSH [tag]"), i.getLocation().start, i.getLocation().end, string(i.data()))); + createJsonValue(string("PUSH [tag]"), i.getLocation().start, i.getLocation().end, string(i.data()))); break; case PushSub: currentCollection.push_back( - createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, string("[$]" + string(h256(i.data()).abridged())))); + createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, string("[$]" + dev::toString(h256(i.data()))))); break; case PushSubSize: currentCollection.push_back( - createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, string("#[$]" + string(h256(i.data()).abridged())))); + createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, string("#[$]" + dev::toString(h256(i.data()))))); break; case PushProgramSize: currentCollection.push_back( - createJsonValue(string("PUSHSIZE"), i.getLocation().start, i.getLocation().end)); + createJsonValue(string("PUSHSIZE"), i.getLocation().start, i.getLocation().end)); break; case Tag: { diff --git a/libevmcore/Assembly.h b/libevmcore/Assembly.h index 86169a93d..86fd222b3 100644 --- a/libevmcore/Assembly.h +++ b/libevmcore/Assembly.h @@ -92,10 +92,11 @@ public: bytes assemble() const; Assembly& optimise(bool _enable); Json::Value stream( - std::ostream& _out, - std::string const& _prefix = "", - const StringMap &_sourceCodes = StringMap(), - bool _inJsonFormat = false) const; + std::ostream& _out, + std::string const& _prefix = "", + const StringMap &_sourceCodes = StringMap(), + bool _inJsonFormat = false + ) const; protected: std::string getLocationFromSources(StringMap const& _sourceCodes, SourceLocation const& _location) const; @@ -104,10 +105,11 @@ protected: private: Json::Value streamAsmJson( - std::ostream& _out, - const std::string &_prefix, - const StringMap &_sourceCodes, - bool _inJsonFormat) const; + std::ostream& _out, + const std::string &_prefix, + const StringMap &_sourceCodes, + bool _inJsonFormat + ) const; std::ostream& streamAsm(std::ostream& _out, std::string const& _prefix, StringMap const& _sourceCodes) const; Json::Value createJsonValue(std::string _name, int _locationX, int _locationY, std::string _value = std::string(), std::string _jumpType = std::string()) const;