I decided to turn on '-Weverything' compiler flag in Clang++ to

see what errors are present in the code.  This is the first pass
in cleaning up the errors it found.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3203 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2015-09-13 23:23:12 +00:00
parent 5620c270bc
commit f539cef173
22 changed files with 116 additions and 116 deletions

View File

@ -58,7 +58,7 @@ class CheatManager
/**
Remove the cheat at 'idx' from the cheat list(s).
@param index Location in myCheatList of the cheat to remove
@param idx Location in myCheatList of the cheat to remove
*/
void remove(int idx);

View File

@ -60,13 +60,13 @@ class Variant
const string& toString() const { return data; }
const char* toCString() const { return data.c_str(); }
const Int32 toInt() const { return atoi(data.c_str()); }
const float toFloat() const { return atof(data.c_str()); }
const float toFloat() const { return float(atof(data.c_str())); }
const bool toBool() const { return data == "1" || data == "true"; }
const GUI::Size toSize() const { return GUI::Size(data); }
// Comparison
bool operator==(const Variant& v) const { return data == v.data; };
bool operator!=(const Variant& v) const { return data != v.data; };
bool operator==(const Variant& v) const { return data == v.data; }
bool operator!=(const Variant& v) const { return data != v.data; }
friend ostream& operator<<(ostream& os, const Variant& v) {
return os << v.data;
@ -85,7 +85,7 @@ namespace VarList {
{
list.emplace_back(name.toString(), tag);
}
};
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const VariantList EmptyVarList;

View File

@ -158,7 +158,7 @@ inline size_t BSPF_findIgnoreCase(const string& s1, const string& s2, int startp
{
auto pos = std::search(s1.begin()+startpos, s1.end(),
s2.begin(), s2.end(), [](char ch1, char ch2) {
return toupper((uInt8)ch1) == toupper((uInt8)ch2);
return toupper(uInt8(ch1)) == toupper(uInt8(ch2));
});
return pos == s1.end() ? string::npos : pos - (s1.begin()+startpos);
}

View File

@ -230,7 +230,7 @@ bool CartDebug::disassemble(bool force)
bool bankChanged = myConsole.cartridge().bankChanged();
uInt16 PC = myDebugger.cpuDebug().pc();
int pcline = addressToLine(PC);
bool pcfound = (pcline != -1) && ((uInt32)pcline < myDisassembly.list.size()) &&
bool pcfound = (pcline != -1) && (uInt32(pcline) < myDisassembly.list.size()) &&
(myDisassembly.list[pcline].disasm[0] != '.');
bool pagedirty = (PC & 0x1000) ? mySystem.isPageDirty(0x1000, 0x1FFF) :
mySystem.isPageDirty(0x80, 0xFF);
@ -339,7 +339,7 @@ string CartDebug::disassemble(uInt16 start, uInt16 lines) const
ostringstream buffer;
// First find the lines in the range, and determine the longest string
uInt32 list_size = (int)myDisassembly.list.size();
uInt32 list_size = uInt32(myDisassembly.list.size());
uInt32 begin = list_size, end = 0, length = 0;
for(end = 0; end < list_size && lines > 0; ++end)
{
@ -348,7 +348,7 @@ string CartDebug::disassemble(uInt16 start, uInt16 lines) const
{
if(begin == list_size) begin = end;
if(tag.type != CartDebug::ROW)
length = BSPF_max(length, (uInt32)tag.disasm.length());
length = BSPF_max(length, uInt32(tag.disasm.length()));
--lines;
}
@ -382,7 +382,7 @@ bool CartDebug::addDirective(CartDebug::DisasmType type,
return false;
if(bank < 0) // Do we want the current bank or ZP RAM?
bank = (myDebugger.cpuDebug().pc() & 0x1000) ? getBank() : (int)myBankInfo.size()-1;
bank = (myDebugger.cpuDebug().pc() & 0x1000) ? getBank() : int(myBankInfo.size())-1;
bank = BSPF_min(bank, bankCount());
BankInfo& info = myBankInfo[bank];
@ -516,7 +516,7 @@ bool CartDebug::addLabel(const string& label, uInt16 address)
removeLabel(label);
myUserAddresses.insert(make_pair(label, address));
myUserLabels.insert(make_pair(address, label));
myLabelLength = BSPF_max(myLabelLength, (uInt16)label.size());
myLabelLength = BSPF_max(myLabelLength, uInt16(label.size()));
mySystem.setDirtyPage(address);
return true;
}
@ -714,7 +714,7 @@ string CartDebug::loadListFile()
if(addr_s.length() == 0)
continue;
const char* p = addr_s[0] == 'U' ? addr_s.c_str() + 1 : addr_s.c_str();
addr = (int)strtoul(p, NULL, 16);
addr = int(strtoul(p, NULL, 16));
// For now, completely ignore ROM addresses
if(!(addr & 0x1000))
@ -1136,7 +1136,7 @@ string CartDebug::saveDisassembly()
<< ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n";
int max_len = 0;
for(const auto& iter: myUserLabels)
max_len = BSPF_max(max_len, (int)iter.second.size());
max_len = BSPF_max(max_len, int(iter.second.size()));
for(const auto& iter: myUserLabels)
out << ALIGN(max_len) << iter.second << " = $" << iter.first << "\n";
}

View File

@ -94,7 +94,7 @@ class Debugger : public DialogContainer
that don't have access to EventHandler.
@param message Message to display when entering debugger
@param data An address associated with the message
@param address An address associated with the message
*/
bool start(const string& message = "", int address = -1);
bool startWithFatalError(const string& message = "");
@ -164,7 +164,7 @@ class Debugger : public DialogContainer
/**
The current cycle count of the System.
*/
int cycles() const { return mySystem.cycles(); }
int cycles() const { return int(mySystem.cycles()); }
string autoExec();

View File

@ -546,7 +546,7 @@ string DebuggerParser::eval()
buf << "$" << Base::toString(args[i], Base::F_16_4)
<< " %" << Base::toString(args[i], Base::F_2_16);
buf << " #" << (int) args[i];
buf << " #" << int(args[i]);
if(i != argCount - 1)
buf << endl;
}

View File

@ -71,7 +71,7 @@ class DebuggerParser
private:
enum {
kNumCommands = 70,
kNumCommands = 70
};
// Constants for argument processing

View File

@ -257,14 +257,14 @@ void DiStella::disasm(uInt32 distart, int pass)
bool isPGfx = check_bit(myPC, CartDebug::PGFX);
const string& bit_string = isPGfx ? "\x1f" : "\x1e";
uInt8 byte = Debugger::debugger().peek(myPC+myOffset);
myDisasmBuf << ".byte $" << Base::HEX2 << (int)byte << " |";
myDisasmBuf << ".byte $" << Base::HEX2 << int(byte) << " |";
for(uInt8 i = 0, c = byte; i < 8; ++i, c <<= 1)
myDisasmBuf << ((c > 127) ? bit_string : " ");
myDisasmBuf << "| $" << Base::HEX4 << myPC+myOffset << "'";
if(mySettings.gfx_format == Base::F_2)
myDisasmBuf << Base::toString(byte, Base::F_2_8);
else
myDisasmBuf << Base::HEX2 << (int)byte;
myDisasmBuf << Base::HEX2 << int(byte);
addEntry(isPGfx ? CartDebug::PGFX : CartDebug::GFX);
}
myPC++;
@ -282,9 +282,9 @@ void DiStella::disasm(uInt32 distart, int pass)
myDisasmBuf << Base::HEX4 << myPC+myOffset << "' '";
uInt8 byte = Debugger::debugger().peek(myPC+myOffset);
myDisasmBuf << ".byte $" << Base::HEX2 << (int)byte << " $"
myDisasmBuf << ".byte $" << Base::HEX2 << int(byte) << " $"
<< Base::HEX4 << myPC+myOffset << "'"
<< Base::HEX2 << (int)byte;
<< Base::HEX2 << int(byte);
addEntry(CartDebug::DATA);
}
myPC++;
@ -311,14 +311,14 @@ void DiStella::disasm(uInt32 distart, int pass)
myDisasmBuf << Base::HEX4 << myPC+myOffset << "'L" << Base::HEX4
<< myPC+myOffset << "'.byte " << "$" << Base::HEX2
<< (int)Debugger::debugger().peek(myPC+myOffset);
<< int(Debugger::debugger().peek(myPC+myOffset));
myPC++;
bytes = 1;
line_empty = false;
}
else if(line_empty) // start a new line without a label
{
myDisasmBuf << " ' '.byte $" << Base::HEX2 << (int)Debugger::debugger().peek(myPC+myOffset);
myDisasmBuf << " ' '.byte $" << Base::HEX2 << int(Debugger::debugger().peek(myPC+myOffset));
myPC++;
bytes = 1;
line_empty = false;
@ -331,7 +331,7 @@ void DiStella::disasm(uInt32 distart, int pass)
}
else
{
myDisasmBuf << ",$" << Base::HEX2 << (int)Debugger::debugger().peek(myPC+myOffset);
myDisasmBuf << ",$" << Base::HEX2 << int(Debugger::debugger().peek(myPC+myOffset));
myPC++;
}
@ -375,7 +375,7 @@ void DiStella::disasm(uInt32 distart, int pass)
{
addr_mode = IMPLIED;
if (pass == 3)
nextline << ".byte $" << Base::HEX2 << (int)op << " ;";
nextline << ".byte $" << Base::HEX2 << int(op) << " ;";
}
if (pass == 1)
@ -398,7 +398,7 @@ void DiStella::disasm(uInt32 distart, int pass)
else if (pass == 3)
{
nextline << ourLookup[op].mnemonic;
nextlinebytes << Base::HEX2 << (int)op << " ";
nextlinebytes << Base::HEX2 << int(op) << " ";
}
// Add operand(s) for PC values outside the app data range
@ -419,9 +419,9 @@ void DiStella::disasm(uInt32 distart, int pass)
/* Line information is already printed; append .byte since last
instruction will put recompilable object larger that original
binary file */
myDisasmBuf << ".byte $" << Base::HEX2 << (int)op << " $"
myDisasmBuf << ".byte $" << Base::HEX2 << int(op) << " $"
<< Base::HEX4 << myPC+myOffset << "'"
<< Base::HEX2 << (int)op;
<< Base::HEX2 << int(op);
addEntry(CartDebug::DATA);
if (myPC == myAppData.end)
@ -432,9 +432,9 @@ void DiStella::disasm(uInt32 distart, int pass)
myDisasmBuf << Base::HEX4 << myPC+myOffset << "' '";
op = Debugger::debugger().peek(myPC+myOffset); myPC++;
myDisasmBuf << ".byte $" << Base::HEX2 << (int)op << " $"
myDisasmBuf << ".byte $" << Base::HEX2 << int(op) << " $"
<< Base::HEX4 << myPC+myOffset << "'"
<< Base::HEX2 << (int)op;
<< Base::HEX2 << int(op);
addEntry(CartDebug::DATA);
}
}
@ -454,7 +454,7 @@ void DiStella::disasm(uInt32 distart, int pass)
{
/* Line information is already printed, but we can remove the
Instruction (i.e. BMI) by simply clearing the buffer to print */
myDisasmBuf << ".byte $" << Base::HEX2 << (int)op;
myDisasmBuf << ".byte $" << Base::HEX2 << int(op);
addEntry(CartDebug::ROW);
nextline.str("");
nextlinebytes.str("");
@ -522,7 +522,7 @@ void DiStella::disasm(uInt32 distart, int pass)
if (labfound == 1)
{
LABEL_A12_HIGH(ad);
nextlinebytes << Base::HEX2 << (int)(ad&0xff) << " " << Base::HEX2 << (int)(ad>>8);
nextlinebytes << Base::HEX2 << int(ad&0xff) << " " << Base::HEX2 << int(ad>>8);
}
else if (labfound == 4)
{
@ -530,18 +530,18 @@ void DiStella::disasm(uInt32 distart, int pass)
{
int tmp = (ad & myAppData.end)+myOffset;
LABEL_A12_HIGH(tmp);
nextlinebytes << Base::HEX2 << (int)(tmp&0xff) << " " << Base::HEX2 << (int)(tmp>>8);
nextlinebytes << Base::HEX2 << int(tmp&0xff) << " " << Base::HEX2 << int(tmp>>8);
}
else
{
nextline << "$" << Base::HEX4 << ad;
nextlinebytes << Base::HEX2 << (int)(ad&0xff) << " " << Base::HEX2 << (int)(ad>>8);
nextlinebytes << Base::HEX2 << int(ad&0xff) << " " << Base::HEX2 << int(ad>>8);
}
}
else
{
LABEL_A12_LOW(ad);
nextlinebytes << Base::HEX2 << (int)(ad&0xff) << " " << Base::HEX2 << (int)(ad>>8);
nextlinebytes << Base::HEX2 << int(ad&0xff) << " " << Base::HEX2 << int(ad>>8);
}
}
break;
@ -554,8 +554,8 @@ void DiStella::disasm(uInt32 distart, int pass)
if (pass == 3)
{
nextline << " ";
LABEL_A12_LOW((int)d1);
nextlinebytes << Base::HEX2 << (int)d1;
LABEL_A12_LOW(int(d1));
nextlinebytes << Base::HEX2 << int(d1);
}
break;
}
@ -565,8 +565,8 @@ void DiStella::disasm(uInt32 distart, int pass)
d1 = Debugger::debugger().peek(myPC+myOffset); myPC++;
if (pass == 3)
{
nextline << " #$" << Base::HEX2 << (int)d1 << " ";
nextlinebytes << Base::HEX2 << (int)d1;
nextline << " #$" << Base::HEX2 << int(d1) << " ";
nextlinebytes << Base::HEX2 << int(d1);
}
break;
}
@ -594,7 +594,7 @@ void DiStella::disasm(uInt32 distart, int pass)
{
LABEL_A12_HIGH(ad);
nextline << ",X";
nextlinebytes << Base::HEX2 << (int)(ad&0xff) << " " << Base::HEX2 << (int)(ad>>8);
nextlinebytes << Base::HEX2 << int(ad&0xff) << " " << Base::HEX2 << int(ad>>8);
}
else if (labfound == 4)
{
@ -603,19 +603,19 @@ void DiStella::disasm(uInt32 distart, int pass)
int tmp = (ad & myAppData.end)+myOffset;
LABEL_A12_HIGH(tmp);
nextline << ",X";
nextlinebytes << Base::HEX2 << (int)(tmp&0xff) << " " << Base::HEX2 << (int)(tmp>>8);
nextlinebytes << Base::HEX2 << int(tmp&0xff) << " " << Base::HEX2 << int(tmp>>8);
}
else
{
nextline << "$" << Base::HEX4 << ad << ",X";
nextlinebytes << Base::HEX2 << (int)(ad&0xff) << " " << Base::HEX2 << (int)(ad>>8);
nextlinebytes << Base::HEX2 << int(ad&0xff) << " " << Base::HEX2 << int(ad>>8);
}
}
else
{
LABEL_A12_LOW(ad);
nextline << ",X";
nextlinebytes << Base::HEX2 << (int)(ad&0xff) << " " << Base::HEX2 << (int)(ad>>8);
nextlinebytes << Base::HEX2 << int(ad&0xff) << " " << Base::HEX2 << int(ad>>8);
}
}
break;
@ -644,7 +644,7 @@ void DiStella::disasm(uInt32 distart, int pass)
{
LABEL_A12_HIGH(ad);
nextline << ",Y";
nextlinebytes << Base::HEX2 << (int)(ad&0xff) << " " << Base::HEX2 << (int)(ad>>8);
nextlinebytes << Base::HEX2 << int(ad&0xff) << " " << Base::HEX2 << int(ad>>8);
}
else if (labfound == 4)
{
@ -653,19 +653,19 @@ void DiStella::disasm(uInt32 distart, int pass)
int tmp = (ad & myAppData.end)+myOffset;
LABEL_A12_HIGH(tmp);
nextline << ",Y";
nextlinebytes << Base::HEX2 << (int)(tmp&0xff) << " " << Base::HEX2 << (int)(tmp>>8);
nextlinebytes << Base::HEX2 << int(tmp&0xff) << " " << Base::HEX2 << int(tmp>>8);
}
else
{
nextline << "$" << Base::HEX4 << ad << ",Y";
nextlinebytes << Base::HEX2 << (int)(ad&0xff) << " " << Base::HEX2 << (int)(ad>>8);
nextlinebytes << Base::HEX2 << int(ad&0xff) << " " << Base::HEX2 << int(ad>>8);
}
}
else
{
LABEL_A12_LOW(ad);
nextline << ",Y";
nextlinebytes << Base::HEX2 << (int)(ad&0xff) << " " << Base::HEX2 << (int)(ad>>8);
nextlinebytes << Base::HEX2 << int(ad&0xff) << " " << Base::HEX2 << int(ad>>8);
}
}
break;
@ -680,7 +680,7 @@ void DiStella::disasm(uInt32 distart, int pass)
nextline << " (";
LABEL_A12_LOW(d1);
nextline << ",X)";
nextlinebytes << Base::HEX2 << (int)d1;
nextlinebytes << Base::HEX2 << int(d1);
}
break;
}
@ -694,7 +694,7 @@ void DiStella::disasm(uInt32 distart, int pass)
nextline << " (";
LABEL_A12_LOW(d1);
nextline << "),Y";
nextlinebytes << Base::HEX2 << (int)d1;
nextlinebytes << Base::HEX2 << int(d1);
}
break;
}
@ -709,7 +709,7 @@ void DiStella::disasm(uInt32 distart, int pass)
LABEL_A12_LOW(d1);
nextline << ",X";
}
nextlinebytes << Base::HEX2 << (int)d1;
nextlinebytes << Base::HEX2 << int(d1);
break;
}
@ -723,7 +723,7 @@ void DiStella::disasm(uInt32 distart, int pass)
LABEL_A12_LOW(d1);
nextline << ",Y";
}
nextlinebytes << Base::HEX2 << (int)d1;
nextlinebytes << Base::HEX2 << int(d1);
break;
}
@ -754,7 +754,7 @@ void DiStella::disasm(uInt32 distart, int pass)
else
nextline << " $" << Base::HEX4 << ad;
nextlinebytes << Base::HEX2 << (int)d1;
nextlinebytes << Base::HEX2 << int(d1);
}
break;
}
@ -792,7 +792,7 @@ void DiStella::disasm(uInt32 distart, int pass)
nextline << ")";
}
nextlinebytes << Base::HEX2 << (int)(ad&0xff) << " " << Base::HEX2 << (int)(ad>>8);
nextlinebytes << Base::HEX2 << int(ad&0xff) << " " << Base::HEX2 << int(ad>>8);
break;
}
@ -816,7 +816,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 << "'"
<< ";" << dec << int(ourLookup[op].cycles) << "'"
<< nextlinebytes.str();
addEntry(CartDebug::CODE);
if (op == 0x40 || op == 0x60)

View File

@ -189,7 +189,7 @@ void TIADebug::saveOldState()
bool TIADebug::vdelP0(int newVal)
{
if(newVal > -1)
mySystem.poke(VDELP0, ((bool)newVal));
mySystem.poke(VDELP0, bool(newVal));
return myTIA.myVDELP0;
}
@ -198,7 +198,7 @@ bool TIADebug::vdelP0(int newVal)
bool TIADebug::vdelP1(int newVal)
{
if(newVal > -1)
mySystem.poke(VDELP1, ((bool)newVal));
mySystem.poke(VDELP1, bool(newVal));
return myTIA.myVDELP1;
}
@ -207,7 +207,7 @@ bool TIADebug::vdelP1(int newVal)
bool TIADebug::vdelBL(int newVal)
{
if(newVal > -1)
mySystem.poke(VDELBL, ((bool)newVal));
mySystem.poke(VDELBL, bool(newVal));
return myTIA.myVDELBL;
}
@ -216,7 +216,7 @@ bool TIADebug::vdelBL(int newVal)
bool TIADebug::enaM0(int newVal)
{
if(newVal > -1)
mySystem.poke(ENAM0, ((bool)newVal) << 1);
mySystem.poke(ENAM0, bool(newVal) << 1);
return myTIA.myENAM0;
}
@ -225,7 +225,7 @@ bool TIADebug::enaM0(int newVal)
bool TIADebug::enaM1(int newVal)
{
if(newVal > -1)
mySystem.poke(ENAM1, ((bool)newVal) << 1);
mySystem.poke(ENAM1, bool(newVal) << 1);
return myTIA.myENAM1;
}
@ -234,7 +234,7 @@ bool TIADebug::enaM1(int newVal)
bool TIADebug::enaBL(int newVal)
{
if(newVal > -1)
mySystem.poke(ENABL, ((bool)newVal) << 1);
mySystem.poke(ENABL, bool(newVal) << 1);
return myTIA.myENABL;
}
@ -243,7 +243,7 @@ bool TIADebug::enaBL(int newVal)
bool TIADebug::resMP0(int newVal)
{
if(newVal > -1)
mySystem.poke(RESMP0, ((bool)newVal) << 1);
mySystem.poke(RESMP0, bool(newVal) << 1);
return myTIA.myRESMP0;
}
@ -252,7 +252,7 @@ bool TIADebug::resMP0(int newVal)
bool TIADebug::resMP1(int newVal)
{
if(newVal > -1)
mySystem.poke(RESMP1, ((bool)newVal) << 1);
mySystem.poke(RESMP1, bool(newVal) << 1);
return myTIA.myRESMP1;
}
@ -261,7 +261,7 @@ bool TIADebug::resMP1(int newVal)
bool TIADebug::refP0(int newVal)
{
if(newVal > -1)
mySystem.poke(REFP0, ((bool)newVal) << 3);
mySystem.poke(REFP0, bool(newVal) << 3);
return myTIA.myREFP0;
}
@ -270,7 +270,7 @@ bool TIADebug::refP0(int newVal)
bool TIADebug::refP1(int newVal)
{
if(newVal > -1)
mySystem.poke(REFP1, ((bool)newVal) << 3);
mySystem.poke(REFP1, bool(newVal) << 3);
return myTIA.myREFP1;
}
@ -741,7 +741,7 @@ string TIADebug::toString()
buf << "00: ";
for (uInt8 j = 0; j < 0x010; j++)
{
buf << Common::Base::HEX2 << (int)mySystem.peek(j) << " ";
buf << Common::Base::HEX2 << int(mySystem.peek(j)) << " ";
if(j == 0x07) buf << "- ";
}
buf << endl;
@ -837,15 +837,15 @@ string TIADebug::toString()
<< endl << " "
<< booleanWithLabel("m0_m1 ", collM0_M1())
<< endl
<< "AUDF0: $" << Common::Base::HEX2 << (int)myTIA.myAUDF0
<< "AUDF0: $" << Common::Base::HEX2 << int(myTIA.myAUDF0)
<< "/" << audFreq(myTIA.myAUDF0) << " "
<< "AUDC0: $" << Common::Base::HEX2 << (int)myTIA.myAUDC0 << " "
<< "AUDV0: $" << Common::Base::HEX2 << (int)myTIA.myAUDV0
<< "AUDC0: $" << Common::Base::HEX2 << int(myTIA.myAUDC0) << " "
<< "AUDV0: $" << Common::Base::HEX2 << int(myTIA.myAUDV0)
<< endl
<< "AUDF1: $" << Common::Base::HEX2 << (int)myTIA.myAUDF1
<< "AUDF1: $" << Common::Base::HEX2 << int(myTIA.myAUDF1)
<< "/" << audFreq(myTIA.myAUDF1) << " "
<< "AUDC1: $" << Common::Base::HEX2 << (int)myTIA.myAUDC1 << " "
<< "AUDV1: $" << Common::Base::HEX2 << (int)myTIA.myAUDV1
<< "AUDC1: $" << Common::Base::HEX2 << int(myTIA.myAUDC1) << " "
<< "AUDV1: $" << Common::Base::HEX2 << int(myTIA.myAUDV1)
;
// note: last line should not contain \n, caller will add.
return buf.str();

View File

@ -48,7 +48,7 @@ class CartDebugWidget : public Widget, public CommandSender
myButtonHeight(myLineHeight + 4),
myDesc(nullptr) { }
virtual ~CartDebugWidget() { };
virtual ~CartDebugWidget() { }
public:
int addBaseInformation(int bytes, const string& manufacturer,
@ -82,7 +82,7 @@ class CartDebugWidget : public Widget, public CommandSender
StringParser bs(desc, (fwidth - kScrollBarWidth) / myFontWidth - 4);
const StringList& sl = bs.stringList();
uInt32 lines = (uInt32)sl.size();
uInt32 lines = uInt32(sl.size());
if(lines < 3) lines = 3;
if(lines > maxlines) lines = maxlines;
@ -109,7 +109,7 @@ class CartDebugWidget : public Widget, public CommandSender
virtual void saveOldState() { }
virtual void loadConfig() override { myDesc->setSelected(0); }
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id) override { };
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id) override { }
// Query internal state of the cart (usually just bankswitching info)
virtual string bankState() { return "0 (non-bankswitched)"; }
@ -121,8 +121,8 @@ class CartDebugWidget : public Widget, public CommandSender
virtual string internalRamDescription() { return EmptyString; }
virtual const ByteArray& internalRamOld(int start, int count) { return myRamOld; }
virtual const ByteArray& internalRamCurrent(int start, int count) { return myRamCurrent; }
virtual void internalRamSetValue(int addr, uInt8 value) { };
virtual uInt8 internalRamGetValue(int addr) { return 0; };
virtual void internalRamSetValue(int addr, uInt8 value) { }
virtual uInt8 internalRamGetValue(int addr) { return 0; }
virtual string internalRamLabel(int addr) { return "Not available/applicable"; }
protected:

View File

@ -154,7 +154,7 @@ class Console : public Serializable
/**
Set the properties to those given
@param The properties to use for the current game
@param props The properties to use for the current game
*/
void setProperties(const Properties& props);

View File

@ -155,7 +155,7 @@ class Controller : public Serializable
@param pin The pin of the controller jack to write to
@param value The value to write to the pin
*/
virtual void write(DigitalPin pin, bool value) { };
virtual void write(DigitalPin pin, bool value) { }
/**
Called after *all* digital pins have been written on Port A.
@ -163,7 +163,7 @@ class Controller : public Serializable
@param value The entire contents of the SWCHA register
*/
virtual void controlWrite(uInt8 value) { };
virtual void controlWrite(uInt8 value) { }
/**
Update the entire digital and analog pin state according to the
@ -176,7 +176,7 @@ class Controller : public Serializable
system resets its cycle counter to zero. It may be necessary
to override this method for controllers that remember cycle counts.
*/
virtual void systemCyclesReset() { };
virtual void systemCyclesReset() { }
/**
Determines how this controller will treat values received from the

View File

@ -282,7 +282,7 @@ class EventHandler
@param event The event we are remapping
@param mode The mode where this event is active
@param stick The joystick number
@param axis The joystick hat
@param hat The joystick hat
@param value The value on the given hat
@param updateMenus Whether to update the action mappings (normally
we want to do this, unless there are a batch of

View File

@ -57,8 +57,6 @@ class FBSurface
public:
/**
Creates a new FBSurface object
@param data If non-null, the data values to use as a static surface
*/
FBSurface();
@ -155,9 +153,10 @@ class FBSurface
data into a FrameBuffer surface. The pixels must already be in the
format used by the surface.
@param data The data in uInt8 R/G/B format
@param row The row of the surface the data should be placed in
@param rowbytes The number of bytes in row of 'data'
@param data The data in uInt8 R/G/B format
@param x The destination x-location to start drawing pixels
@param y The destination y-location to start drawing pixels
@param numpixels The number of pixels to draw
*/
virtual void drawPixels(uInt32* data, uInt32 x, uInt32 y, uInt32 numpixels);
@ -193,14 +192,13 @@ class FBSurface
This method should be called to draw the specified string.
@param font The font to draw the string with
@param str The string to draw
@param s The string to draw
@param x The x coordinate
@param y The y coordinate
@param w The width of the string area
@param h The height of the string area
@param color The color of the text
@param align The alignment of the text in the string width area
@param deltax
@param deltax FIXME
@param useEllipsis Whether to use '...' when the string is too long
*/
virtual void drawString(

View File

@ -42,7 +42,7 @@ enum FBInitStatus {
kSuccess,
kFailComplete,
kFailTooLarge,
kFailNotSupported,
kFailNotSupported
};
// Positions for onscreen/overlaid messages
@ -287,7 +287,7 @@ class FrameBuffer
/**
Set up the TIA/emulation palette for a screen of any depth > 8.
@param palette The array of colors in R/G/B format
@param raw_palette The array of colors in R/G/B format
*/
void setPalette(const uInt32* raw_palette);
@ -434,8 +434,8 @@ class FrameBuffer
Returns an appropriate video mode based on the current eventhandler
state, taking into account the maximum size of the window.
@param full Whether to use a windowed or fullscreen mode
@return A valid VideoMode for this framebuffer
@param fullscreen Whether to use a windowed or fullscreen mode
@return A valid VideoMode for this framebuffer
*/
const VideoMode& getSavedVidMode(bool fullscreen);

View File

@ -342,7 +342,7 @@ class M6502 : public Serializable
return i;
return -1; // no break hit
};
}
/// Pointer to the debugger for this processor or the null pointer
Debugger* myDebugger;

View File

@ -99,14 +99,16 @@ class Properties
/**
Load properties from the specified input stream
@param in The input stream to use
@param is The input stream to use
@param p The Properties object to write to
*/
friend istream& operator>>(istream& is, Properties& p);
/**
Save properties to the specified output stream
@param out The output stream to use
@param os The output stream to use
@param p The Properties object to read from
*/
friend ostream& operator<<(ostream& os, const Properties& p);

View File

@ -47,7 +47,7 @@ class Random
*/
void initSeed()
{
myValue = (uInt32) myOSystem.getTicks();
myValue = uInt32(myOSystem.getTicks());
}
/**

View File

@ -83,7 +83,7 @@ class Dialog : public GuiObject
void addSurface(shared_ptr<FBSurface> surface);
protected:
virtual void draw() override { };
virtual void draw() override { }
void releaseFocus() override;
virtual void handleText(char text);

View File

@ -120,7 +120,7 @@ class DialogContainer
Handle a joystick hat event.
@param stick The joystick number
@param axis The joystick hat
@param hat The joystick hat
@param value Value associated with given hat
*/
void handleJoyHatEvent(int stick, int hat, JoyHat value);

View File

@ -37,9 +37,9 @@ struct Point
int x; //!< The horizontal part of the point
int y; //!< The vertical part of the point
Point() : x(0), y(0) { };
Point(const Point& p) : x(p.x), y(p.y) { };
explicit Point(int x1, int y1) : x(x1), y(y1) { };
Point() : x(0), y(0) { }
Point(const Point& p) : x(p.x), y(p.y) { }
explicit Point(int x1, int y1) : x(x1), y(y1) { }
Point(const string& p) {
char c = '\0';
x = y = -1;
@ -48,9 +48,9 @@ struct Point
if(c != 'x')
x = y = 0;
}
Point& operator=(const Point & p) { x = p.x; y = p.y; return *this; };
bool operator==(const Point & p) const { return x == p.x && y == p.y; };
bool operator!=(const Point & p) const { return x != p.x || y != p.y; };
Point& operator=(const Point & p) { x = p.x; y = p.y; return *this; }
bool operator==(const Point & p) const { return x == p.x && y == p.y; }
bool operator!=(const Point & p) const { return x != p.x || y != p.y; }
friend ostream& operator<<(ostream& os, const Point& p) {
os << p.x << "x" << p.y;
@ -63,9 +63,9 @@ struct Size
uInt32 w; //!< The width part of the size
uInt32 h; //!< The height part of the size
Size() : w(0), h(0) { };
Size(const Size& s) : w(s.w), h(s.h) { };
explicit Size(uInt32 w1, uInt32 h1) : w(w1), h(h1) { };
Size() : w(0), h(0) { }
Size(const Size& s) : w(s.w), h(s.h) { }
explicit Size(uInt32 w1, uInt32 h1) : w(w1), h(h1) { }
Size(const string& s) {
char c = '\0';
w = h = 0;
@ -76,13 +76,13 @@ struct Size
}
bool valid() const { return w > 0 && h > 0; }
Size& operator=(const Size& s) { w = s.w; h = s.h; return *this; };
bool operator==(const Size& s) const { return w == s.w && h == s.h; };
bool operator!=(const Size& s) const { return w != s.w || h != s.h; };
bool operator<(const Size& s) const { return w < s.w && h < s.h; };
bool operator<=(const Size& s) const { return w <= s.w && h <= s.h; };
bool operator>(const Size& s) const { return w > s.w && h > s.h; };
bool operator>=(const Size& s) const { return w >= s.w && h >= s.h; };
Size& operator=(const Size& s) { w = s.w; h = s.h; return *this; }
bool operator==(const Size& s) const { return w == s.w && h == s.h; }
bool operator!=(const Size& s) const { return w != s.w || h != s.h; }
bool operator<(const Size& s) const { return w < s.w && h < s.h; }
bool operator<=(const Size& s) const { return w <= s.w && h <= s.h; }
bool operator>(const Size& s) const { return w > s.w && h > s.h; }
bool operator>=(const Size& s) const { return w >= s.w && h >= s.h; }
friend ostream& operator<<(ostream& os, const Size& s) {
os << s.w << "x" << s.h;

View File

@ -88,7 +88,7 @@ class Widget : public GuiObject
void addFocusWidget(Widget* w) override { _focusList.push_back(w); }
void addToFocusList(WidgetArray& list) override {
Vec::append(_focusList, list);
};
}
/** Set/clear WIDGET_ENABLED flag */
void setEnabled(bool e);