mirror of https://github.com/stella-emu/stella.git
My neverending quest to protect against raw pointers.
Changed many 'const char* ...' to 'const char* const ...'.
This commit is contained in:
parent
9972af022a
commit
7b57d52260
|
@ -108,12 +108,12 @@ Base::Format Base::myDefaultBase = Base::F_16;
|
|||
std::ios_base::fmtflags Base::myHexflags = std::ios_base::hex;
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const char* Base::myLowerFmt[4] = {
|
||||
const char* const Base::myLowerFmt[4] = {
|
||||
"%1x", "%02x", "%04x", "%08x"
|
||||
};
|
||||
const char* Base::myUpperFmt[4] = {
|
||||
const char* const Base::myUpperFmt[4] = {
|
||||
"%1X", "%02X", "%04X", "%08X"
|
||||
};
|
||||
const char** Base::myFmt = Base::myLowerFmt;
|
||||
const char* const* Base::myFmt = Base::myLowerFmt;
|
||||
|
||||
} // Namespace Common
|
||||
|
|
|
@ -93,9 +93,9 @@ class Base
|
|||
|
||||
// Format specifiers to use for sprintf (eventually we may convert
|
||||
// to C++ streams
|
||||
static const char* myLowerFmt[4];
|
||||
static const char* myUpperFmt[4];
|
||||
static const char** myFmt;
|
||||
static const char* const myLowerFmt[4];
|
||||
static const char* const myUpperFmt[4];
|
||||
static const char* const* myFmt;
|
||||
|
||||
private:
|
||||
// Following constructors and assignment operators not supported
|
||||
|
|
|
@ -46,7 +46,7 @@ class EventHandlerSDL2 : public EventHandler
|
|||
/**
|
||||
Returns the human-readable name for a StellaKey.
|
||||
*/
|
||||
const char* nameForKey(StellaKey key) const override {
|
||||
const char* const nameForKey(StellaKey key) const override {
|
||||
return SDL_GetScancodeName(SDL_Scancode(key));
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ class Variant
|
|||
|
||||
// Conversion methods
|
||||
const string& toString() const { return data; }
|
||||
const char* toCString() const { return data.c_str(); }
|
||||
const char* const toCString() const { return data.c_str(); }
|
||||
const Int32 toInt() const { return atoi(data.c_str()); }
|
||||
const float toFloat() const { return float(atof(data.c_str())); }
|
||||
const bool toBool() const { return data == "1" || data == "true"; }
|
||||
|
|
|
@ -87,7 +87,7 @@ string ZipHandler::next()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt32 ZipHandler::decompress(BytePtr& image)
|
||||
{
|
||||
static const char* zip_error_s[] = {
|
||||
static const char* const zip_error_s[] = {
|
||||
"ZIPERR_NONE",
|
||||
"ZIPERR_OUT_OF_MEMORY",
|
||||
"ZIPERR_FILE_ERROR",
|
||||
|
|
|
@ -147,7 +147,7 @@ class NTSCFilter
|
|||
uInt8 myTIAPalette[AtariNTSC::palette_size * 3];
|
||||
|
||||
struct AdjustableTag {
|
||||
const char* type;
|
||||
const char* const type;
|
||||
double* value;
|
||||
};
|
||||
uInt32 myCurrentAdjustable;
|
||||
|
|
|
@ -1391,13 +1391,13 @@ void CartDebug::disasmTypeAsString(ostream& buf, uInt8 flags) const
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const char* CartDebug::ourTIAMnemonicR[16] = {
|
||||
const char* const CartDebug::ourTIAMnemonicR[16] = {
|
||||
"CXM0P", "CXM1P", "CXP0FB", "CXP1FB", "CXM0FB", "CXM1FB", "CXBLPF", "CXPPMM",
|
||||
"INPT0", "INPT1", "INPT2", "INPT3", "INPT4", "INPT5", 0, 0
|
||||
};
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const char* CartDebug::ourTIAMnemonicW[64] = {
|
||||
const char* const CartDebug::ourTIAMnemonicW[64] = {
|
||||
"VSYNC", "VBLANK", "WSYNC", "RSYNC", "NUSIZ0", "NUSIZ1", "COLUP0", "COLUP1",
|
||||
"COLUPF", "COLUBK", "CTRLPF", "REFP0", "REFP1", "PF0", "PF1", "PF2",
|
||||
"RESP0", "RESP1", "RESM0", "RESM1", "RESBL", "AUDC0", "AUDC1", "AUDF0",
|
||||
|
@ -1408,13 +1408,13 @@ const char* CartDebug::ourTIAMnemonicW[64] = {
|
|||
};
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const char* CartDebug::ourIOMnemonic[24] = {
|
||||
const char* const CartDebug::ourIOMnemonic[24] = {
|
||||
"SWCHA", "SWACNT", "SWCHB", "SWBCNT", "INTIM", "TIMINT", 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, "TIM1T", "TIM8T", "TIM64T", "T1024T"
|
||||
};
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const char* CartDebug::ourZPMnemonic[128] = {
|
||||
const char* const CartDebug::ourZPMnemonic[128] = {
|
||||
"ram_80", "ram_81", "ram_82", "ram_83", "ram_84", "ram_85", "ram_86", "ram_87",
|
||||
"ram_88", "ram_89", "ram_8A", "ram_8B", "ram_8C", "ram_8D", "ram_8E", "ram_8F",
|
||||
"ram_90", "ram_91", "ram_92", "ram_93", "ram_94", "ram_95", "ram_96", "ram_97",
|
||||
|
|
|
@ -382,10 +382,10 @@ class CartDebug : public DebuggerSystem
|
|||
string myListFile, mySymbolFile, myCfgFile, myDisasmFile, myRomFile;
|
||||
|
||||
/// Table of instruction mnemonics
|
||||
static const char* ourTIAMnemonicR[16]; // read mode
|
||||
static const char* ourTIAMnemonicW[64]; // write mode
|
||||
static const char* ourIOMnemonic[24];
|
||||
static const char* ourZPMnemonic[128];
|
||||
static const char* const ourTIAMnemonicR[16]; // read mode
|
||||
static const char* const ourTIAMnemonicW[64]; // write mode
|
||||
static const char* const ourIOMnemonic[24];
|
||||
static const char* const ourZPMnemonic[128];
|
||||
|
||||
private:
|
||||
// Following constructors and assignment operators not supported
|
||||
|
|
|
@ -174,7 +174,7 @@ class DiStella
|
|||
};
|
||||
|
||||
struct Instruction_tag {
|
||||
const char* mnemonic;
|
||||
const char* const mnemonic;
|
||||
AddressingMode addr_mode;
|
||||
AccessMode source;
|
||||
ReadWriteMode rw_mode;
|
||||
|
|
|
@ -82,7 +82,7 @@ string Cartridge0840Widget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = { "$800", "$840" };
|
||||
static const char* const spot[] = { "$800", "$840" };
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
<< ", hotspot = " << spot[myCart.myCurrentBank];
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ string CartridgeBFSCWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FF80", "$FF81", "$FF82", "$FF83", "$FF84", "$FF85", "$FF86", "$FF87",
|
||||
"$FF88", "$FF89", "$FF8A", "$FF8B", "$FF8C", "$FF8D", "$FF8E", "$FF8F",
|
||||
"$FF90", "$FF91", "$FF92", "$FF93", "$FF94", "$FF95", "$FF96", "$FF97",
|
||||
|
|
|
@ -144,7 +144,7 @@ string CartridgeBFWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FF80", "$FF81", "$FF82", "$FF83", "$FF84", "$FF85", "$FF86", "$FF87",
|
||||
"$FF88", "$FF89", "$FF8A", "$FF8B", "$FF8C", "$FF8D", "$FF8E", "$FF8F",
|
||||
"$FF90", "$FF91", "$FF92", "$FF93", "$FF94", "$FF95", "$FF96", "$FF97",
|
||||
|
|
|
@ -394,7 +394,7 @@ string CartridgeBUSWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FFF5", "$FFF6", "$FFF7", "$FFF8", "$FFF9", "$FFFA", "$FFFB"
|
||||
};
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
|
|
|
@ -357,7 +357,7 @@ string CartridgeCDFWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FFF5", "$FFF6", "$FFF7", "$FFF8", "$FFF9", "$FFFA", "$FFFB"
|
||||
};
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
|
|
|
@ -90,7 +90,7 @@ string CartridgeCTYWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"", "$FFF5", "$FFF6", "$FFF7", "$FFF8", "$FFF9", "$FFFA", "$FFFB"
|
||||
};
|
||||
uInt16 bank = myCart.getBank();
|
||||
|
|
|
@ -254,7 +254,7 @@ void CartridgeDASHWidget::updateUIState()
|
|||
else
|
||||
{
|
||||
int bankno = segment & myCart.BIT_BANK_MASK;
|
||||
const char* banktype = segment & myCart.BITMASK_ROMRAM ? "RAM" : "ROM";
|
||||
const string& banktype = segment & myCart.BITMASK_ROMRAM ? "RAM" : "ROM";
|
||||
|
||||
myBankNumber[i]->setSelected(bankno);
|
||||
myBankType[i]->setSelected(banktype);
|
||||
|
|
|
@ -125,7 +125,7 @@ string CartridgeDFSCWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FFC0", "$FFC1", "$FFC2", "$FFC3", "$FFC4", "$FFC5", "$FFC6", "$FFC7",
|
||||
"$FFC8", "$FFC9", "$FFCA", "$FFCB", "$FFCC", "$FFCD", "$FFCE", "$FFCF",
|
||||
"$FFD0", "$FFD1", "$FFD2", "$FFD3", "$FFD4", "$FFD5", "$FFD6", "$FFE7",
|
||||
|
|
|
@ -112,7 +112,7 @@ string CartridgeDFWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FFC0", "$FFC1", "$FFC2", "$FFC3", "$FFC4", "$FFC5", "$FFC6", "$FFC7",
|
||||
"$FFC8", "$FFC9", "$FFCA", "$FFCB", "$FFCC", "$FFCD", "$FFCE", "$FFCF",
|
||||
"$FFD0", "$FFD1", "$FFD2", "$FFD3", "$FFD4", "$FFD5", "$FFD6", "$FFD7",
|
||||
|
|
|
@ -324,7 +324,7 @@ string CartridgeDPCPlusWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FFF6", "$FFF7", "$FFF8", "$FFF9", "$FFFA", "$FFFB"
|
||||
};
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
|
|
|
@ -227,7 +227,7 @@ string CartridgeDPCWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = { "$FFF8", "$FFF9" };
|
||||
static const char* const spot[] = { "$FFF8", "$FFF9" };
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
<< ", hotspot = " << spot[myCart.myCurrentBank];
|
||||
|
||||
|
|
|
@ -19,15 +19,15 @@
|
|||
#include "PopUpWidget.hxx"
|
||||
#include "CartE0Widget.hxx"
|
||||
|
||||
static const char* seg0[] = {
|
||||
static const char* const seg0[] = {
|
||||
"0 ($FFE0)", "1 ($FFE1)", "2 ($FFE2)", "3 ($FFE3)",
|
||||
"4 ($FFE4)", "5 ($FFE5)", "6 ($FFE6)", "7 ($FFE7)"
|
||||
};
|
||||
static const char* seg1[] = {
|
||||
static const char* const seg1[] = {
|
||||
"0 ($FFE8)", "1 ($FFE9)", "2 ($FFEA)", "3 ($FFEB)",
|
||||
"4 ($FFEC)", "5 ($FFED)", "6 ($FFEE)", "7 ($FFEF)"
|
||||
};
|
||||
static const char* seg2[] = {
|
||||
static const char* const seg2[] = {
|
||||
"0 ($FFF0)", "1 ($FFF1)", "2 ($FFF2)", "3 ($FFF3)",
|
||||
"4 ($FFF4)", "5 ($FFF5)", "6 ($FFF6)", "7 ($FFF7)"
|
||||
};
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
#include "PopUpWidget.hxx"
|
||||
#include "CartE7Widget.hxx"
|
||||
|
||||
static const char* spot_lower[] = {
|
||||
static const char* const spot_lower[] = {
|
||||
"0 - ROM ($FFE0)", "1 - ROM ($FFE1)", "2 - ROM ($FFE2)", "3 - ROM ($FFE3)",
|
||||
"4 - ROM ($FFE4)", "5 - ROM ($FFE5)", "6 - ROM ($FFE6)", "7 - RAM ($FFE7)"
|
||||
};
|
||||
static const char* spot_upper[] = {
|
||||
static const char* const spot_upper[] = {
|
||||
"0 - RAM ($FFE8)", "1 - RAM ($FFE9)", "2 - RAM ($FFEA)", "3 - RAM ($FFEB)"
|
||||
};
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ string CartridgeEFSCWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FFE0", "$FFE1", "$FFE2", "$FFE3", "$FFE4", "$FFE5", "$FFE6", "$FFE7",
|
||||
"$FFE8", "$FFE9", "$FFEA", "$FFEB", "$FFEC", "$FFED", "$FFEE", "$FFEF"
|
||||
};
|
||||
|
|
|
@ -96,7 +96,7 @@ string CartridgeEFWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FFE0", "$FFE1", "$FFE2", "$FFE3", "$FFE4", "$FFE5", "$FFE6", "$FFE7",
|
||||
"$FFE8", "$FFE9", "$FFEA", "$FFEB", "$FFEC", "$FFED", "$FFEE", "$FFEF"
|
||||
};
|
||||
|
|
|
@ -100,7 +100,7 @@ string CartridgeF4SCWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FFF4", "$FFF5", "$FFF6", "$FFF7", "$FFF8", "$FFF9", "$FFFA", "$FFFB"
|
||||
};
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
|
|
|
@ -87,7 +87,7 @@ string CartridgeF4Widget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FFF4", "$FFF5", "$FFF6", "$FFF7", "$FFF8", "$FFF9", "$FFFA", "$FFFB"
|
||||
};
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
|
|
|
@ -96,7 +96,7 @@ string CartridgeF6SCWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = { "$FFF6", "$FFF7", "$FFF8", "$FFF9" };
|
||||
static const char* const spot[] = { "$FFF6", "$FFF7", "$FFF8", "$FFF9" };
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
<< ", hotspot = " << spot[myCart.myCurrentBank];
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ string CartridgeF6Widget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = { "$FFF6", "$FFF7", "$FFF8", "$FFF9" };
|
||||
static const char* const spot[] = { "$FFF6", "$FFF7", "$FFF8", "$FFF9" };
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
<< ", hotspot = " << spot[myCart.myCurrentBank];
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ string CartridgeF8SCWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = { "$FFF8", "$FFF9" };
|
||||
static const char* const spot[] = { "$FFF8", "$FFF9" };
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
<< ", hotspot = " << spot[myCart.myCurrentBank];
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ string CartridgeF8Widget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = { "$FFF8", "$FFF9" };
|
||||
static const char* const spot[] = { "$FFF8", "$FFF9" };
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
<< ", hotspot = " << spot[myCart.myCurrentBank];
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ string CartridgeFA2Widget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = {
|
||||
static const char* const spot[] = {
|
||||
"$FFF5", "$FFF6", "$FFF7", "$FFF8", "$FFF9", "$FFFA", "$FFFB"
|
||||
};
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
|
|
|
@ -95,7 +95,7 @@ string CartridgeFAWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = { "$FFF8", "$FFF9", "$FFFA" };
|
||||
static const char* const spot[] = { "$FFF8", "$FFF9", "$FFFA" };
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
<< ", hotspot = " << spot[myCart.myCurrentBank];
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ string CartridgeFEWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* range[] = { "$F000", "$D000" };
|
||||
static const char* const range[] = { "$F000", "$D000" };
|
||||
buf << "Bank = " << std::dec << myCart.getBank()
|
||||
<< ", address range = " << range[myCart.getBank()];
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ string CartridgeUAWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* spot[] = { "$200", "$240" };
|
||||
static const char* const spot[] = { "$200", "$240" };
|
||||
buf << "Bank = " << std::dec << myCart.myCurrentBank
|
||||
<< ", hotspot = " << spot[myCart.myCurrentBank];
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ string CartridgeWDWidget::bankState()
|
|||
{
|
||||
ostringstream& buf = buffer();
|
||||
|
||||
static const char* segments[] = {
|
||||
static const char* const segments[] = {
|
||||
"[0,0,1,2]", "[0,1,3,2]", "[4,5,6,7]", "[7,4,3,2]",
|
||||
"[0,0,6,7]", "[0,1,7,6]", "[3,2,4,5]", "[6,0,5,1]",
|
||||
"[0,0,1,2]", "[0,1,3,2]", "[4,5,6,7]", "[7,4,3,2]",
|
||||
|
|
|
@ -117,8 +117,8 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n
|
|||
|
||||
// Set the strings to be used in the PSRegister
|
||||
// We only do this once because it's the state that changes, not the strings
|
||||
const char* offstr[] = { "n", "v", "-", "b", "d", "i", "z", "c" };
|
||||
const char* onstr[] = { "N", "V", "-", "B", "D", "I", "Z", "C" };
|
||||
const char* const offstr[] = { "n", "v", "-", "b", "d", "i", "z", "c" };
|
||||
const char* const onstr[] = { "N", "V", "-", "B", "D", "I", "Z", "C" };
|
||||
StringList off, on;
|
||||
for(int i = 0; i < 8; ++i)
|
||||
{
|
||||
|
|
|
@ -97,7 +97,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
CREATE_IO_REGS("SWCHB(R)", mySWCHBReadBits, 0, false);
|
||||
|
||||
// Timer registers (R/W)
|
||||
const char* writeNames[] = { "TIM1T", "TIM8T", "TIM64T", "T1024T" };
|
||||
const char* const writeNames[] = { "TIM1T", "TIM8T", "TIM64T", "T1024T" };
|
||||
xpos = 10; ypos += 2*lineHeight;
|
||||
for(int row = 0; row < 4; ++row)
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
addFocusWidget(myTimWrite);
|
||||
|
||||
// Timer registers (RO)
|
||||
const char* readNames[] = { "INTIM", "TIMINT", "Total Clks", "INTIM Clks" };
|
||||
const char* const readNames[] = { "INTIM", "TIMINT", "Total Clks", "INTIM Clks" };
|
||||
xpos = 10; ypos += myTimWrite->getHeight() + lineHeight;
|
||||
for(int row = 0; row < 4; ++row)
|
||||
{
|
||||
|
@ -133,7 +133,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
riot.controller(Controller::Right));
|
||||
|
||||
// TIA INPTx registers (R), left port
|
||||
const char* contLeftReadNames[] = { "INPT0", "INPT1", "INPT4" };
|
||||
const char* const contLeftReadNames[] = { "INPT0", "INPT1", "INPT4" };
|
||||
xpos = col; ypos += myLeftControl->getHeight() + 2 * lineHeight;
|
||||
for(int row = 0; row < 3; ++row)
|
||||
{
|
||||
|
@ -146,7 +146,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
myLeftINPT->setEditable(false);
|
||||
|
||||
// TIA INPTx registers (R), right port
|
||||
const char* contRightReadNames[] = { "INPT2", "INPT3", "INPT5" };
|
||||
const char* const contRightReadNames[] = { "INPT2", "INPT3", "INPT5" };
|
||||
xpos = col + myLeftControl->getWidth() + 15;
|
||||
for(int row = 0; row < 3; ++row)
|
||||
{
|
||||
|
@ -230,7 +230,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
new StaticTextWidget(boss, lfont, xpos, ypos+1,
|
||||
lwidth, fontHeight, "Randomize CPU ", kTextAlignLeft);
|
||||
xpos += lwidth + 10;
|
||||
const char* cpuregs[] = { "SP", "A", "X", "Y", "PS" };
|
||||
const char* const cpuregs[] = { "SP", "A", "X", "Y", "PS" };
|
||||
for(int i = 0; i < 5; ++i)
|
||||
{
|
||||
myRandomizeCPU[i] = new CheckboxWidget(boss, lfont, xpos, ypos+1,
|
||||
|
@ -340,7 +340,7 @@ void RiotWidget::loadConfig()
|
|||
myRandomizeRAM->setState(instance().settings().getBool("ramrandom"));
|
||||
|
||||
const string& cpurandom = instance().settings().getString("cpurandom");
|
||||
const char* cpuregs[] = { "S", "A", "X", "Y", "P" };
|
||||
const char* const cpuregs[] = { "S", "A", "X", "Y", "P" };
|
||||
for(int i = 0; i < 5; ++i)
|
||||
myRandomizeCPU[i]->setState(BSPF::containsIgnoreCase(cpurandom, cpuregs[i]));
|
||||
}
|
||||
|
@ -473,7 +473,7 @@ ControllerWidget* RiotWidget::addControlWidget(GuiObject* boss, const GUI::Font&
|
|||
void RiotWidget::handleRandomCPU()
|
||||
{
|
||||
string cpurandom;
|
||||
const char* cpuregs[] = { "S", "A", "X", "Y", "P" };
|
||||
const char* const cpuregs[] = { "S", "A", "X", "Y", "P" };
|
||||
for(int i = 0; i < 5; ++i)
|
||||
if(myRandomizeCPU[i]->getState())
|
||||
cpurandom += cpuregs[i];
|
||||
|
|
|
@ -46,7 +46,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
ButtonWidget* b = nullptr;
|
||||
|
||||
// Color registers
|
||||
const char* regNames[] = { "COLUP0", "COLUP1", "COLUPF", "COLUBK" };
|
||||
const char* const regNames[] = { "COLUP0", "COLUP1", "COLUPF", "COLUBK" };
|
||||
for(int row = 0; row < 4; ++row)
|
||||
{
|
||||
new StaticTextWidget(boss, lfont, xpos, ypos + row*lineHeight + 2,
|
||||
|
@ -85,7 +85,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
myFixedEnabled->setTarget(this);
|
||||
addFocusWidget(myFixedEnabled);
|
||||
|
||||
const char* dbgLabels[] = { "P0", "P1", "PF", "BK", "M0", "M1", "BL", "HM" };
|
||||
const char* const dbgLabels[] = { "P0", "P1", "PF", "BK", "M0", "M1", "BL", "HM" };
|
||||
for(uInt32 row = 0; row <= 3; ++row)
|
||||
{
|
||||
ypos += lineHeight;
|
||||
|
@ -115,8 +115,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
// Add all 15 collision bits (with labels)
|
||||
uInt32 cxclrY = 0;
|
||||
xpos -= 2*fontWidth + 5; ypos += lineHeight;
|
||||
const char* rowLabel[] = { "P0", "P1", "M0", "M1", "BL" };
|
||||
const char* colLabel[] = { "PF", "BL", "M1", "M0", "P1" };
|
||||
const char* const rowLabel[] = { "P0", "P1", "M0", "M1", "BL" };
|
||||
const char* const colLabel[] = { "PF", "BL", "M1", "M0", "P1" };
|
||||
uInt32 lwidth = 2*fontWidth, collX = xpos + lwidth + 5, collY = ypos, idx = 0;
|
||||
for(uInt32 row = 0; row < 5; ++row)
|
||||
{
|
||||
|
@ -534,7 +534,7 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
const GUI::Font& sf = instance().frameBuffer().smallFont();
|
||||
const int sfWidth = sf.getMaxCharWidth(),
|
||||
sfHeight = sf.getFontHeight();
|
||||
const char* bitNames[] = { "0", "1", "2", "3", "4", "5", "6", "7" };
|
||||
const char* const bitNames[] = { "0", "1", "2", "3", "4", "5", "6", "7" };
|
||||
|
||||
// PF0
|
||||
xpos = 10; ypos += lineHeight + sfHeight + 6;
|
||||
|
|
|
@ -358,7 +358,8 @@ class EventHandler
|
|||
/**
|
||||
Returns the human-readable name for a StellaKey.
|
||||
*/
|
||||
virtual const char* nameForKey(StellaKey key) const { return EmptyString.c_str(); }
|
||||
virtual const char* const nameForKey(StellaKey key) const
|
||||
{ return EmptyString.c_str(); }
|
||||
|
||||
/**
|
||||
Collects and dispatches any pending events.
|
||||
|
|
|
@ -165,7 +165,7 @@ cerr << "myTape = " << myTape << endl;
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void KidVid::openSampleFile()
|
||||
{
|
||||
static const char* kvNameTable[6] = {
|
||||
static const char* const kvNameTable[6] = {
|
||||
"kvs3.wav", "kvs1.wav", "kvs2.wav", "kvb3.wav", "kvb1.wav", "kvb2.wav"
|
||||
};
|
||||
static uInt32 StartSong[6] = {
|
||||
|
|
|
@ -35,7 +35,7 @@ struct BBX
|
|||
/* based on The Microwindows Project http://microwindows.org */
|
||||
struct FontDesc
|
||||
{
|
||||
const char* name; /* font name */
|
||||
const char* const name; /* font name */
|
||||
int maxwidth; /* max width in pixels */
|
||||
int height; /* height in pixels */
|
||||
int fbbw, fbbh, fbbx, fbby; /* max bounding box */
|
||||
|
|
|
@ -121,7 +121,7 @@ bool LauncherFilterDialog::isValidRomName(const string& name,
|
|||
string::size_type idx = name.find_last_of('.');
|
||||
if(idx != string::npos)
|
||||
{
|
||||
const char* ext = name.c_str() + idx + 1;
|
||||
const char* const ext = name.c_str() + idx + 1;
|
||||
|
||||
for(const auto& s: exts)
|
||||
if(BSPF::equalsIgnoreCase(ext, s))
|
||||
|
@ -138,7 +138,7 @@ bool LauncherFilterDialog::isValidRomName(const FilesystemNode& node, string& ex
|
|||
string::size_type idx = name.find_last_of('.');
|
||||
if(idx != string::npos)
|
||||
{
|
||||
const char* e = name.c_str() + idx + 1;
|
||||
const char* const e = name.c_str() + idx + 1;
|
||||
|
||||
for(uInt32 i = 0; i < 5; ++i)
|
||||
{
|
||||
|
@ -249,7 +249,7 @@ void LauncherFilterDialog::handleCommand(CommandSender* sender, int cmd,
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const char* LauncherFilterDialog::ourRomTypes[2][5] = {
|
||||
const char* const LauncherFilterDialog::ourRomTypes[2][5] = {
|
||||
{ ".a26", ".bin", ".rom", ".zip", ".gz" },
|
||||
{ "a26", "bin", "rom", "zip", "gz" }
|
||||
};
|
||||
|
|
|
@ -72,7 +72,7 @@ class LauncherFilterDialog : public Dialog, public CommandSender
|
|||
};
|
||||
|
||||
// Holds static strings representing ROM types
|
||||
static const char* ourRomTypes[2][5];
|
||||
static const char* const ourRomTypes[2][5];
|
||||
|
||||
private:
|
||||
// Following constructors and assignment operators not supported
|
||||
|
|
|
@ -88,7 +88,7 @@ void listDevices()
|
|||
int devlen = strlen(dp->d_name);
|
||||
if(devlen >= len)
|
||||
{
|
||||
const char* start = dp->d_name + devlen - len;
|
||||
const char* const start = dp->d_name + devlen - len;
|
||||
if(strncmp(start, "event-joystick", len) == 0)
|
||||
printf("%s%s\n", EVDEV_DIR, dp->d_name);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue