Remove using namespace std from the header files ..

This commit is contained in:
Ian Curtis 2018-01-21 15:09:11 +00:00
parent 8266eecabb
commit 571d1060ee
21 changed files with 2986 additions and 2982 deletions

View file

@ -31,7 +31,6 @@
#include <vector>
#include <algorithm>
using namespace std;
#define TABLE_WIDTH 16
#define TABLE_SIZE (1 << TABLE_WIDTH)

View file

@ -32,6 +32,8 @@
#include <cctype>
#include <string>
using namespace std;
namespace Debugger
{
CCPUDebug::CCPUDebug(const char *cpuType, const char *cpuName,

View file

@ -30,10 +30,8 @@
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
#include "Types.h"
#include "CodeAnalyser.h"
#include "AddressTable.h"
#include "Breakpoint.h"
@ -220,18 +218,18 @@ namespace Debugger
UINT32 pc;
UINT32 opcode;
vector<CRegister*> regs;
vector<CException*> exceps;
vector<CInterrupt*> inters;
vector<CIO*> ios;
std::vector<CRegister*> regs;
std::vector<CException*> exceps;
std::vector<CInterrupt*> inters;
std::vector<CIO*> ios;
// TODO - should use map<UINT32,T*> for T=CRegion,CLabel&CComment so that look-ups via address are faster
vector<CRegion*> regions;
vector<CLabel*> labels;
vector<CComment*> comments;
vector<CWatch*> memWatches;
vector<CWatch*> ioWatches;
vector<CBreakpoint*> bps;
vector<CRegMonitor*> regMons;
std::vector<CRegion*> regions;
std::vector<CLabel*> labels;
std::vector<CComment*> comments;
std::vector<CWatch*> memWatches;
std::vector<CWatch*> ioWatches;
std::vector<CBreakpoint*> bps;
std::vector<CRegMonitor*> regMons;
virtual ~CCPUDebug();
@ -489,7 +487,7 @@ namespace Debugger
CCountWatch *AddCountMemWatch(UINT32 addr, UINT32 size, bool trigRead, bool trigWrite, unsigned count);
CMatchWatch *AddMatchMemWatch(UINT32 addr, UINT32 size, bool trigRead, bool trigWrite, vector<UINT64> &dataSeq);
CMatchWatch *AddMatchMemWatch(UINT32 addr, UINT32 size, bool trigRead, bool trigWrite, std::vector<UINT64> &dataSeq);
CPrintWatch *AddPrintMemWatch(UINT32 addr, UINT32 size, bool trigRead, bool trigWrite);

View file

@ -32,6 +32,8 @@
#include <cctype>
#include <string>
using namespace std;
namespace Debugger
{
CEntryPoint::CEntryPoint(const CEntryPoint &other) : addr(other.addr), autoFlag(other.autoFlag)

View file

@ -32,10 +32,8 @@
#include <map>
#include <set>
#include <algorithm>
using namespace std;
#include "Types.h"
#include "Debugger.h"
#include "AddressTable.h"
@ -136,26 +134,26 @@ namespace Debugger
friend class CCodeAnalyser;
private:
vector<CEntryPoint> m_entryPoints;
vector<UINT32> m_unseenEntryAddrs;
vector<bool> m_seenIndices;
vector<bool> m_validIndices;
map<UINT32,CAutoLabel*> m_autoLabelsMap;
std::vector<CEntryPoint> m_entryPoints;
std::vector<UINT32> m_unseenEntryAddrs;
std::vector<bool> m_seenIndices;
std::vector<bool> m_validIndices;
std::map<UINT32,CAutoLabel*> m_autoLabelsMap;
unsigned m_acquired;
CCodeAnalysis(CCodeAnalyser *aAnalyser);
CCodeAnalysis(CCodeAnalyser *aAnalyser, unsigned aTotalIndices, vector<CEntryPoint> &entryPoints, vector<UINT32> &m_unseenEntryAddrs);
CCodeAnalysis(CCodeAnalyser *aAnalyser, unsigned aTotalIndices, std::vector<CEntryPoint> &entryPoints, std::vector<UINT32> &m_unseenEntryAddrs);
CCodeAnalysis(CCodeAnalysis *oldAnalysis, vector<CEntryPoint> &entryPoints, vector<UINT32> &m_unseenEntryAddrs);
CCodeAnalysis(CCodeAnalysis *oldAnalysis, std::vector<CEntryPoint> &entryPoints, std::vector<UINT32> &m_unseenEntryAddrs);
void FinishAnalysis();
public:
CCodeAnalyser *analyser;
set<unsigned> validIndexSet;
vector<CAutoLabel*> autoLabels;
std::set<unsigned> validIndexSet;
std::vector<CAutoLabel*> autoLabels;
~CCodeAnalysis();
@ -179,7 +177,7 @@ namespace Debugger
CAutoLabel *GetAutoLabel(const char *subLabel);
vector<CAutoLabel*> GetAutoLabels(ELabelFlags flag);
std::vector<CAutoLabel*> GetAutoLabels(ELabelFlags flag);
};
/*
@ -194,23 +192,23 @@ namespace Debugger
class CCodeAnalyser
{
private:
vector<CRegion*> m_codeRegions;
vector<unsigned> m_indexBounds;
std::vector<CRegion*> m_codeRegions;
std::vector<unsigned> m_indexBounds;
vector<UINT32> m_customEntryAddrs;
std::vector<UINT32> m_customEntryAddrs;
bool m_abortAnalysis;
void CheckEntryPoints(vector<CEntryPoint> &entryPoints, vector<UINT32> &unseenEntryAddrs, vector<CEntryPoint> &prevPoints,
void CheckEntryPoints(std::vector<CEntryPoint> &entryPoints, std::vector<UINT32> &unseenEntryAddrs, std::vector<CEntryPoint> &prevPoints,
bool &needsAnalysis, bool &reanalyse);
void GatherEntryPoints(vector<CEntryPoint> &entryPoints, vector<UINT32> &unseenEntryAddrs, bool &reanalyse);
void GatherEntryPoints(std::vector<CEntryPoint> &entryPoints, std::vector<UINT32> &unseenEntryAddrs, bool &reanalyse);
void AddEntryPoint(vector<CEntryPoint> &entryPoints, UINT32 addr, ELabelFlags autoFlag, const char *autoLabel);
void AddEntryPoint(std::vector<CEntryPoint> &entryPoints, UINT32 addr, ELabelFlags autoFlag, const char *autoLabel);
void AnalyseCode(vector<bool> &seenIndices, vector<bool> &validIndices, set<unsigned> &validIndexSet, map<UINT32,CAutoLabel*> &autoLabelsMap, UINT32 addr);
void AnalyseCode(std::vector<bool> &seenIndices, std::vector<bool> &validIndices, std::set<unsigned> &validIndexSet, std::map<UINT32, CAutoLabel*> &autoLabelsMap, UINT32 addr);
void AddFlagToAddr(map<UINT32,CAutoLabel*> &autoLabelsMap, UINT32 addr, ELabelFlags autoFlag, const char *autoLabel);
void AddFlagToAddr(std::map<UINT32, CAutoLabel*> &autoLabelsMap, UINT32 addr, ELabelFlags autoFlag, const char *autoLabel);
public:
CCPUDebug *cpu;

View file

@ -33,6 +33,8 @@
#include <cctype>
#include <string>
using namespace std;
namespace Debugger
{
CConsoleDebugger::CConsoleDebugger() : CDebugger(),
@ -1605,7 +1607,7 @@ namespace Debugger
Print("General:\n");
Print(fmt, "p", "print[.<size>=v]", "<expr> [(h)ex|hexdo(l)lar|hex(p)osth|(d)ecimal|(b)inary]");
Print(fmt, "cfg", "configure", "<options...>");
Print(fmt, "ls", "loststate", "<filename>");
Print(fmt, "ls", "loadstate", "<filename>");
Print(fmt, "ss", "savestate", "<filename>");
Print(fmt, "h", "help", "");
Print(fmt, "x", "exit", "");
@ -1680,7 +1682,9 @@ namespace Debugger
else
{
pos++;
if (pos == '\0')
// BEGIN
if (*pos == '\0')
// END
return false;
strncpy(modifier, pos, modSize);
modifier[modSize] = '\0';
@ -2441,7 +2445,7 @@ namespace Debugger
// In the absence of code analyser, try to align code with current PC address
if (m_cpu->instrCount > 0 && pc >= start && pc <= end)
{
unsigned count = m_cpu->instrCount;
UINT64 count = m_cpu->instrCount;
while (start < end && count-- > 0)
{
bool okay = false;

View file

@ -130,13 +130,13 @@ namespace Debugger
void ListLabels(bool customLabels, ELabelFlags autoLabelFlags);
void GetAllMemWatches(vector<CWatch*> &watches);
void GetAllMemWatches(std::vector<CWatch*> &watches);
int GetIndexOfMemWatch(CWatch *watch);
void ListMemWatches();
void GetAllPortWatches(vector<CWatch*> &watches);
void GetAllPortWatches(std::vector<CWatch*> &watches);
int GetIndexOfPortWatch(CWatch *watch);

View file

@ -31,6 +31,8 @@
#include <cctype>
#include <string>
using namespace std;
namespace Debugger
{
unsigned CDebugger::GetDataSize(UINT64 data)

View file

@ -31,7 +31,6 @@
#include <stdarg.h>
#include <vector>
#include <algorithm>
using namespace std;
#include "Types.h"
@ -160,7 +159,7 @@ namespace Debugger
virtual void Log(CCPUDebug *cpu, const char *typeStr, const char *fmtStr, va_list vl) = 0;
public:
vector<CCPUDebug*> cpus;
std::vector<CCPUDebug*> cpus;
UINT64 frameCount;

View file

@ -70,7 +70,7 @@ namespace Debugger
return cWatch;
}
CMatchWatch *CIO::AddMatchWatch(bool trigInput, bool trigOutput, vector<UINT64> &dataSeq)
CMatchWatch *CIO::AddMatchWatch(bool trigInput, bool trigOutput, std::vector<UINT64> &dataSeq)
{
CMatchWatch *mWatch = new CMatchWatch(cpu, this, trigInput, trigOutput, dataSeq);
cpu->AddWatch(mWatch);

View file

@ -78,7 +78,7 @@ namespace Debugger
CCountWatch *AddCountWatch(bool trigInput, bool trigOutput, unsigned count);
CMatchWatch *AddMatchWatch(bool trigInput, bool trigOutput, vector<UINT64> &dataSeq);
CMatchWatch *AddMatchWatch(bool trigInput, bool trigOutput, std::vector<UINT64> &dataSeq);
CPrintWatch *AddPrintWatch(bool trigInput, bool trigOutput);

View file

@ -297,7 +297,7 @@ namespace Debugger
{
if (index >= dataWidth)
exit(1);
numBits = max<unsigned>(numBits, index);
numBits = std::max<unsigned>(numBits, index);
return m_bitChrs[index];
}

View file

@ -599,11 +599,11 @@ namespace Debugger
if (!InputIsValid(input))
continue;
idAndLabelWidth = max<size_t>(idAndLabelWidth, strlen(input->id) + strlen(input->label) + 3);
idAndLabelWidth = std::max<size_t>(idAndLabelWidth, strlen(input->id) + strlen(input->label) + 3);
if (!input->IsVirtual())
mappingWidth = max<size_t>(mappingWidth, strlen(input->GetMapping()));
mappingWidth = std::max<size_t>(mappingWidth, strlen(input->GetMapping()));
}
mappingWidth = min<size_t>(mappingWidth, 20);
mappingWidth = std::min<size_t>(mappingWidth, 20);
// Print labels, mappings and values for each input
const char *groupLabel = NULL;

View file

@ -29,9 +29,10 @@
#include "Debugger.h"
#include "IO.h"
#include "Watch.h"
#include <string>
using namespace std;
namespace Debugger
{
UINT32 CWatch::GetIOAddress(CIO *io)

View file

@ -31,7 +31,6 @@
#include "Types.h"
#include <vector>
using namespace std;
namespace Debugger
{
@ -128,9 +127,9 @@ namespace Debugger
unsigned m_counter;
public:
CMatchWatch(CCPUDebug *wCPU, UINT32 wAddr, unsigned wSize, bool wTrigRead, bool wTrigWrite, vector<UINT64> &dataSeq);
CMatchWatch(CCPUDebug *wCPU, UINT32 wAddr, unsigned wSize, bool wTrigRead, bool wTrigWrite, std::vector<UINT64> &dataSeq);
CMatchWatch(CCPUDebug *wCPU, CIO *wIO, bool wTrigInput, bool wTrigOutput, vector<UINT64> &dataSeq);
CMatchWatch(CCPUDebug *wCPU, CIO *wIO, bool wTrigInput, bool wTrigOutput, std::vector<UINT64> &dataSeq);
~CMatchWatch();