misc: Stop "using namespace std" in protoio.cc.
authorGabe Black <gabe.black@gmail.com>
Thu, 21 Jan 2021 12:42:05 +0000 (04:42 -0800)
committerGabe Black <gabe.black@gmail.com>
Sat, 23 Jan 2021 22:49:26 +0000 (22:49 +0000)
Change-Id: I4f27979910230860c631b63bb500f87b45c24e33
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39563
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/proto/protoio.cc

index 691d4ee5cd2b8c0e253c9cdd2696f3c888a649ce..72e463b8ea643ca398b1a09716d54ff31af47081 100644 (file)
 
 #include "base/logging.hh"
 
-using namespace std;
 using namespace google::protobuf;
 
-ProtoOutputStream::ProtoOutputStream(const string& filename) :
-    fileStream(filename.c_str(), ios::out | ios::binary | ios::trunc),
+ProtoOutputStream::ProtoOutputStream(const std::string& filename) :
+    fileStream(filename.c_str(),
+            std::ios::out | std::ios::binary | std::ios::trunc),
     wrappedFileStream(NULL), gzipStream(NULL), zeroCopyStream(NULL)
 {
     if (!fileStream.good())
@@ -98,9 +98,9 @@ ProtoOutputStream::write(const Message& msg)
     msg.SerializeWithCachedSizes(&codedStream);
 }
 
-ProtoInputStream::ProtoInputStream(const string& filename) :
-    fileStream(filename.c_str(), ios::in | ios::binary), fileName(filename),
-    useGzip(false),
+ProtoInputStream::ProtoInputStream(const std::string& filename) :
+    fileStream(filename.c_str(), std::ios::in | std::ios::binary),
+    fileName(filename), useGzip(false),
     wrappedFileStream(NULL), gzipStream(NULL), zeroCopyStream(NULL)
 {
     if (!fileStream.good())
@@ -113,7 +113,7 @@ ProtoInputStream::ProtoInputStream(const string& filename) :
 
     // seek to the start of the input file and clear any flags
     fileStream.clear();
-    fileStream.seekg(0, ifstream::beg);
+    fileStream.seekg(0, std::ifstream::beg);
 
     createStreams();
 }
@@ -172,7 +172,7 @@ ProtoInputStream::reset()
     destroyStreams();
     // seek to the start of the input file and clear any flags
     fileStream.clear();
-    fileStream.seekg(0, ifstream::beg);
+    fileStream.seekg(0, std::ifstream::beg);
     createStreams();
 }