Merge pull request #767 from lioncash/namespaces

Get rid of instances of "using namespace std;" in the project
This commit is contained in:
Lioncash 2014-08-17 02:09:02 -04:00
commit 97ffb08a42
9 changed files with 25 additions and 34 deletions

View File

@ -86,7 +86,7 @@ ALDeviceList::ALDeviceList()
alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(s32), &ALDeviceInfo.iMajorVersion); alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(s32), &ALDeviceInfo.iMajorVersion);
alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(s32), &ALDeviceInfo.iMinorVersion); alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(s32), &ALDeviceInfo.iMinorVersion);
ALDeviceInfo.pvstrExtensions = new vector<string>; ALDeviceInfo.pvstrExtensions = new std::vector<std::string>;
// Check for ALC Extensions // Check for ALC Extensions
if (alcIsExtensionPresent(device, "ALC_EXT_CAPTURE") == AL_TRUE) if (alcIsExtensionPresent(device, "ALC_EXT_CAPTURE") == AL_TRUE)

View File

@ -10,22 +10,20 @@
//'255' characters in the browser information" //'255' characters in the browser information"
#endif #endif
using namespace std;
typedef struct typedef struct
{ {
string strDeviceName; std::string strDeviceName;
s32 iMajorVersion; s32 iMajorVersion;
s32 iMinorVersion; s32 iMinorVersion;
u32 uiSourceCount; u32 uiSourceCount;
vector<string>* pvstrExtensions; std::vector<std::string>* pvstrExtensions;
bool bSelected; bool bSelected;
} ALDEVICEINFO, *LPALDEVICEINFO; } ALDEVICEINFO, *LPALDEVICEINFO;
class ALDeviceList class ALDeviceList
{ {
private: private:
vector<ALDEVICEINFO> vDeviceInfo; std::vector<ALDEVICEINFO> vDeviceInfo;
s32 defaultDeviceIndex; s32 defaultDeviceIndex;
s32 filterIndex; s32 filterIndex;

View File

@ -19,7 +19,6 @@
#include "Common/ExtendedTrace.h" #include "Common/ExtendedTrace.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
using namespace std;
#include <tchar.h> #include <tchar.h>
#include <ImageHlp.h> #include <ImageHlp.h>

View File

@ -11,7 +11,6 @@
#include "Core/FifoPlayer/FifoFileStruct.h" #include "Core/FifoPlayer/FifoFileStruct.h"
using namespace FifoFileStruct; using namespace FifoFileStruct;
using namespace std;
FifoDataFile::FifoDataFile() : FifoDataFile::FifoDataFile() :
m_Flags(0) m_Flags(0)

View File

@ -12,7 +12,6 @@
#include "VideoCommon/TextureDecoder.h" #include "VideoCommon/TextureDecoder.h"
#include "VideoCommon/VertexLoader.h" #include "VideoCommon/VertexLoader.h"
using namespace std;
using namespace FifoAnalyzer; using namespace FifoAnalyzer;
// For debugging // For debugging
@ -291,10 +290,10 @@ void FifoPlaybackAnalyzer::StoreEfbCopyRegion()
void FifoPlaybackAnalyzer::StoreWrittenRegion(u32 address, u32 size) void FifoPlaybackAnalyzer::StoreWrittenRegion(u32 address, u32 size)
{ {
u32 end = address + size; u32 end = address + size;
vector<MemoryRange>::iterator newRangeIter = m_WrittenMemory.end(); auto newRangeIter = m_WrittenMemory.end();
// Search for overlapping memory regions and expand them to include the new region // Search for overlapping memory regions and expand them to include the new region
for (vector<MemoryRange>::iterator iter = m_WrittenMemory.begin(); iter != m_WrittenMemory.end();) for (auto iter = m_WrittenMemory.begin(); iter != m_WrittenMemory.end();)
{ {
MemoryRange &range = *iter; MemoryRange &range = *iter;

View File

@ -13,8 +13,6 @@
static FifoRecorder instance; static FifoRecorder instance;
static std::recursive_mutex sMutex; static std::recursive_mutex sMutex;
using namespace std;
FifoRecorder::FifoRecorder() : FifoRecorder::FifoRecorder() :
m_IsRecording(false), m_IsRecording(false),
m_WasRecording(false), m_WasRecording(false),

View File

@ -264,19 +264,19 @@ using namespace Gen;
} }
} }
using namespace std;
void JitBaseBlockCache::LinkBlock(int i) void JitBaseBlockCache::LinkBlock(int i)
{ {
LinkBlockExits(i); LinkBlockExits(i);
JitBlock &b = blocks[i]; JitBlock &b = blocks[i];
pair<multimap<u32, int>::iterator, multimap<u32, int>::iterator> ppp;
// equal_range(b) returns pair<iterator,iterator> representing the range // equal_range(b) returns pair<iterator,iterator> representing the range
// of element with key b // of element with key b
ppp = links_to.equal_range(b.originalAddress); auto ppp = links_to.equal_range(b.originalAddress);
if (ppp.first == ppp.second) if (ppp.first == ppp.second)
return; return;
for (multimap<u32, int>::iterator iter = ppp.first; iter != ppp.second; ++iter) {
for (auto iter = ppp.first; iter != ppp.second; ++iter)
{
// PanicAlert("Linking block %i to block %i", iter->second, i); // PanicAlert("Linking block %i to block %i", iter->second, i);
LinkBlockExits(iter->second); LinkBlockExits(iter->second);
} }
@ -285,11 +285,13 @@ using namespace Gen;
void JitBaseBlockCache::UnlinkBlock(int i) void JitBaseBlockCache::UnlinkBlock(int i)
{ {
JitBlock &b = blocks[i]; JitBlock &b = blocks[i];
pair<multimap<u32, int>::iterator, multimap<u32, int>::iterator> ppp; auto ppp = links_to.equal_range(b.originalAddress);
ppp = links_to.equal_range(b.originalAddress);
if (ppp.first == ppp.second) if (ppp.first == ppp.second)
return; return;
for (multimap<u32, int>::iterator iter = ppp.first; iter != ppp.second; ++iter) {
for (auto iter = ppp.first; iter != ppp.second; ++iter)
{
JitBlock &sourceBlock = blocks[iter->second]; JitBlock &sourceBlock = blocks[iter->second];
for (auto& e : sourceBlock.linkData) for (auto& e : sourceBlock.linkData)
{ {
@ -344,7 +346,7 @@ using namespace Gen;
// !! this works correctly under assumption that any two overlapping blocks end at the same address // !! this works correctly under assumption that any two overlapping blocks end at the same address
if (destroy_block) if (destroy_block)
{ {
std::map<pair<u32,u32>, u32>::iterator it1 = block_map.lower_bound(std::make_pair(pAddr, 0)), it2 = it1; std::map<std::pair<u32,u32>, u32>::iterator it1 = block_map.lower_bound(std::make_pair(pAddr, 0)), it2 = it1;
while (it2 != block_map.end() && it2->first.second < pAddr + length) while (it2 != block_map.end() && it2->first.second < pAddr + length)
{ {
JitBlock &b = blocks[it2->second]; JitBlock &b = blocks[it2->second];

View File

@ -28,10 +28,8 @@
// It is also useful for finding function boundaries so that we can find, fingerprint and detect library functions. // It is also useful for finding function boundaries so that we can find, fingerprint and detect library functions.
// We don't do this much currently. Only for the special case Super Monkey Ball. // We don't do this much currently. Only for the special case Super Monkey Ball.
namespace PPCAnalyst { namespace PPCAnalyst
{
using namespace std;
static const int CODEBUFFER_SIZE = 32000; static const int CODEBUFFER_SIZE = 32000;
// 0 does not perform block merging // 0 does not perform block merging
static const u32 FUNCTION_FOLLOWING_THRESHOLD = 16; static const u32 FUNCTION_FOLLOWING_THRESHOLD = 16;
@ -306,7 +304,7 @@ static void FindFunctionsFromBranches(u32 startAddr, u32 endAddr, SymbolDB *func
static void FindFunctionsAfterBLR(PPCSymbolDB *func_db) static void FindFunctionsAfterBLR(PPCSymbolDB *func_db)
{ {
vector<u32> funcAddrs; std::vector<u32> funcAddrs;
for (const auto& func : func_db->Symbols()) for (const auto& func : func_db->Symbols())
funcAddrs.push_back(func.second.address + func.second.size); funcAddrs.push_back(func.second.address + func.second.size);

View File

@ -51,8 +51,6 @@ DEFINE_EVENT_TYPE(RECORDING_FINISHED_EVENT)
DECLARE_EVENT_TYPE(FRAME_WRITTEN_EVENT, -1) DECLARE_EVENT_TYPE(FRAME_WRITTEN_EVENT, -1)
DEFINE_EVENT_TYPE(FRAME_WRITTEN_EVENT) DEFINE_EVENT_TYPE(FRAME_WRITTEN_EVENT)
using namespace std;
static std::recursive_mutex sMutex; static std::recursive_mutex sMutex;
wxEvtHandler *volatile FifoPlayerDlg::m_EvtHandler = nullptr; wxEvtHandler *volatile FifoPlayerDlg::m_EvtHandler = nullptr;
@ -955,7 +953,7 @@ wxString FifoPlayerDlg::CreateRecordingMemSizeLabel() const
size_t memBytes = 0; size_t memBytes = 0;
for (size_t frameNum = 0; frameNum < file->GetFrameCount(); ++frameNum) for (size_t frameNum = 0; frameNum < file->GetFrameCount(); ++frameNum)
{ {
const vector<MemoryUpdate>& memUpdates = file->GetFrame(frameNum).memoryUpdates; const std::vector<MemoryUpdate>& memUpdates = file->GetFrame(frameNum).memoryUpdates;
for (auto& memUpdate : memUpdates) for (auto& memUpdate : memUpdates)
memBytes += memUpdate.size; memBytes += memUpdate.size;
} }