Kovacsics Róbert has uploaded this change for review. ( https://gem5-review.googlesource.com/11809

Change subject: Removed "using namespace std;" from src/mem/packet.cc
......................................................................

Removed "using namespace std;" from src/mem/packet.cc

To avoid unintentional variable capture, these are the identifiers
which are in the std namespace (according to
https://en.cppreference.com/w/cpp/symbol_index), but not prefixed with
"std::"

int8_t int16_t int32_t int64_t
uint8_t uint16_t uint32_t uint64_t
set

The (u)int types are included from src/mem/packet.hh then from
src/base/types.hh then from <inttypes.h>

The set is from Packet::set, which in a Packet:: function should
shadow the std::set (it is in Packet::setUintX)

Change-Id: I7f6c0b61b09658e224fe31a9f73150b81861d6f8
---
M src/mem/packet.cc
1 file changed, 12 insertions(+), 11 deletions(-)



diff --git a/src/mem/packet.cc b/src/mem/packet.cc
index f2f7fd9..038ae34 100644
--- a/src/mem/packet.cc
+++ b/src/mem/packet.cc
@@ -59,8 +59,6 @@
 #include "base/trace.hh"
 #include "mem/packet_access.hh"

-using namespace std;
-
 // The one downside to bitsets is that static initializers can get ugly.
 #define SET1(a1)                     (1 << (a1))
 #define SET2(a1, a2)                 (SET1(a1) | SET1(a2))
@@ -260,7 +258,7 @@
         std::max(val_start, func_start);

     if (isRead()) {
-        memcpy(getPtr<uint8_t>() + func_offset,
+        std::memcpy(getPtr<uint8_t>() + func_offset,
                _data + val_offset,
                overlap_size);

@@ -288,7 +286,7 @@

         return all_bytes_valid;
     } else if (isWrite()) {
-        memcpy(_data + val_offset,
+        std::memcpy(_data + val_offset,
                getConstPtr<uint8_t>() + func_offset,
                overlap_size);
     } else {
@@ -357,7 +355,8 @@
 }

 void
-Packet::print(ostream &o, const int verbosity, const string &prefix) const
+Packet::print(std::ostream &o, const int verbosity,
+              const std::string &prefix) const
 {
     ccprintf(o, "%s%s [%x:%x]%s%s%s%s%s%s", prefix, cmdString(),
              getAddr(), getAddr() + getSize() - 1,
@@ -371,13 +370,13 @@

 std::string
 Packet::print() const {
-    ostringstream str;
+    std::ostringstream str;
     print(str);
     return str.str();
 }

-Packet::PrintReqState::PrintReqState(ostream &_os, int _verbosity)
-    : curPrefixPtr(new string("")), os(_os), verbosity(_verbosity)
+Packet::PrintReqState::PrintReqState(std::ostream &_os, int _verbosity)
+    : curPrefixPtr(new std::string("")), os(_os), verbosity(_verbosity)
 {
     labelStack.push_back(LabelStackEntry("", curPrefixPtr));
 }
@@ -390,16 +389,18 @@
 }

 Packet::PrintReqState::
-LabelStackEntry::LabelStackEntry(const string &_label, string *_prefix)
+LabelStackEntry::LabelStackEntry(const std::string &_label,
+                                 std::string *_prefix)
     : label(_label), prefix(_prefix), labelPrinted(false)
 {
 }

 void
-Packet::PrintReqState::pushLabel(const string &lbl, const string &prefix)
+Packet::PrintReqState::pushLabel(const std::string &lbl,
+                                 const std::string &prefix)
 {
     labelStack.push_back(LabelStackEntry(lbl, curPrefixPtr));
-    curPrefixPtr = new string(*curPrefixPtr);
+    curPrefixPtr = new std::string(*curPrefixPtr);
     *curPrefixPtr += prefix;
 }


--
To view, visit https://gem5-review.googlesource.com/11809
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I7f6c0b61b09658e224fe31a9f73150b81861d6f8
Gerrit-Change-Number: 11809
Gerrit-PatchSet: 1
Gerrit-Owner: Kovacsics Róbert <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to