From 40cfd6a475592852fc47de84427dc6c3987ac253 Mon Sep 17 00:00:00 2001 From: stephena Date: Tue, 24 May 2016 16:55:45 +0000 Subject: [PATCH] Cleaned up usage of 'using namespace ...'. I'm currently teaching that using that approach is a bad idea (and using Stella as example code), so it doesn't make sense to not do something as it's being taught; the correct way. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3308 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/cheat/CheatManager.hxx | 2 +- src/common/FSNodeZIP.cxx | 2 +- src/common/PNGLibrary.cxx | 6 ++--- src/common/Variant.hxx | 2 +- src/common/ZipHandler.cxx | 6 ++--- src/common/bspf.hxx | 34 +++++++++++++++++++++----- src/common/main.cxx | 2 +- src/debugger/CartDebug.cxx | 20 +++++++++------ src/debugger/CartDebug.hxx | 10 ++++---- src/debugger/Debugger.cxx | 16 ++++++------ src/debugger/Debugger.hxx | 4 +-- src/debugger/DebuggerParser.cxx | 7 +++++- src/debugger/DiStella.cxx | 24 +++++++++--------- src/debugger/DiStella.hxx | 2 +- src/debugger/PackedBitArray.hxx | 2 +- src/debugger/TIADebug.cxx | 18 +++++++------- src/debugger/gui/Cart0840Widget.cxx | 2 +- src/debugger/gui/Cart3EWidget.cxx | 2 +- src/debugger/gui/Cart3FWidget.cxx | 2 +- src/debugger/gui/Cart4A50Widget.cxx | 2 +- src/debugger/gui/CartARWidget.cxx | 2 +- src/debugger/gui/CartBFSCWidget.cxx | 4 +-- src/debugger/gui/CartBFWidget.cxx | 4 +-- src/debugger/gui/CartCMWidget.cxx | 2 +- src/debugger/gui/CartCTYWidget.cxx | 2 +- src/debugger/gui/CartCVPlusWidget.cxx | 2 +- src/debugger/gui/CartDFSCWidget.cxx | 4 +-- src/debugger/gui/CartDFWidget.cxx | 4 +-- src/debugger/gui/CartDPCPlusWidget.cxx | 2 +- src/debugger/gui/CartDPCWidget.cxx | 2 +- src/debugger/gui/CartE0Widget.cxx | 2 +- src/debugger/gui/CartE7Widget.cxx | 2 +- src/debugger/gui/CartEFSCWidget.cxx | 4 +-- src/debugger/gui/CartEFWidget.cxx | 4 +-- src/debugger/gui/CartF0Widget.cxx | 6 ++--- src/debugger/gui/CartF4SCWidget.cxx | 2 +- src/debugger/gui/CartF4Widget.cxx | 2 +- src/debugger/gui/CartF6SCWidget.cxx | 2 +- src/debugger/gui/CartF6Widget.cxx | 2 +- src/debugger/gui/CartF8SCWidget.cxx | 2 +- src/debugger/gui/CartF8Widget.cxx | 2 +- src/debugger/gui/CartFA2Widget.cxx | 2 +- src/debugger/gui/CartFAWidget.cxx | 2 +- src/debugger/gui/CartFEWidget.cxx | 2 +- src/debugger/gui/CartMCWidget.cxx | 2 +- src/debugger/gui/CartMDMWidget.cxx | 4 +-- src/debugger/gui/CartSBWidget.cxx | 10 ++++---- src/debugger/gui/CartUAWidget.cxx | 2 +- src/debugger/gui/CartWDWidget.cxx | 2 +- src/debugger/gui/CartX07Widget.cxx | 4 +-- src/debugger/gui/TiaOutputWidget.cxx | 2 +- src/emucore/Console.cxx | 8 +++--- src/emucore/EventHandler.cxx | 3 ++- src/emucore/EventHandler.hxx | 4 +-- src/emucore/MT24LC256.cxx | 8 +++--- src/emucore/OSystem.cxx | 4 +-- src/emucore/PropsSet.hxx | 2 +- src/emucore/Serializer.cxx | 3 +++ src/emucore/Settings.cxx | 2 +- src/emucore/TIA.cxx | 14 +++++------ src/emucore/TIASnd.cxx | 2 +- src/emucore/TIASnd.hxx | 2 +- src/emucore/Thumbulator.cxx | 2 +- 63 files changed, 173 insertions(+), 136 deletions(-) diff --git a/src/cheat/CheatManager.hxx b/src/cheat/CheatManager.hxx index 7e5437fb6..7c51c800a 100644 --- a/src/cheat/CheatManager.hxx +++ b/src/cheat/CheatManager.hxx @@ -150,7 +150,7 @@ class CheatManager CheatList myCheatList; CheatList myPerFrameList; - map myCheatMap; + std::map myCheatMap; string myCheatFile; // This is set each time a new cheat/ROM is loaded, for later diff --git a/src/common/FSNodeZIP.cxx b/src/common/FSNodeZIP.cxx index b3da7dd8f..1fa2075ad 100644 --- a/src/common/FSNodeZIP.cxx +++ b/src/common/FSNodeZIP.cxx @@ -148,7 +148,7 @@ bool FilesystemNodeZIP::getChildren(AbstractFSList& myList, ListMode mode, if(!isDirectory() || _error != ZIPERR_NONE) return false; - set dirs; + std::set dirs; ZipHandler& zip = open(_zipFile); while(zip.hasNext()) { diff --git a/src/common/PNGLibrary.cxx b/src/common/PNGLibrary.cxx index b1675285d..47679aa62 100644 --- a/src/common/PNGLibrary.cxx +++ b/src/common/PNGLibrary.cxx @@ -45,7 +45,7 @@ void PNGLibrary::loadImage(const string& filename, FBSurface& surface) int bit_depth, color_type, interlace_type; const char* err_message = nullptr; - ifstream in(filename, ios_base::binary); + ifstream in(filename, std::ios_base::binary); if(!in.is_open()) loadImageERROR("No image found"); @@ -122,7 +122,7 @@ done: // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void PNGLibrary::saveImage(const string& filename, const VariantList& comments) { - ofstream out(filename, ios_base::binary); + ofstream out(filename, std::ios_base::binary); if(!out.is_open()) throw runtime_error("ERROR: Couldn't create snapshot file"); @@ -146,7 +146,7 @@ void PNGLibrary::saveImage(const string& filename, const VariantList& comments) void PNGLibrary::saveImage(const string& filename, const FBSurface& surface, const GUI::Rect& rect, const VariantList& comments) { - ofstream out(filename, ios_base::binary); + ofstream out(filename, std::ios_base::binary); if(!out.is_open()) throw runtime_error("ERROR: Couldn't create snapshot file"); diff --git a/src/common/Variant.hxx b/src/common/Variant.hxx index 3f954d275..10dfc2a84 100644 --- a/src/common/Variant.hxx +++ b/src/common/Variant.hxx @@ -77,7 +77,7 @@ class Variant static const Variant EmptyVariant; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -using VariantList = vector>; +using VariantList = vector>; namespace VarList { inline void push_back(VariantList& list, const Variant& name, diff --git a/src/common/ZipHandler.cxx b/src/common/ZipHandler.cxx index 3eda6e8dc..95078cc7b 100644 --- a/src/common/ZipHandler.cxx +++ b/src/common/ZipHandler.cxx @@ -133,11 +133,11 @@ bool ZipHandler::stream_open(const char* filename, fstream** stream, } else { - in->exceptions( ios_base::failbit | ios_base::badbit | ios_base::eofbit ); + in->exceptions( std::ios_base::failbit | std::ios_base::badbit | std::ios_base::eofbit ); *stream = in; - in->seekg(0, ios::end); + in->seekg(0, std::ios::end); length = in->tellg(); - in->seekg(0, ios::beg); + in->seekg(0, std::ios::beg); return true; } } diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx index 41d55bb5d..3e7d89229 100644 --- a/src/common/bspf.hxx +++ b/src/common/bspf.hxx @@ -53,14 +53,36 @@ using uInt64 = uint64_t; #include #include #include "UniquePtr.hxx" // only until C++14 compilers are more common -using namespace std; + +using std::cin; +using std::cout; +using std::cerr; +using std::endl; +using std::string; +using std::istream; +using std::ostream; +using std::fstream; +using std::iostream; +using std::ifstream; +using std::ofstream; +using std::ostringstream; +using std::istringstream; +using std::stringstream; +using std::unique_ptr; +using std::shared_ptr; +using std::make_ptr; +using std::make_shared; +using std::array; +using std::vector; +using std::make_pair; +using std::runtime_error; // Common array types -using IntArray = vector; -using BoolArray = vector; -using ByteArray = vector; -using StringList = vector; -using BytePtr = unique_ptr; +using IntArray = std::vector; +using BoolArray = std::vector; +using ByteArray = std::vector; +using StringList = std::vector; +using BytePtr = std::unique_ptr; static const string EmptyString(""); diff --git a/src/common/main.cxx b/src/common/main.cxx index fa23b871b..a6ab70a8d 100644 --- a/src/common/main.cxx +++ b/src/common/main.cxx @@ -60,7 +60,7 @@ int stellaMain(int argc, char* argv[]) int main(int argc, char* argv[]) #endif { - ios_base::sync_with_stdio(false); + std::ios_base::sync_with_stdio(false); // Create the parent OSystem object theOSystem = MediaFactory::createOSystem(); diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx index fe53a11dd..f3677a28e 100644 --- a/src/debugger/CartDebug.cxx +++ b/src/debugger/CartDebug.cxx @@ -31,7 +31,13 @@ #include "CartDebug.hxx" #include "CartDebugWidget.hxx" #include "CartRamWidget.hxx" -using namespace Common; +using Common::Base; +using std::hex; +using std::dec; +using std::setfill; +using std::setw; +using std::left; +using std::right; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem) @@ -360,14 +366,14 @@ string CartDebug::disassemble(uInt16 start, uInt16 lines) const if(tag.type == CartDebug::NONE) continue; else if(tag.address) - buffer << uppercase << hex << setw(4) << setfill('0') << tag.address - << ": "; + buffer << std::uppercase << std::hex << std::setw(4) + << std::setfill('0') << tag.address << ": "; else buffer << " "; - buffer << tag.disasm << setw(int(length - tag.disasm.length() + 2)) - << setfill(' ') << " " - << setw(4) << left << tag.ccount << " " << tag.bytes << endl; + buffer << tag.disasm << std::setw(int(length - tag.disasm.length() + 2)) + << std::setfill(' ') << " " + << std::setw(4) << std::left << tag.ccount << " " << tag.bytes << endl; } return buffer.str(); @@ -1157,7 +1163,7 @@ string CartDebug::saveRom() myConsole.properties().get(Cartridge_Name) + ".a26"; FilesystemNode node(path); - ofstream out(node.getPath(), ios::binary); + ofstream out(node.getPath(), std::ios::binary); if(out && myConsole.cartridge().saveROM(out)) return "saved ROM as " + node.getShortPath(); else diff --git a/src/debugger/CartDebug.hxx b/src/debugger/CartDebug.hxx index 8dd6ca308..908011a7f 100644 --- a/src/debugger/CartDebug.hxx +++ b/src/debugger/CartDebug.hxx @@ -263,8 +263,8 @@ class CartDebug : public DebuggerSystem void addressTypeAsString(ostream& buf, uInt16 addr) const; private: - using AddrToLabel = map; - using LabelToAddr = map; + using AddrToLabel = std::map; + using LabelToAddr = std::map; // Determine 'type' of address (ie, what part of the system accessed) enum AddrType { @@ -280,8 +280,8 @@ class CartDebug : public DebuggerSystem uInt16 start; uInt16 end; }; - using AddressList = list; - using DirectiveList = list; + using AddressList = std::list; + using DirectiveList = std::list; struct BankInfo { uInt16 start; // start of address space @@ -352,7 +352,7 @@ class CartDebug : public DebuggerSystem // Used for the disassembly display, and mapping from addresses // to corresponding lines of text in that display Disassembly myDisassembly; - map myAddrToLineList; + std::map myAddrToLineList; bool myAddrToLineIsROM; // Mappings from label to address (and vice versa) for items diff --git a/src/debugger/Debugger.cxx b/src/debugger/Debugger.cxx index feb1871f9..774c3c2f6 100644 --- a/src/debugger/Debugger.cxx +++ b/src/debugger/Debugger.cxx @@ -576,13 +576,13 @@ string Debugger::builtinHelp() const if(len > i_maxlen) i_maxlen = len; } - buf << setfill(' ') << endl << "Built-in functions:" << endl; + buf << std::setfill(' ') << endl << "Built-in functions:" << endl; for(int i = 0; builtin_functions[i][0] != 0; ++i) { - buf << setw(c_maxlen) << left << builtin_functions[i][0] - << setw(2) << right << "{" - << setw(i_maxlen) << left << builtin_functions[i][1] - << setw(4) << "}" + buf << std::setw(c_maxlen) << std::left << builtin_functions[i][0] + << std::setw(2) << std::right << "{" + << std::setw(i_maxlen) << std::left << builtin_functions[i][1] + << std::setw(4) << "}" << builtin_functions[i][2] << endl; } @@ -598,9 +598,9 @@ string Debugger::builtinHelp() const buf << endl << "Pseudo-registers:" << endl; for(int i = 0; pseudo_registers[i][0] != 0; ++i) { - buf << setw(c_maxlen) << left << pseudo_registers[i][0] - << setw(2) << " " - << setw(i_maxlen) << left << pseudo_registers[i][1] + buf << std::setw(c_maxlen) << std::left << pseudo_registers[i][0] + << std::setw(2) << " " + << std::setw(i_maxlen) << std::left << pseudo_registers[i][1] << endl; } diff --git a/src/debugger/Debugger.hxx b/src/debugger/Debugger.hxx index 114d4588b..0cb8517df 100644 --- a/src/debugger/Debugger.hxx +++ b/src/debugger/Debugger.hxx @@ -48,8 +48,8 @@ class ButtonWidget; #include "TIADebug.hxx" #include "bspf.hxx" -using FunctionMap = map>; -using FunctionDefMap = map; +using FunctionMap = std::map>; +using FunctionDefMap = std::map; /** diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index 22afcf4c6..e81fcfce8 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -39,7 +39,12 @@ #include "Vec.hxx" #include "Base.hxx" -using namespace Common; +using Common::Base; +using std::hex; +using std::dec; +using std::setfill; +using std::setw; +using std::right; #ifdef CHEATCODE_SUPPORT #include "Cheat.hxx" diff --git a/src/debugger/DiStella.cxx b/src/debugger/DiStella.cxx index 671409994..d42e1637a 100644 --- a/src/debugger/DiStella.cxx +++ b/src/debugger/DiStella.cxx @@ -20,7 +20,7 @@ #include "bspf.hxx" #include "Debugger.hxx" #include "DiStella.hxx" -using namespace Common; +using Common::Base; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list, @@ -812,7 +812,7 @@ void DiStella::disasm(uInt32 distart, int pass) { // A complete line of disassembly (text, cycle count, and bytes) myDisasmBuf << nextline.str() << "'" - << ";" << dec << int(ourLookup[op].cycles) << "'" + << ";" << std::dec << int(ourLookup[op].cycles) << "'" << nextlinebytes.str(); addEntry(CartDebug::CODE); if (op == 0x40 || op == 0x60) @@ -941,20 +941,20 @@ bool DiStella::check_range(uInt16 beg, uInt16 end) const { if(beg > end) { - cerr << "Beginning of range greater than end: start = " << hex << beg - << ", end = " << hex << end << endl; + cerr << "Beginning of range greater than end: start = " << std::hex << beg + << ", end = " << std::hex << end << endl; return false; } else if(beg > myAppData.end + myOffset) { - cerr << "Beginning of range out of range: start = " << hex << beg - << ", range = " << hex << (myAppData.end + myOffset) << endl; + cerr << "Beginning of range out of range: start = " << std::hex << beg + << ", range = " << std::hex << (myAppData.end + myOffset) << endl; return false; } else if(beg < myOffset) { - cerr << "Beginning of range out of range: start = " << hex << beg - << ", offset = " << hex << myOffset << endl; + cerr << "Beginning of range out of range: start = " << std::hex << beg + << ", offset = " << std::hex << myOffset << endl; return false; } return true; @@ -969,18 +969,18 @@ void DiStella::addEntry(CartDebug::DisasmType type) tag.type = type; // Address - myDisasmBuf.seekg(0, ios::beg); + myDisasmBuf.seekg(0, std::ios::beg); if(myDisasmBuf.peek() == ' ') tag.address = 0; else - myDisasmBuf >> setw(4) >> hex >> tag.address; + myDisasmBuf >> std::setw(4) >> std::hex >> tag.address; // Only include addresses within the requested range if(tag.address < myAppData.start) goto DONE_WITH_ADD; // Label (a user-defined label always overrides any auto-generated one) - myDisasmBuf.seekg(5, ios::beg); + myDisasmBuf.seekg(5, std::ios::beg); if(tag.address) { tag.label = myDbg.getLabel(tag.address, true); @@ -1001,7 +1001,7 @@ void DiStella::addEntry(CartDebug::DisasmType type) // Disassembly // Up to this point the field sizes are fixed, until we get to // variable length labels, cycle counts, etc - myDisasmBuf.seekg(11, ios::beg); + myDisasmBuf.seekg(11, std::ios::beg); switch(tag.type) { case CartDebug::CODE: diff --git a/src/debugger/DiStella.hxx b/src/debugger/DiStella.hxx index 44c7c0e6b..8104b3716 100644 --- a/src/debugger/DiStella.hxx +++ b/src/debugger/DiStella.hxx @@ -115,7 +115,7 @@ class DiStella const Settings& mySettings; CartDebug::ReservedEquates& myReserved; stringstream myDisasmBuf; - queue myAddressQueue; + std::queue myAddressQueue; uInt16 myOffset, myPC, myPCEnd; struct resource { diff --git a/src/debugger/PackedBitArray.hxx b/src/debugger/PackedBitArray.hxx index 16fdc493a..dc6e71f2c 100644 --- a/src/debugger/PackedBitArray.hxx +++ b/src/debugger/PackedBitArray.hxx @@ -43,7 +43,7 @@ class PackedBitArray private: // The actual bits - bitset<0x10000> myBits; + std::bitset<0x10000> myBits; // Indicates whether we should treat this bitset as initialized bool myInitialized; diff --git a/src/debugger/TIADebug.cxx b/src/debugger/TIADebug.cxx index 189862a06..f46f4f457 100644 --- a/src/debugger/TIADebug.cxx +++ b/src/debugger/TIADebug.cxx @@ -752,7 +752,7 @@ string TIADebug::toString() const TiaState& state = static_cast(getState()); // build up output, then return it. - buf << "scanline " << dec << myTIA.scanlines() << " " + buf << "scanline " << std::dec << myTIA.scanlines() << " " << booleanWithLabel("vsync", vsync()) << " " << booleanWithLabel("vblank", vblank()) << endl @@ -775,35 +775,35 @@ string TIADebug::toString() << colorSwatch(state.coluRegs[3]) << endl << "P0: GR=%" << Common::Base::toString(state.gr[P0], Common::Base::F_2_8) - << " pos=#" << dec << state.pos[P0] + << " pos=#" << std::dec << state.pos[P0] << " HM=$" << Common::Base::HEX2 << state.hm[P0] << " " << nusizP0String() << " " << booleanWithLabel("refl", refP0()) << " " << booleanWithLabel("delay", vdelP0()) << endl << "P1: GR=%" << Common::Base::toString(state.gr[P1], Common::Base::F_2_8) - << " pos=#" << dec << state.pos[P1] + << " pos=#" << std::dec << state.pos[P1] << " HM=$" << Common::Base::HEX2 << state.hm[P1] << " " << nusizP1String() << " " << booleanWithLabel("refl", refP1()) << " " << booleanWithLabel("delay", vdelP1()) << endl << "M0: " << (myTIA.myENAM0 ? " ENABLED" : "disabled") - << " pos=#" << dec << state.pos[M0] + << " pos=#" << std::dec << state.pos[M0] << " HM=$" << Common::Base::HEX2 << state.hm[M0] - << " size=" << dec << state.size[M0] << " " + << " size=" << std::dec << state.size[M0] << " " << booleanWithLabel("reset", resMP0()) << endl << "M1: " << (myTIA.myENAM1 ? " ENABLED" : "disabled") - << " pos=#" << dec << state.pos[M1] + << " pos=#" << std::dec << state.pos[M1] << " HM=$" << Common::Base::HEX2 << state.hm[M1] - << " size=" << dec << state.size[M1] << " " + << " size=" << std::dec << state.size[M1] << " " << booleanWithLabel("reset", resMP0()) << endl << "BL: " << (myTIA.myENABL ? " ENABLED" : "disabled") - << " pos=#" << dec << state.pos[BL] + << " pos=#" << std::dec << state.pos[BL] << " HM=$" << Common::Base::HEX2 << state.hm[BL] - << " size=" << dec << state.size[BL] << " " + << " size=" << std::dec << state.size[BL] << " " << booleanWithLabel("delay", vdelBL()) << endl << "PF0: %" << Common::Base::toString(state.pf[0], Common::Base::F_2_8) << "/$" diff --git a/src/debugger/gui/Cart0840Widget.cxx b/src/debugger/gui/Cart0840Widget.cxx index 7bce63a79..0e3691b03 100644 --- a/src/debugger/gui/Cart0840Widget.cxx +++ b/src/debugger/gui/Cart0840Widget.cxx @@ -85,7 +85,7 @@ string Cartridge0840Widget::bankState() ostringstream& buf = buffer(); static const char* spot[] = { "$800", "$840" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/Cart3EWidget.cxx b/src/debugger/gui/Cart3EWidget.cxx index cee1f9c08..6e9e0191e 100644 --- a/src/debugger/gui/Cart3EWidget.cxx +++ b/src/debugger/gui/Cart3EWidget.cxx @@ -162,7 +162,7 @@ string Cartridge3EWidget::bankState() uInt16& bank = myCart.myCurrentBank; if(bank < 256) - buf << "ROM bank " << dec << bank % myNumRomBanks << ", RAM inactive"; + buf << "ROM bank " << std::dec << bank % myNumRomBanks << ", RAM inactive"; else buf << "ROM inactive, RAM bank " << bank % myNumRomBanks; diff --git a/src/debugger/gui/Cart3FWidget.cxx b/src/debugger/gui/Cart3FWidget.cxx index 4be0e5225..18a906690 100644 --- a/src/debugger/gui/Cart3FWidget.cxx +++ b/src/debugger/gui/Cart3FWidget.cxx @@ -85,7 +85,7 @@ string Cartridge3FWidget::bankState() { ostringstream& buf = buffer(); - buf << "Bank = " << dec << myCart.myCurrentBank << ", hotspot = $3F"; + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = $3F"; return buf.str(); } diff --git a/src/debugger/gui/Cart4A50Widget.cxx b/src/debugger/gui/Cart4A50Widget.cxx index 5305b4786..0f10facd0 100644 --- a/src/debugger/gui/Cart4A50Widget.cxx +++ b/src/debugger/gui/Cart4A50Widget.cxx @@ -269,7 +269,7 @@ string Cartridge4A50Widget::bankState() { ostringstream& buf = buffer(); - buf << "L/M/H = " << dec; + buf << "L/M/H = " << std::dec; if(myCart.myIsRomLow) buf << "ROM bank " << ((myCart.mySliceLow >> 11) & 0x1F) << " / "; else diff --git a/src/debugger/gui/CartARWidget.cxx b/src/debugger/gui/CartARWidget.cxx index 2030c6ba9..85a348374 100644 --- a/src/debugger/gui/CartARWidget.cxx +++ b/src/debugger/gui/CartARWidget.cxx @@ -104,7 +104,7 @@ string CartridgeARWidget::bankState() { ostringstream& buf = buffer(); - buf << "Bank = " << dec << myCart.myCurrentBank; + buf << "Bank = " << std::dec << myCart.myCurrentBank; return buf.str(); } diff --git a/src/debugger/gui/CartBFSCWidget.cxx b/src/debugger/gui/CartBFSCWidget.cxx index d8f344e68..ac009bf94 100644 --- a/src/debugger/gui/CartBFSCWidget.cxx +++ b/src/debugger/gui/CartBFSCWidget.cxx @@ -41,7 +41,7 @@ CartridgeBFSCWidget::CartridgeBFSCWidget( { uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset]; start -= start % 0x1000; - info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100) + info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100) << " - " << "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n"; } @@ -169,7 +169,7 @@ string CartridgeBFSCWidget::bankState() "$FB0", "$FB1", "$FB2", "$FB3", "$FB4", "$FB5", "$FB6", "$FB7", "$FB8", "$FB9", "$FBA", "$FBB", "$FBC", "$FBD", "$FBE", "$FBF" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartBFWidget.cxx b/src/debugger/gui/CartBFWidget.cxx index 8a481b033..04cd0d644 100644 --- a/src/debugger/gui/CartBFWidget.cxx +++ b/src/debugger/gui/CartBFWidget.cxx @@ -39,7 +39,7 @@ CartridgeBFWidget::CartridgeBFWidget( { uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset]; start -= start % 0x1000; - info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start << " - " + info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start << " - " << "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n"; } @@ -156,7 +156,7 @@ string CartridgeBFWidget::bankState() "$FB0", "$FB1", "$FB2", "$FB3", "$FB4", "$FB5", "$FB6", "$FB7", "$FB8", "$FB9", "$FBA", "$FBB", "$FBC", "$FBD", "$FBE", "$FBF" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartCMWidget.cxx b/src/debugger/gui/CartCMWidget.cxx index b74249966..5f4cb86ac 100644 --- a/src/debugger/gui/CartCMWidget.cxx +++ b/src/debugger/gui/CartCMWidget.cxx @@ -221,7 +221,7 @@ string CartridgeCMWidget::bankState() { ostringstream& buf = buffer(); - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", RAM is" << (myCart.mySWCHA & 0x10 ? " Inactive" : myCart.mySWCHA & 0x20 ? " Read-only" : " Write-only"); diff --git a/src/debugger/gui/CartCTYWidget.cxx b/src/debugger/gui/CartCTYWidget.cxx index 05026a63d..58625bd54 100644 --- a/src/debugger/gui/CartCTYWidget.cxx +++ b/src/debugger/gui/CartCTYWidget.cxx @@ -96,7 +96,7 @@ string CartridgeCTYWidget::bankState() "", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" }; uInt16 bank = myCart.getBank(); - buf << "Bank = " << dec << bank << ", hotspot = " << spot[bank]; + buf << "Bank = " << std::dec << bank << ", hotspot = " << spot[bank]; return buf.str(); } diff --git a/src/debugger/gui/CartCVPlusWidget.cxx b/src/debugger/gui/CartCVPlusWidget.cxx index 56a0b3734..1b89f0792 100644 --- a/src/debugger/gui/CartCVPlusWidget.cxx +++ b/src/debugger/gui/CartCVPlusWidget.cxx @@ -81,7 +81,7 @@ string CartridgeCVPlusWidget::bankState() { ostringstream& buf = buffer(); - buf << "Bank = " << dec << myCart.myCurrentBank << ", hotspot = $3D"; + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = $3D"; return buf.str(); } diff --git a/src/debugger/gui/CartDFSCWidget.cxx b/src/debugger/gui/CartDFSCWidget.cxx index 8e9301bce..5e8e94b1d 100644 --- a/src/debugger/gui/CartDFSCWidget.cxx +++ b/src/debugger/gui/CartDFSCWidget.cxx @@ -41,7 +41,7 @@ CartridgeDFSCWidget::CartridgeDFSCWidget( { uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset]; start -= start % 0x1000; - info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100) + info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100) << " - " << "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n"; } @@ -133,7 +133,7 @@ string CartridgeDFSCWidget::bankState() "$FD0", "$FD1", "$FD2", "$FD3", "$FD4", "$FD5", "$FD6", "$FE7", "$FD8", "$FD9", "$FDA", "$FDB", "$FDC", "$FDD", "$FDE", "$FDF" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartDFWidget.cxx b/src/debugger/gui/CartDFWidget.cxx index 27a97046c..60b631154 100644 --- a/src/debugger/gui/CartDFWidget.cxx +++ b/src/debugger/gui/CartDFWidget.cxx @@ -39,7 +39,7 @@ CartridgeDFWidget::CartridgeDFWidget( { uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset]; start -= start % 0x1000; - info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start << " - " + info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start << " - " << "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n"; } @@ -120,7 +120,7 @@ string CartridgeDFWidget::bankState() "$FD0", "$FD1", "$FD2", "$FD3", "$FD4", "$FD5", "$FD6", "$FD7", "$FD8", "$FD9", "$FDA", "$FDB", "$FDC", "$FDD", "$FDE", "$FDF" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartDPCPlusWidget.cxx b/src/debugger/gui/CartDPCPlusWidget.cxx index 77ecf92a5..0a7f5dbfe 100644 --- a/src/debugger/gui/CartDPCPlusWidget.cxx +++ b/src/debugger/gui/CartDPCPlusWidget.cxx @@ -329,7 +329,7 @@ string CartridgeDPCPlusWidget::bankState() static const char* spot[] = { "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartDPCWidget.cxx b/src/debugger/gui/CartDPCWidget.cxx index 564143e0f..0447b4889 100644 --- a/src/debugger/gui/CartDPCWidget.cxx +++ b/src/debugger/gui/CartDPCWidget.cxx @@ -230,7 +230,7 @@ string CartridgeDPCWidget::bankState() ostringstream& buf = buffer(); static const char* spot[] = { "$FF8", "$FF9" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartE0Widget.cxx b/src/debugger/gui/CartE0Widget.cxx index f6e6de510..a51b88308 100644 --- a/src/debugger/gui/CartE0Widget.cxx +++ b/src/debugger/gui/CartE0Widget.cxx @@ -135,7 +135,7 @@ string CartridgeE0Widget::bankState() { ostringstream& buf = buffer(); - buf << "Slices: " << dec + buf << "Slices: " << std::dec << seg0[myCart.myCurrentSlice[0]] << " / " << seg1[myCart.myCurrentSlice[1]] << " / " << seg2[myCart.myCurrentSlice[2]]; diff --git a/src/debugger/gui/CartE7Widget.cxx b/src/debugger/gui/CartE7Widget.cxx index a50253f0c..490fe646c 100644 --- a/src/debugger/gui/CartE7Widget.cxx +++ b/src/debugger/gui/CartE7Widget.cxx @@ -128,7 +128,7 @@ string CartridgeE7Widget::bankState() { ostringstream& buf = buffer(); - buf << "Slices: " << dec + buf << "Slices: " << std::dec << spot_lower[myCart.myCurrentSlice[0]] << " / " << spot_upper[myCart.myCurrentRAM]; diff --git a/src/debugger/gui/CartEFSCWidget.cxx b/src/debugger/gui/CartEFSCWidget.cxx index ec456e8eb..e952d82a3 100644 --- a/src/debugger/gui/CartEFSCWidget.cxx +++ b/src/debugger/gui/CartEFSCWidget.cxx @@ -41,7 +41,7 @@ CartridgeEFSCWidget::CartridgeEFSCWidget( { uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset]; start -= start % 0x1000; - info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100) + info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << (start + 0x100) << " - " << "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n"; } @@ -115,7 +115,7 @@ string CartridgeEFSCWidget::bankState() "$FE0", "$FE1", "$FE2", "$FE3", "$FE4", "$FE5", "$FE6", "$FE7", "$FE8", "$FE9", "$FEA", "$FEB", "$FEC", "$FED", "$FEE", "$FEF" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartEFWidget.cxx b/src/debugger/gui/CartEFWidget.cxx index 081d8f769..5b48cdae8 100644 --- a/src/debugger/gui/CartEFWidget.cxx +++ b/src/debugger/gui/CartEFWidget.cxx @@ -39,7 +39,7 @@ CartridgeEFWidget::CartridgeEFWidget( { uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset]; start -= start % 0x1000; - info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start << " - " + info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start << " - " << "$" << (start + 0xFFF) << " (hotspot = $" << (spot+i) << ")\n"; } @@ -102,7 +102,7 @@ string CartridgeEFWidget::bankState() "$FE0", "$FE1", "$FE2", "$FE3", "$FE4", "$FE5", "$FE6", "$FE7", "$FE8", "$FE9", "$FEA", "$FEB", "$FEC", "$FED", "$FEE", "$FEF" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartF0Widget.cxx b/src/debugger/gui/CartF0Widget.cxx index 0b1fbd171..4a04f0a2b 100644 --- a/src/debugger/gui/CartF0Widget.cxx +++ b/src/debugger/gui/CartF0Widget.cxx @@ -40,8 +40,8 @@ CartridgeF0Widget::CartridgeF0Widget( { uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset]; start -= start % 0x1000; - info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start << " - " - << "$" << (start + 0xFFF) << "\n"; + info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start + << " - " << "$" << (start + 0xFFF) << "\n"; } int xpos = 10, @@ -99,7 +99,7 @@ string CartridgeF0Widget::bankState() { ostringstream& buf = buffer(); - buf << "Bank = " << dec << myCart.myCurrentBank << ", hotspot = $FF0"; + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = $FF0"; return buf.str(); } diff --git a/src/debugger/gui/CartF4SCWidget.cxx b/src/debugger/gui/CartF4SCWidget.cxx index d8fd254b3..acacf50a2 100644 --- a/src/debugger/gui/CartF4SCWidget.cxx +++ b/src/debugger/gui/CartF4SCWidget.cxx @@ -105,7 +105,7 @@ string CartridgeF4SCWidget::bankState() static const char* spot[] = { "$FF4", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartF4Widget.cxx b/src/debugger/gui/CartF4Widget.cxx index 0a476ea13..523e8fbd3 100644 --- a/src/debugger/gui/CartF4Widget.cxx +++ b/src/debugger/gui/CartF4Widget.cxx @@ -92,7 +92,7 @@ string CartridgeF4Widget::bankState() static const char* spot[] = { "$FF4", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartF6SCWidget.cxx b/src/debugger/gui/CartF6SCWidget.cxx index 649a67d1e..0f3fb015e 100644 --- a/src/debugger/gui/CartF6SCWidget.cxx +++ b/src/debugger/gui/CartF6SCWidget.cxx @@ -99,7 +99,7 @@ string CartridgeF6SCWidget::bankState() ostringstream& buf = buffer(); static const char* spot[] = { "$FF6", "$FF7", "$FF8", "$FF9" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartF6Widget.cxx b/src/debugger/gui/CartF6Widget.cxx index 6d2d21a40..432d02b98 100644 --- a/src/debugger/gui/CartF6Widget.cxx +++ b/src/debugger/gui/CartF6Widget.cxx @@ -86,7 +86,7 @@ string CartridgeF6Widget::bankState() ostringstream& buf = buffer(); static const char* spot[] = { "$FF6", "$FF7", "$FF8", "$FF9" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartF8SCWidget.cxx b/src/debugger/gui/CartF8SCWidget.cxx index 841436c4b..b760e3799 100644 --- a/src/debugger/gui/CartF8SCWidget.cxx +++ b/src/debugger/gui/CartF8SCWidget.cxx @@ -97,7 +97,7 @@ string CartridgeF8SCWidget::bankState() ostringstream& buf = buffer(); static const char* spot[] = { "$FF8", "$FF9" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartF8Widget.cxx b/src/debugger/gui/CartF8Widget.cxx index 79a278d82..768a9420e 100644 --- a/src/debugger/gui/CartF8Widget.cxx +++ b/src/debugger/gui/CartF8Widget.cxx @@ -84,7 +84,7 @@ string CartridgeF8Widget::bankState() ostringstream& buf = buffer(); static const char* spot[] = { "$FF8", "$FF9" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartFA2Widget.cxx b/src/debugger/gui/CartFA2Widget.cxx index 7895159a7..aa50d3b0a 100644 --- a/src/debugger/gui/CartFA2Widget.cxx +++ b/src/debugger/gui/CartFA2Widget.cxx @@ -151,7 +151,7 @@ string CartridgeFA2Widget::bankState() static const char* spot[] = { "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartFAWidget.cxx b/src/debugger/gui/CartFAWidget.cxx index e68258830..9830d70af 100644 --- a/src/debugger/gui/CartFAWidget.cxx +++ b/src/debugger/gui/CartFAWidget.cxx @@ -98,7 +98,7 @@ string CartridgeFAWidget::bankState() ostringstream& buf = buffer(); static const char* spot[] = { "$FF8", "$FF9", "$FFA" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartFEWidget.cxx b/src/debugger/gui/CartFEWidget.cxx index 999c7937a..36e2651af 100644 --- a/src/debugger/gui/CartFEWidget.cxx +++ b/src/debugger/gui/CartFEWidget.cxx @@ -46,7 +46,7 @@ string CartridgeFEWidget::bankState() ostringstream& buf = buffer(); static const char* range[] = { "$F000", "$D000" }; - buf << "Bank = " << dec << myCart.getBank() + buf << "Bank = " << std::dec << myCart.getBank() << ", address range = " << range[myCart.getBank()]; return buf.str(); diff --git a/src/debugger/gui/CartMCWidget.cxx b/src/debugger/gui/CartMCWidget.cxx index 37a6c3682..db1f0d243 100644 --- a/src/debugger/gui/CartMCWidget.cxx +++ b/src/debugger/gui/CartMCWidget.cxx @@ -135,7 +135,7 @@ string CartridgeMCWidget::bankState() { ostringstream& buf = buffer(); - buf << "Slices: " << dec + buf << "Slices: " << std::dec << myCart.myCurrentBlock[0] << " / " << myCart.myCurrentBlock[1] << " / " << myCart.myCurrentBlock[2] << " / " diff --git a/src/debugger/gui/CartMDMWidget.cxx b/src/debugger/gui/CartMDMWidget.cxx index 914618974..7a7b845bc 100644 --- a/src/debugger/gui/CartMDMWidget.cxx +++ b/src/debugger/gui/CartMDMWidget.cxx @@ -44,7 +44,7 @@ CartridgeMDMWidget::CartridgeMDMWidget( for(uInt32 i = 0x800; i < (0x800u + myCart.bankCount()); ++i) { info.str(""); - info << dec << (i & 0xFF) << " ($" << Common::Base::HEX4 << i << ")"; + info << std::dec << (i & 0xFF) << " ($" << Common::Base::HEX4 << i << ")"; VarList::push_back(items, info.str()); } @@ -94,7 +94,7 @@ string CartridgeMDMWidget::bankState() { ostringstream& buf = buffer(); - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << "$" << Common::Base::HEX4 << (myCart.myCurrentBank+0x800); diff --git a/src/debugger/gui/CartSBWidget.cxx b/src/debugger/gui/CartSBWidget.cxx index c52d45ae0..863ef2406 100644 --- a/src/debugger/gui/CartSBWidget.cxx +++ b/src/debugger/gui/CartSBWidget.cxx @@ -36,7 +36,7 @@ CartridgeSBWidget::CartridgeSBWidget( << "Hotspots are from $800 to $" << Common::Base::HEX2 << (0x800 + myCart.bankCount() - 1) << ", including\n" << "mirrors ($900, $A00, $B00, ...)\n" - << "Startup bank = " << dec << cart.myStartBank << "\n"; + << "Startup bank = " << std::dec << cart.myStartBank << "\n"; // Eventually, we should query this from the debugger/disassembler for(uInt32 i = 0, offset = 0xFFC, spot = 0x800; i < myCart.bankCount(); @@ -44,11 +44,11 @@ CartridgeSBWidget::CartridgeSBWidget( { uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset]; start -= start % 0x1000; - info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start << " - " + info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start << " - " << "$" << (start + 0xFFF) << " (hotspot = $" << spot << ")\n"; - bank << dec << setw(2) << setfill(' ') << i << " ($" << Common::Base::HEX2 - << spot << ")"; + bank << std::dec << std::setw(2) << std::setfill(' ') << i << " ($" + << Common::Base::HEX2 << spot << ")"; VarList::push_back(items, bank.str()); bank.str(""); } @@ -90,7 +90,7 @@ string CartridgeSBWidget::bankState() { ostringstream& buf = buffer(); - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = $" << Common::Base::HEX2 << (myCart.myCurrentBank + 0x800); return buf.str(); diff --git a/src/debugger/gui/CartUAWidget.cxx b/src/debugger/gui/CartUAWidget.cxx index f645283ad..d5a631e75 100644 --- a/src/debugger/gui/CartUAWidget.cxx +++ b/src/debugger/gui/CartUAWidget.cxx @@ -85,7 +85,7 @@ string CartridgeUAWidget::bankState() ostringstream& buf = buffer(); static const char* spot[] = { "$200", "$240" }; - buf << "Bank = " << dec << myCart.myCurrentBank + buf << "Bank = " << std::dec << myCart.myCurrentBank << ", hotspot = " << spot[myCart.myCurrentBank]; return buf.str(); diff --git a/src/debugger/gui/CartWDWidget.cxx b/src/debugger/gui/CartWDWidget.cxx index f9149e009..13fa81c5c 100644 --- a/src/debugger/gui/CartWDWidget.cxx +++ b/src/debugger/gui/CartWDWidget.cxx @@ -107,7 +107,7 @@ string CartridgeWDWidget::bankState() "[0,0,6,7*]", "[0,1,7,6*]", "[3,2,4,5*]", "[6,0,5,1*]" }; uInt16 bank = myCart.getBank(); - buf << "Bank = " << dec << bank << ", segments = " << segments[bank]; + buf << "Bank = " << std::dec << bank << ", segments = " << segments[bank]; return buf.str(); } diff --git a/src/debugger/gui/CartX07Widget.cxx b/src/debugger/gui/CartX07Widget.cxx index 316a72827..6c6f3c850 100644 --- a/src/debugger/gui/CartX07Widget.cxx +++ b/src/debugger/gui/CartX07Widget.cxx @@ -41,7 +41,7 @@ CartridgeX07Widget::CartridgeX07Widget( { uInt16 start = (cart.myImage[offset+1] << 8) | cart.myImage[offset]; start -= start % 0x1000; - info << "Bank " << dec << i << " @ $" << Common::Base::HEX4 << start + info << "Bank " << std::dec << i << " @ $" << Common::Base::HEX4 << start << " - " << "$" << (start + 0xFFF) << "\n"; } @@ -100,7 +100,7 @@ string CartridgeX07Widget::bankState() { ostringstream& buf = buffer(); - buf << "Bank = " << dec << myCart.myCurrentBank; + buf << "Bank = " << std::dec << myCart.myCurrentBank; return buf.str(); } diff --git a/src/debugger/gui/TiaOutputWidget.cxx b/src/debugger/gui/TiaOutputWidget.cxx index e4f1c229b..89f1f3705 100644 --- a/src/debugger/gui/TiaOutputWidget.cxx +++ b/src/debugger/gui/TiaOutputWidget.cxx @@ -65,7 +65,7 @@ void TiaOutputWidget::saveSnapshot() ostringstream sspath; sspath << instance().snapshotSaveDir() << instance().console().properties().get(Cartridge_Name) - << "_dbg_" << hex << setw(8) << setfill('0') << number << ".png"; + << "_dbg_" << std::hex << std::setw(8) << std::setfill('0') << number << ".png"; const uInt32 width = instance().console().tia().width(), height = instance().console().tia().height(); diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index 085f91730..1903f41b1 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -744,16 +744,16 @@ void Console::setControllers(const string& rommd5) void Console::loadUserPalette() { const string& palette = myOSystem.paletteFile(); - ifstream in(palette, ios::binary); + ifstream in(palette, std::ios::binary); if(!in) return; // Make sure the contains enough data for the NTSC, PAL and SECAM palettes // This means 128 colours each for NTSC and PAL, at 3 bytes per pixel // and 8 colours for SECAM at 3 bytes per pixel - in.seekg(0, ios::end); - streampos length = in.tellg(); - in.seekg(0, ios::beg); + in.seekg(0, std::ios::end); + std::streampos length = in.tellg(); + in.seekg(0, std::ios::beg); if(length < 128 * 3 * 2 + 8 * 3) { cerr << "ERROR: invalid palette file " << palette << endl; diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index b42fcad0a..ba5e2fcaf 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -1797,7 +1797,8 @@ void EventHandler::takeSnapshot(uInt32 number) if(number > 0) { ostringstream buf; - buf << sspath << "_" << hex << setw(8) << setfill('0') << number << ".png"; + buf << sspath << "_" << std::hex << std::setw(8) << std::setfill('0') + << number << ".png"; filename = buf.str(); } else if(!myOSystem.settings().getBool("sssingle")) diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 876fdb97b..64f619b8c 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -448,8 +448,8 @@ class EventHandler }; public: - using StickDatabase = map; - using StickList = map; + using StickDatabase = std::map; + using StickList = std::map; JoystickHandler(OSystem& system); ~JoystickHandler(); diff --git a/src/emucore/MT24LC256.cxx b/src/emucore/MT24LC256.cxx index 9bcd9c910..f5d352357 100644 --- a/src/emucore/MT24LC256.cxx +++ b/src/emucore/MT24LC256.cxx @@ -73,14 +73,14 @@ MT24LC256::MT24LC256(const string& filename, const System& system) jpee_ad_known(0) { // Load the data from an external file (if it exists) - ifstream in(myDataFile, ios_base::binary); + ifstream in(myDataFile, std::ios_base::binary); if(in.is_open()) { // Get length of file; it must be 32768 - in.seekg(0, ios::end); + in.seekg(0, std::ios::end); if(uInt32(in.tellg()) == 32768u) { - in.seekg(0, ios::beg); + in.seekg(0, std::ios::beg); in.read(reinterpret_cast(myData), 32768); myDataFileExists = true; } @@ -98,7 +98,7 @@ MT24LC256::~MT24LC256() // Save EEPROM data to external file only when necessary if(!myDataFileExists || myDataChanged) { - ofstream out(myDataFile, ios_base::binary); + ofstream out(myDataFile, std::ios_base::binary); if(out.is_open()) out.write(reinterpret_cast(myData), 32768); } diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index ac05f1ae0..4b5dd3eb4 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -465,13 +465,13 @@ void OSystem::logMessage(const string& message, uInt8 level) { if(level == 0) { - cout << message << endl << flush; + cout << message << endl << std::flush; myLogMessages += message + "\n"; } else if(level <= uInt8(mySettings->getInt("loglevel"))) { if(mySettings->getBool("logtoconsole")) - cout << message << endl << flush; + cout << message << endl << std::flush; myLogMessages += message + "\n"; } } diff --git a/src/emucore/PropsSet.hxx b/src/emucore/PropsSet.hxx index 3b2c8af3d..99b420abd 100644 --- a/src/emucore/PropsSet.hxx +++ b/src/emucore/PropsSet.hxx @@ -117,7 +117,7 @@ class PropertiesSet void print() const; private: - using PropsList = map; + using PropsList = std::map; // The properties read from an external 'stella.pro' file PropsList myExternalProps; diff --git a/src/emucore/Serializer.cxx b/src/emucore/Serializer.cxx index 77ee56604..8fffe2687 100644 --- a/src/emucore/Serializer.cxx +++ b/src/emucore/Serializer.cxx @@ -23,6 +23,9 @@ #include "FSNode.hxx" #include "Serializer.hxx" +using std::ios; +using std::ios_base; + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Serializer::Serializer(const string& filename, bool readonly) : myStream(nullptr) diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 1b8df13d8..becb2f665 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -472,7 +472,7 @@ void Settings::usage() const << " -pp Sets the 'Display.Phosphor' property\n" << " -ppblend Sets the 'Display.PPBlend' property\n" #endif - << endl << flush; + << endl << std::flush; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/TIA.cxx b/src/emucore/TIA.cxx index 649af03ad..f61868be2 100644 --- a/src/emucore/TIA.cxx +++ b/src/emucore/TIA.cxx @@ -1893,7 +1893,7 @@ bool TIA::poke(uInt16 addr, uInt8 value) case AUDC0: // Audio control 0 { myAUDC0 = value & 0x0f; -cerr << scanlines() << ": C0, " << hex << int(myAUDC0) << ", " << dec << ((clock - myClockWhenFrameStarted) % 228) << endl; +cerr << scanlines() << ": C0, " << std::hex << int(myAUDC0) << ", " << std::dec << ((clock - myClockWhenFrameStarted) % 228) << endl; myTIASound.writeAudC0(value, (clock - myClockWhenFrameStarted) % 228); break; } @@ -1901,7 +1901,7 @@ cerr << scanlines() << ": C0, " << hex << int(myAUDC0) << ", " << dec << ((clock case AUDC1: // Audio control 1 { myAUDC1 = value & 0x0f; -cerr << scanlines() << ": C1, " << hex << int(myAUDC1) << ", " << dec << ((clock - myClockWhenFrameStarted) % 228) << endl; +cerr << scanlines() << ": C1, " << std::hex << int(myAUDC1) << ", " << std::dec << ((clock - myClockWhenFrameStarted) % 228) << endl; myTIASound.writeAudC1(value, (clock - myClockWhenFrameStarted) % 228); break; } @@ -1909,7 +1909,7 @@ cerr << scanlines() << ": C1, " << hex << int(myAUDC1) << ", " << dec << ((clock case AUDF0: // Audio frequency 0 { myAUDF0 = value & 0x1f; -cerr << scanlines() << ": F0, " << hex << int(myAUDF0) << ", " << dec << ((clock - myClockWhenFrameStarted) % 228) << endl; +cerr << scanlines() << ": F0, " << std::hex << int(myAUDF0) << ", " << std::dec << ((clock - myClockWhenFrameStarted) % 228) << endl; myTIASound.writeAudF0(value, (clock - myClockWhenFrameStarted) % 228); break; } @@ -1917,7 +1917,7 @@ cerr << scanlines() << ": F0, " << hex << int(myAUDF0) << ", " << dec << ((clock case AUDF1: // Audio frequency 1 { myAUDF1 = value & 0x1f; -cerr << scanlines() << ": F1, " << hex << int(myAUDF1) << ", " << dec << ((clock - myClockWhenFrameStarted) % 228) << endl; +cerr << scanlines() << ": F1, " << std::hex << int(myAUDF1) << ", " << std::dec << ((clock - myClockWhenFrameStarted) % 228) << endl; myTIASound.writeAudF1(value, (clock - myClockWhenFrameStarted) % 228); break; } @@ -1925,7 +1925,7 @@ cerr << scanlines() << ": F1, " << hex << int(myAUDF1) << ", " << dec << ((clock case AUDV0: // Audio volume 0 { myAUDV0 = value & 0x0f; -cerr << scanlines() << ": V0, " << hex << int(myAUDV0) << ", " << dec << ((clock - myClockWhenFrameStarted) % 228) << endl; +cerr << scanlines() << ": V0, " << std::hex << int(myAUDV0) << ", " << std::dec << ((clock - myClockWhenFrameStarted) % 228) << endl; myTIASound.writeAudV0(value, (clock - myClockWhenFrameStarted) % 228); break; } @@ -1933,7 +1933,7 @@ cerr << scanlines() << ": V0, " << hex << int(myAUDV0) << ", " << dec << ((clock case AUDV1: // Audio volume 1 { myAUDV1 = value & 0x0f; -cerr << scanlines() << ": V1, " << hex << int(myAUDV1) << ", " << dec << ((clock - myClockWhenFrameStarted) % 228) << endl; +cerr << scanlines() << ": V1, " << std::hex << int(myAUDV1) << ", " << std::dec << ((clock - myClockWhenFrameStarted) % 228) << endl; myTIASound.writeAudV1(value, (clock - myClockWhenFrameStarted) % 228); break; } @@ -2284,7 +2284,7 @@ cerr << scanlines() << ": V1, " << hex << int(myAUDV1) << ", " << dec << ((clock default: { #ifdef DEBUG_ACCESSES - cerr << "BAD TIA Poke: " << hex << addr << endl; + cerr << "BAD TIA Poke: " << std::hex << addr << endl; #endif break; } diff --git a/src/emucore/TIASnd.cxx b/src/emucore/TIASnd.cxx index 9080bfe94..35f915b86 100644 --- a/src/emucore/TIASnd.cxx +++ b/src/emucore/TIASnd.cxx @@ -280,7 +280,7 @@ void TIASound::volume(uInt32 percent) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool TIASound::updateAudioState(AudioState& state, uInt32 audf, uInt32* audc) { - bool pulse_fb; // pulse counter LFSR feedback + bool pulse_fb = false; // pulse counter LFSR feedback // -- Logic updated on phase 1 of the audio clock -- if(state.clk_en) diff --git a/src/emucore/TIASnd.hxx b/src/emucore/TIASnd.hxx index 27bdb998a..0e508839b 100644 --- a/src/emucore/TIASnd.hxx +++ b/src/emucore/TIASnd.hxx @@ -225,7 +225,7 @@ class TIASound : public Serializable // Contains the samples previously created by queueSamples() // This will be periodically emptied by getSamples() - queue mySamples; + std::queue mySamples; // The colour clock at which each cycle/phase ends // Any writes to sound registers that occur after a respective diff --git a/src/emucore/Thumbulator.cxx b/src/emucore/Thumbulator.cxx index bcd572b37..fe50c2c53 100644 --- a/src/emucore/Thumbulator.cxx +++ b/src/emucore/Thumbulator.cxx @@ -29,7 +29,7 @@ #include "bspf.hxx" #include "Base.hxx" #include "Thumbulator.hxx" -using namespace Common; +using Common::Base; // Uncomment the following to enable specific functionality // WARNING!!! This slows the runtime to a crawl