Switch stream properties back after temporary modification

This commit is contained in:
Alex Beregszaszi 2017-08-22 13:55:01 +01:00
parent 97169e58ae
commit f38429fef8
2 changed files with 8 additions and 6 deletions

View File

@ -27,6 +27,7 @@
#include <cstdint> #include <cstdint>
#include <algorithm> #include <algorithm>
#include <boost/functional/hash.hpp> #include <boost/functional/hash.hpp>
#include <boost/io/ios_state.hpp>
#include "CommonData.h" #include "CommonData.h"
namespace dev namespace dev
@ -224,6 +225,7 @@ template<> inline size_t FixedHash<32>::hash::operator()(FixedHash<32> const& va
template <unsigned N> template <unsigned N>
inline std::ostream& operator<<(std::ostream& _out, FixedHash<N> const& _h) inline std::ostream& operator<<(std::ostream& _out, FixedHash<N> const& _h)
{ {
boost::io::ios_all_saver guard(_out);
_out << std::noshowbase << std::hex << std::setfill('0'); _out << std::noshowbase << std::hex << std::setfill('0');
for (unsigned i = 0; i < N; ++i) for (unsigned i = 0; i < N; ++i)
_out << std::setw(2) << (int)_h[i]; _out << std::setw(2) << (int)_h[i];

View File

@ -219,10 +219,10 @@ ostream& dev::eth::operator<<(ostream& _out, AssemblyItem const& _item)
_out << "\t" << _item.getJumpTypeAsString(); _out << "\t" << _item.getJumpTypeAsString();
break; break;
case Push: case Push:
_out << " PUSH " << hex << _item.data(); _out << " PUSH " << hex << _item.data() << dec;
break; break;
case PushString: case PushString:
_out << " PushString" << hex << (unsigned)_item.data(); _out << " PushString" << hex << (unsigned)_item.data() << dec;
break; break;
case PushTag: case PushTag:
{ {
@ -237,19 +237,19 @@ ostream& dev::eth::operator<<(ostream& _out, AssemblyItem const& _item)
_out << " Tag " << _item.data(); _out << " Tag " << _item.data();
break; break;
case PushData: case PushData:
_out << " PushData " << hex << (unsigned)_item.data(); _out << " PushData " << hex << (unsigned)_item.data() << dec;
break; break;
case PushSub: case PushSub:
_out << " PushSub " << hex << size_t(_item.data()); _out << " PushSub " << hex << size_t(_item.data()) << dec;
break; break;
case PushSubSize: case PushSubSize:
_out << " PushSubSize " << hex << size_t(_item.data()); _out << " PushSubSize " << hex << size_t(_item.data()) << dec;
break; break;
case PushProgramSize: case PushProgramSize:
_out << " PushProgramSize"; _out << " PushProgramSize";
break; break;
case PushLibraryAddress: case PushLibraryAddress:
_out << " PushLibraryAddress " << hex << h256(_item.data()).abridgedMiddle(); _out << " PushLibraryAddress " << hex << h256(_item.data()).abridgedMiddle() << dec;
break; break;
case UndefinedItem: case UndefinedItem:
_out << " ???"; _out << " ???";