From 285e07be7627524b6b668063a8f1cd2903d6dedd Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 10 Aug 2014 00:53:02 -0700 Subject: [PATCH] MicroVU: removed usage of "using namespace std" --- pcsx2/x86/microVU.cpp | 18 +++++++++--------- pcsx2/x86/microVU.h | 5 ++--- pcsx2/x86/microVU_Compile.inl | 6 +++--- pcsx2/x86/microVU_Flags.inl | 4 ++-- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/pcsx2/x86/microVU.cpp b/pcsx2/x86/microVU.cpp index 2947eb431f..22d760d503 100644 --- a/pcsx2/x86/microVU.cpp +++ b/pcsx2/x86/microVU.cpp @@ -104,10 +104,10 @@ void mVUreset(microVU& mVU, bool resetReserve) { for(u32 i = 0; i < (mVU.progSize / 2); i++) { if(!mVU.prog.prog[i]) { - mVU.prog.prog[i] = new deque(); + mVU.prog.prog[i] = new std::deque(); continue; } - deque::iterator it(mVU.prog.prog[i]->begin()); + std::deque::iterator it(mVU.prog.prog[i]->begin()); for ( ; it != mVU.prog.prog[i]->end(); ++it) { mVUdeleteProg(mVU, it[0]); } @@ -126,7 +126,7 @@ void mVUclose(microVU& mVU) { // Delete Programs and Block Managers for (u32 i = 0; i < (mVU.progSize / 2); i++) { if (!mVU.prog.prog[i]) continue; - deque::iterator it(mVU.prog.prog[i]->begin()); + std::deque::iterator it(mVU.prog.prog[i]->begin()); for ( ; it != mVU.prog.prog[i]->end(); ++it) { mVUdeleteProg(mVU, it[0]); } @@ -169,7 +169,7 @@ __ri microProgram* mVUcreateProg(microVU& mVU, int startPC) { microProgram* prog = (microProgram*)_aligned_malloc(sizeof(microProgram), 64); memzero_ptr(prog); prog->idx = mVU.prog.total++; - prog->ranges = new deque(); + prog->ranges = new std::deque(); prog->startPC = startPC; mVUcacheProg(mVU, *prog); // Cache Micro Program double cacheSize = (double)((uptr)mVU.prog.x86end - (uptr)mVU.prog.x86start); @@ -191,7 +191,7 @@ __ri void mVUcacheProg(microVU& mVU, microProgram& prog) { // Generate Hash for partial program based on compiled ranges... u64 mVUrangesHash(microVU& mVU, microProgram& prog) { u32 hash[2] = {0, 0}; - deque::const_iterator it(prog.ranges->begin()); + std::deque::const_iterator it(prog.ranges->begin()); for ( ; it != prog.ranges->end(); ++it) { if((it[0].start<0)||(it[0].end<0)) { DevCon.Error("microVU%d: Negative Range![%d][%d]", mVU.index, it[0].start, it[0].end); } for(int i = it[0].start/4; i < it[0].end/4; i++) { @@ -204,11 +204,11 @@ u64 mVUrangesHash(microVU& mVU, microProgram& prog) { // Prints the ratio of unique programs to total programs void mVUprintUniqueRatio(microVU& mVU) { - vector v; + std::vector v; for(u32 pc = 0; pc < mProgSize/2; pc++) { microProgramList* list = mVU.prog.prog[pc]; if (!list) continue; - deque::iterator it(list->begin()); + std::deque::iterator it(list->begin()); for ( ; it != list->end(); ++it) { v.push_back(mVUrangesHash(mVU, *it[0])); } @@ -222,7 +222,7 @@ void mVUprintUniqueRatio(microVU& mVU) { // Compare partial program by only checking compiled ranges... __ri bool mVUcmpPartial(microVU& mVU, microProgram& prog) { - deque::const_iterator it(prog.ranges->begin()); + std::deque::const_iterator it(prog.ranges->begin()); for ( ; it != prog.ranges->end(); ++it) { if((it[0].start<0)||(it[0].end<0)) { DevCon.Error("microVU%d: Negative Range![%d][%d]", mVU.index, it[0].start, it[0].end); } if (memcmp_mmx(cmpOffset(prog.data), cmpOffset(mVU.regs().Micro), ((it[0].end + 8) - it[0].start))) { @@ -250,7 +250,7 @@ _mVUt __fi void* mVUsearchProg(u32 startPC, uptr pState) { microProgramQuick& quick = mVU.prog.quick[startPC/8]; microProgramList* list = mVU.prog.prog [startPC/8]; if(!quick.prog) { // If null, we need to search for new program - deque::iterator it(list->begin()); + std::deque::iterator it(list->begin()); for ( ; it != list->end(); ++it) { if (mVUcmpProg(mVU, *it[0], 0)) { quick.block = it[0]->block[startPC/8]; diff --git a/pcsx2/x86/microVU.h b/pcsx2/x86/microVU.h index 76c7713496..a1bf51790a 100644 --- a/pcsx2/x86/microVU.h +++ b/pcsx2/x86/microVU.h @@ -18,7 +18,6 @@ //#define mVUprofileProg // Shows opcode statistics in console class AsciiFile; -using namespace std; using namespace x86Emitter; #include @@ -145,12 +144,12 @@ struct microRange { struct microProgram { u32 data [mProgSize]; // Holds a copy of the VU microProgram microBlockManager* block[mProgSize/2]; // Array of Block Managers - deque* ranges; // The ranges of the microProgram that have already been recompiled + std::deque* ranges; // The ranges of the microProgram that have already been recompiled u32 startPC; // Start PC of this program int idx; // Program index }; -typedef deque microProgramList; +typedef std::deque microProgramList; struct microProgramQuick { microBlockManager* block; // Quick reference to valid microBlockManager for current startPC diff --git a/pcsx2/x86/microVU_Compile.inl b/pcsx2/x86/microVU_Compile.inl index d5624d034c..da52a3b2d3 100644 --- a/pcsx2/x86/microVU_Compile.inl +++ b/pcsx2/x86/microVU_Compile.inl @@ -43,11 +43,11 @@ __fi void mVUcheckIsSame(mV) { // Sets up microProgram PC ranges based on whats been recompiled void mVUsetupRange(microVU& mVU, s32 pc, bool isStartPC) { - deque*& ranges = mVUcurProg.ranges; + std::deque*& ranges = mVUcurProg.ranges; pc &= mVU.microMemSize - 8; if (isStartPC) { // Check if startPC is already within a block we've recompiled - deque::const_iterator it(ranges->begin()); + std::deque::const_iterator it(ranges->begin()); for ( ; it != ranges->end(); ++it) { if ((pc >= it[0].start) && (pc <= it[0].end)) { if (it[0].start != it[0].end) @@ -72,7 +72,7 @@ void mVUsetupRange(microVU& mVU, s32 pc, bool isStartPC) { bool mergedRange = false; s32 rStart = mVUrange.start; s32 rEnd = mVUrange.end; - deque::iterator it(ranges->begin()); + std::deque::iterator it(ranges->begin()); for (++it; it != ranges->end(); ++it) { if((it[0].start >= rStart) && (it[0].start <= rEnd)) { it[0].end = max(it[0].end, rEnd); diff --git a/pcsx2/x86/microVU_Flags.inl b/pcsx2/x86/microVU_Flags.inl index 32dd33eb9e..39b843ee72 100644 --- a/pcsx2/x86/microVU_Flags.inl +++ b/pcsx2/x86/microVU_Flags.inl @@ -338,7 +338,7 @@ __fi void mVUsetupFlags(mV, microFlagCycles& mFC) { } // Scan through instructions and check if flags are read (FSxxx, FMxxx, FCxxx opcodes) -void _mVUflagPass(mV, u32 startPC, u32 sCount, u32 found, vector& v) { +void _mVUflagPass(mV, u32 startPC, u32 sCount, u32 found, std::vector& v) { for (u32 i = 0; i < v.size(); i++) { if (v[i] == startPC) return; // Prevent infinite recursion @@ -375,7 +375,7 @@ void _mVUflagPass(mV, u32 startPC, u32 sCount, u32 found, vector& v) { } void mVUflagPass(mV, u32 startPC, u32 sCount = 0, u32 found = 0) { - vector v; + std::vector v; _mVUflagPass(mVU, startPC, sCount, found, v); }