Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/39557 )
Change subject: arch-x86: Stop "using namespace std"
......................................................................
arch-x86: Stop "using namespace std"
Change-Id: I9763177bbd54abc97b99bd54a20a750e0adb5627
---
M src/arch/x86/bios/acpi.cc
M src/arch/x86/bios/e820.cc
M src/arch/x86/bios/intelmp.cc
M src/arch/x86/bios/smbios.cc
M src/arch/x86/isa/includes.isa
M src/arch/x86/process.cc
M src/arch/x86/remote_gdb.cc
M src/arch/x86/types.cc
8 files changed, 16 insertions(+), 26 deletions(-)
diff --git a/src/arch/x86/bios/acpi.cc b/src/arch/x86/bios/acpi.cc
index 5ecb09b..20cf088 100644
--- a/src/arch/x86/bios/acpi.cc
+++ b/src/arch/x86/bios/acpi.cc
@@ -45,8 +45,6 @@
#include "sim/byteswap.hh"
#include "sim/sim_object.hh"
-using namespace std;
-
const char X86ISA::ACPI::RSDP::signature[] = "RSD PTR ";
X86ISA::ACPI::RSDP::RSDP(const Params &p) : SimObject(p), oemID(p.oem_id),
diff --git a/src/arch/x86/bios/e820.cc b/src/arch/x86/bios/e820.cc
index a377703..a22f66c 100644
--- a/src/arch/x86/bios/e820.cc
+++ b/src/arch/x86/bios/e820.cc
@@ -41,7 +41,6 @@
#include "mem/port_proxy.hh"
#include "sim/byteswap.hh"
-using namespace std;
using namespace X86ISA;
template<class T>
diff --git a/src/arch/x86/bios/intelmp.cc b/src/arch/x86/bios/intelmp.cc
index 6378c48..ba9ba20 100644
--- a/src/arch/x86/bios/intelmp.cc
+++ b/src/arch/x86/bios/intelmp.cc
@@ -63,8 +63,6 @@
#include "params/X86IntelMPBusHierarchy.hh"
#include "params/X86IntelMPCompatAddrSpaceMod.hh"
-using namespace std;
-
const char X86ISA::IntelMP::FloatingPointer::signature[] = "_MP_";
template<class T>
@@ -83,7 +81,7 @@
}
uint8_t
-writeOutString(PortProxy& proxy, Addr addr, string str, int length)
+writeOutString(PortProxy& proxy, Addr addr, std::string str, int length)
{
char cleanedString[length + 1];
cleanedString[length] = 0;
@@ -210,7 +208,7 @@
proxy.writeBlob(addr + 43, &reserved, 1);
checkSum += reserved;
- vector<BaseConfigEntry *>::iterator baseEnt;
+ std::vector<BaseConfigEntry *>::iterator baseEnt;
uint16_t offset = 44;
for (baseEnt = baseEntries.begin();
baseEnt != baseEntries.end(); baseEnt++) {
@@ -220,7 +218,7 @@
// We've found the end of the base table this point.
checkSum += writeOutField(proxy, addr + 4, offset);
- vector<ExtConfigEntry *>::iterator extEnt;
+ std::vector<ExtConfigEntry *>::iterator extEnt;
uint16_t extOffset = 0;
uint8_t extCheckSum = 0;
for (extEnt = extEntries.begin();
diff --git a/src/arch/x86/bios/smbios.cc b/src/arch/x86/bios/smbios.cc
index afe0f15..ead87cf 100644
--- a/src/arch/x86/bios/smbios.cc
+++ b/src/arch/x86/bios/smbios.cc
@@ -48,8 +48,6 @@
#include "params/X86SMBiosSMBiosTable.hh"
#include "sim/byteswap.hh"
-using namespace std;
-
const char X86ISA::SMBios::SMBiosTable::SMBiosHeader::anchorString[]
= "_SM_";
const uint8_t X86ISA::SMBios::SMBiosTable::
SMBiosHeader::formattedArea[] = {0,0,0,0,0};
@@ -128,7 +126,7 @@
}
int
-X86ISA::SMBios::SMBiosStructure::addString(const string &new_string)
+X86ISA::SMBios::SMBiosStructure::addString(const std::string &new_string)
{
stringFields = true;
// If a string is empty, treat it as not existing. The index for empty
@@ -139,7 +137,7 @@
return strings.size();
}
-string
+std::string
X86ISA::SMBios::SMBiosStructure::readString(int n)
{
assert(n > 0 && n <= strings.size());
diff --git a/src/arch/x86/isa/includes.isa b/src/arch/x86/isa/includes.isa
index d2098c3..3bd7872 100644
--- a/src/arch/x86/isa/includes.isa
+++ b/src/arch/x86/isa/includes.isa
@@ -126,6 +126,5 @@
#include "sim/sim_exit.hh"
using namespace X86ISA;
-using namespace std;
}};
diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc
index 03e8641..925c836 100644
--- a/src/arch/x86/process.cc
+++ b/src/arch/x86/process.cc
@@ -65,7 +65,6 @@
#include "sim/syscall_return.hh"
#include "sim/system.hh"
-using namespace std;
using namespace X86ISA;
template class MultiLevelPageTable<LongModePTE<47, 39>,
@@ -112,9 +111,9 @@
Addr next_thread_stack_base = stack_base - max_stack_size;
Addr mmap_end = 0x7FFFF7FFF000ULL;
- memState = make_shared<MemState>(this, brk_point, stack_base,
- max_stack_size,
next_thread_stack_base,
- mmap_end);
+ memState = std::make_shared<MemState>(
+ this, brk_point, stack_base, max_stack_size,
+ next_thread_stack_base, mmap_end);
}
@@ -139,9 +138,9 @@
Addr next_thread_stack_base = stack_base - max_stack_size;
Addr mmap_end = 0xB7FFF000ULL;
- memState = make_shared<MemState>(this, brk_point, stack_base,
- max_stack_size,
next_thread_stack_base,
- mmap_end);
+ memState = std::make_shared<MemState>(
+ this, brk_point, stack_base, max_stack_size,
+ next_thread_stack_base, mmap_end);
}
void
@@ -714,7 +713,7 @@
std::vector<AuxVector<IntType>> auxv = extraAuxvs;
- string filename;
+ std::string filename;
if (argv.size() < 1)
filename = "";
else
@@ -850,7 +849,7 @@
const int numRandomBytes = 16;
int aux_data_size = numRandomBytes;
- string platform = "x86_64";
+ std::string platform = "x86_64";
aux_data_size += platform.size() + 1;
int env_data_size = 0;
diff --git a/src/arch/x86/remote_gdb.cc b/src/arch/x86/remote_gdb.cc
index 2f38fd5f..c2d622e 100644
--- a/src/arch/x86/remote_gdb.cc
+++ b/src/arch/x86/remote_gdb.cc
@@ -58,7 +58,6 @@
#include "mem/page_table.hh"
#include "sim/full_system.hh"
-using namespace std;
using namespace X86ISA;
RemoteGDB::RemoteGDB(System *_system, ThreadContext *c, int _port) :
diff --git a/src/arch/x86/types.cc b/src/arch/x86/types.cc
index 8588467..5806623 100644
--- a/src/arch/x86/types.cc
+++ b/src/arch/x86/types.cc
@@ -31,11 +31,11 @@
#include "sim/serialize.hh"
using namespace X86ISA;
-using namespace std;
template <>
void
-paramOut(CheckpointOut &cp, const string &name, ExtMachInst const
&machInst)
+paramOut(CheckpointOut &cp, const std::string &name,
+ ExtMachInst const &machInst)
{
// Prefixes
paramOut(cp, name + ".legacy", (uint8_t)machInst.legacy);
@@ -66,7 +66,7 @@
template <>
void
-paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst)
+paramIn(CheckpointIn &cp, const std::string &name, ExtMachInst &machInst)
{
uint8_t temp8;
// Prefixes
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/39557
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I9763177bbd54abc97b99bd54a20a750e0adb5627
Gerrit-Change-Number: 39557
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s