From: Gabe Black Date: Thu, 21 Jan 2021 12:42:05 +0000 (-0800) Subject: misc: Stop "using namespace std" in protoio.cc. X-Git-Tag: develop-gem5-snapshot~238 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=515567896158c7492f519105b05ec541b6cb3019;p=gem5.git misc: Stop "using namespace std" in protoio.cc. Change-Id: I4f27979910230860c631b63bb500f87b45c24e33 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39563 Reviewed-by: Daniel Carvalho Maintainer: Gabe Black Tested-by: kokoro --- diff --git a/src/proto/protoio.cc b/src/proto/protoio.cc index 691d4ee5c..72e463b8e 100644 --- a/src/proto/protoio.cc +++ b/src/proto/protoio.cc @@ -39,11 +39,11 @@ #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(); }