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
This commit is contained in:
stephena 2016-05-24 16:55:45 +00:00
parent 9d1c2085e6
commit 40cfd6a475
63 changed files with 173 additions and 136 deletions

View File

@ -150,7 +150,7 @@ class CheatManager
CheatList myCheatList;
CheatList myPerFrameList;
map<string,string> myCheatMap;
std::map<string,string> myCheatMap;
string myCheatFile;
// This is set each time a new cheat/ROM is loaded, for later

View File

@ -148,7 +148,7 @@ bool FilesystemNodeZIP::getChildren(AbstractFSList& myList, ListMode mode,
if(!isDirectory() || _error != ZIPERR_NONE)
return false;
set<string> dirs;
std::set<string> dirs;
ZipHandler& zip = open(_zipFile);
while(zip.hasNext())
{

View File

@ -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");

View File

@ -77,7 +77,7 @@ class Variant
static const Variant EmptyVariant;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
using VariantList = vector<pair<string,Variant>>;
using VariantList = vector<std::pair<string,Variant>>;
namespace VarList {
inline void push_back(VariantList& list, const Variant& name,

View File

@ -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;
}
}

View File

@ -53,14 +53,36 @@ using uInt64 = uint64_t;
#include <utility>
#include <vector>
#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<Int32>;
using BoolArray = vector<bool>;
using ByteArray = vector<uInt8>;
using StringList = vector<string>;
using BytePtr = unique_ptr<uInt8[]>;
using IntArray = std::vector<Int32>;
using BoolArray = std::vector<bool>;
using ByteArray = std::vector<uInt8>;
using StringList = std::vector<std::string>;
using BytePtr = std::unique_ptr<uInt8[]>;
static const string EmptyString("");

View File

@ -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();

View File

@ -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

View File

@ -263,8 +263,8 @@ class CartDebug : public DebuggerSystem
void addressTypeAsString(ostream& buf, uInt16 addr) const;
private:
using AddrToLabel = map<uInt16, string>;
using LabelToAddr = map<string, uInt16>;
using AddrToLabel = std::map<uInt16, string>;
using LabelToAddr = std::map<string, uInt16>;
// 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<uInt16>;
using DirectiveList = list<DirectiveTag>;
using AddressList = std::list<uInt16>;
using DirectiveList = std::list<DirectiveTag>;
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<uInt16, int> myAddrToLineList;
std::map<uInt16, int> myAddrToLineList;
bool myAddrToLineIsROM;
// Mappings from label to address (and vice versa) for items

View File

@ -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;
}

View File

@ -48,8 +48,8 @@ class ButtonWidget;
#include "TIADebug.hxx"
#include "bspf.hxx"
using FunctionMap = map<string,unique_ptr<Expression>>;
using FunctionDefMap = map<string,string>;
using FunctionMap = std::map<string, unique_ptr<Expression>>;
using FunctionDefMap = std::map<string, string>;
/**

View File

@ -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"

View File

@ -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:

View File

@ -115,7 +115,7 @@ class DiStella
const Settings& mySettings;
CartDebug::ReservedEquates& myReserved;
stringstream myDisasmBuf;
queue<uInt16> myAddressQueue;
std::queue<uInt16> myAddressQueue;
uInt16 myOffset, myPC, myPCEnd;
struct resource {

View File

@ -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;

View File

@ -752,7 +752,7 @@ string TIADebug::toString()
const TiaState& state = static_cast<const TiaState&>(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) << "/$"

View File

@ -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();

View File

@ -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;

View File

@ -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();
}

View File

@ -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

View File

@ -104,7 +104,7 @@ string CartridgeARWidget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << dec << myCart.myCurrentBank;
buf << "Bank = " << std::dec << myCart.myCurrentBank;
return buf.str();
}

View File

@ -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();

View File

@ -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();

View File

@ -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");

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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]];

View File

@ -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];

View File

@ -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();

View File

@ -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();

View File

@ -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();
}

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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] << " / "

View File

@ -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);

View File

@ -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();

View File

@ -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();

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();

View File

@ -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;

View File

@ -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"))

View File

@ -448,8 +448,8 @@ class EventHandler
};
public:
using StickDatabase = map<string,StickInfo>;
using StickList = map<int, StellaJoystick*>;
using StickDatabase = std::map<string,StickInfo>;
using StickList = std::map<int, StellaJoystick*>;
JoystickHandler(OSystem& system);
~JoystickHandler();

View File

@ -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<char*>(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<char*>(myData), 32768);
}

View File

@ -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";
}
}

View File

@ -117,7 +117,7 @@ class PropertiesSet
void print() const;
private:
using PropsList = map<string, Properties>;
using PropsList = std::map<string, Properties>;
// The properties read from an external 'stella.pro' file
PropsList myExternalProps;

View File

@ -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)

View File

@ -472,7 +472,7 @@ void Settings::usage() const
<< " -pp <arg> Sets the 'Display.Phosphor' property\n"
<< " -ppblend <arg> Sets the 'Display.PPBlend' property\n"
#endif
<< endl << flush;
<< endl << std::flush;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -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;
}

View File

@ -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)

View File

@ -225,7 +225,7 @@ class TIASound : public Serializable
// Contains the samples previously created by queueSamples()
// This will be periodically emptied by getSamples()
queue<uInt16> mySamples;
std::queue<uInt16> mySamples;
// The colour clock at which each cycle/phase ends
// Any writes to sound registers that occur after a respective

View File

@ -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