]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fiddle C++ stream idiom.
authorRoland McGrath <roland@redhat.com>
Sun, 20 Sep 2009 01:23:44 +0000 (18:23 -0700)
committerRoland McGrath <roland@redhat.com>
Sun, 20 Sep 2009 01:23:44 +0000 (18:23 -0700)
libdw/c++/subr.hh
libdw/c++/values.cc

index 896ad7a73a907bd67c75a58304963be737ec7580..bc76d5702aea76cbc9db99e3a45360aedde8d884 100644 (file)
@@ -187,9 +187,7 @@ namespace elfutils
     static inline std::string hex_string (int code)
     {
       std::ostringstream os;
-      os.setf (std::ios::hex, std::ios::basefield);
-      os.setf (std::ios::showbase);
-      os << code;
+      os << std::hex << std::showbase << code;
       return os.str ();
     }
 
index 8f97a98f79afe1953d449602bf2e9304bb27eaab..66fffc1283a5ab28525cc576aa5795bcbd8cac51 100644 (file)
@@ -147,9 +147,7 @@ static string
 hex_string (Dwarf_Word value, const char *before = "", const char *after = "")
 {
   std::ostringstream os;
-  os.setf (std::ios::hex, std::ios::basefield);
-  os.setf (std::ios::showbase);
-  os << before << value << after;
+  os << std::hex << std::showbase << before << value << after;
   return os.str ();
 }
 
@@ -478,10 +476,8 @@ string
 __libdw_ranges_to_string (const container &c)
 {
   std::ostringstream os;
-  os.setf (std::ios::hex, std::ios::basefield);
-  os.setf (std::ios::showbase);
 
-  os << "<";
+  os << "<" << std::hex << std::showbase;
 
   bool first = true;
   for (typename container::const_iterator i = c.begin (); i != c.end (); ++i)