Final batch of fixes from cppcheck.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3024 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-10-27 14:41:46 +00:00
parent bb7f5e0c5c
commit 27e005d7a5
44 changed files with 101 additions and 97 deletions

View File

@ -47,10 +47,10 @@ CheatManager::~CheatManager()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const Cheat* CheatManager::add(const string& name, const string& code, Cheat* CheatManager::add(const string& name, const string& code,
bool enable, int idx) bool enable, int idx)
{ {
Cheat* cheat = (Cheat*) createCheat(name, code); Cheat* cheat = createCheat(name, code);
if(!cheat) if(!cheat)
return NULL; return NULL;
@ -139,7 +139,7 @@ void CheatManager::addOneShot(const string& name, const string& code)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const Cheat* CheatManager::createCheat(const string& name, const string& code) Cheat* CheatManager::createCheat(const string& name, const string& code) const
{ {
if(!isValidCode(code)) if(!isValidCode(code))
return NULL; return NULL;
@ -360,7 +360,7 @@ void CheatManager::clear()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CheatManager::isValidCode(const string& code) bool CheatManager::isValidCode(const string& code) const
{ {
for(unsigned int i = 0; i < code.size(); i++) for(unsigned int i = 0; i < code.size(); i++)
if(!isxdigit(code[i])) if(!isxdigit(code[i]))

View File

@ -55,7 +55,7 @@ class CheatManager
@return The cheat (if was created), else NULL. @return The cheat (if was created), else NULL.
*/ */
const Cheat* add(const string& name, const string& code, Cheat* add(const string& name, const string& code,
bool enable = true, int idx = -1); bool enable = true, int idx = -1);
/** /**
@ -126,7 +126,7 @@ class CheatManager
/** /**
Checks if a code is valid. Checks if a code is valid.
*/ */
bool isValidCode(const string& code); bool isValidCode(const string& code) const;
private: private:
/** /**
@ -137,7 +137,7 @@ class CheatManager
@return The cheat (if was created), else NULL. @return The cheat (if was created), else NULL.
*/ */
const Cheat* createCheat(const string& name, const string& code); Cheat* createCheat(const string& name, const string& code) const;
/** /**
Parses a list of cheats and adds/enables each one. Parses a list of cheats and adds/enables each one.

View File

@ -24,22 +24,19 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilesystemNodeZIP::FilesystemNodeZIP() FilesystemNodeZIP::FilesystemNodeZIP()
: _error(ZIPERR_NOT_A_FILE),
_numFiles(0)
{ {
// We need a name, else the node is invalid // We need a name, else the node is invalid
_path = _shortPath = _virtualFile = "";
_error = ZIPERR_NOT_A_FILE;
_numFiles = 0;
AbstractFSNode* tmp = 0; AbstractFSNode* tmp = 0;
_realNode = Common::SharedPtr<AbstractFSNode>(tmp); _realNode = Common::SharedPtr<AbstractFSNode>(tmp);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilesystemNodeZIP::FilesystemNodeZIP(const string& p) FilesystemNodeZIP::FilesystemNodeZIP(const string& p)
: _error(ZIPERR_NONE),
_numFiles(0)
{ {
_path = _shortPath = _virtualFile = "";
_error = ZIPERR_NOT_A_FILE;
// Extract ZIP file and virtual file (if specified) // Extract ZIP file and virtual file (if specified)
size_t pos = BSPF_findIgnoreCase(p, ".zip"); size_t pos = BSPF_findIgnoreCase(p, ".zip");
if(pos == string::npos) if(pos == string::npos)

View File

@ -291,7 +291,7 @@ void FrameBufferSDL2::setWindowIcon()
uInt32 rgba[256], icon[32 * 32]; uInt32 rgba[256], icon[32 * 32];
uInt8 mask[32][4]; uInt8 mask[32][4];
sscanf(stella_icon[0], "%u %u %u %u", &w, &h, &ncols, &nbytes); sscanf(stella_icon[0], "%2u %2u %2u %2u", &w, &h, &ncols, &nbytes);
if((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1)) if((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1))
{ {
myOSystem.logMessage("ERROR: Couldn't load the application icon.", 0); myOSystem.logMessage("ERROR: Couldn't load the application icon.", 0);

View File

@ -194,7 +194,7 @@ class CartDebug : public DebuggerSystem
/** /**
Get the name/type of the cartridge. Get the name/type of the cartridge.
*/ */
string getCartType() const; string getCartType() const; // FIXME - dead code
/** /**
Add a label and associated address. Add a label and associated address.

View File

@ -121,7 +121,7 @@ class Debugger : public DialogContainer
bool delFunction(const string& name); bool delFunction(const string& name);
const Expression* getFunction(const string& name) const; const Expression* getFunction(const string& name) const;
const string& getFunctionDef(const string& name) const; const string& getFunctionDef(const string& name) const; // FIXME - dead code
const FunctionDefMap getFunctionDefMap() const; const FunctionDefMap getFunctionDefMap() const;
string builtinHelp() const; string builtinHelp() const;

View File

@ -56,7 +56,8 @@ using namespace Common;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DebuggerParser::DebuggerParser(Debugger& d, Settings& s) DebuggerParser::DebuggerParser(Debugger& d, Settings& s)
: debugger(d), : debugger(d),
settings(s) settings(s),
argCount(0)
{ {
} }

View File

@ -45,7 +45,8 @@ class CartDebugWidget : public Widget, public CommandSender
myFontWidth(lfont.getMaxCharWidth()), myFontWidth(lfont.getMaxCharWidth()),
myFontHeight(lfont.getFontHeight()), myFontHeight(lfont.getFontHeight()),
myLineHeight(lfont.getLineHeight()), myLineHeight(lfont.getLineHeight()),
myButtonHeight(myLineHeight + 4) { } myButtonHeight(myLineHeight + 4),
myDesc(NULL) { }
virtual ~CartDebugWidget() { }; virtual ~CartDebugWidget() { };

View File

@ -647,10 +647,13 @@ void PromptWidget::addToHistory(const char *str)
_historySize++; _historySize++;
} }
#if 0 // FIXME
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int PromptWidget::compareHistory(const char *histLine) { int PromptWidget::compareHistory(const char *histLine)
{
return 1; return 1;
} }
#endif
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PromptWidget::historyScroll(int direction) void PromptWidget::historyScroll(int direction)

View File

@ -119,7 +119,7 @@ class PromptWidget : public Widget, public CommandSender
bool _firstTime; bool _firstTime;
bool _exitedEarly; bool _exitedEarly;
int compareHistory(const char *histLine); // int compareHistory(const char *histLine);
}; };
#endif #endif

View File

@ -29,7 +29,8 @@ RomListSettings::RomListSettings(GuiObject* boss, const GUI::Font& font)
: Dialog(boss->instance(), boss->parent(), 0, 0, 16, 16), : Dialog(boss->instance(), boss->parent(), 0, 0, 16, 16),
CommandSender(boss), CommandSender(boss),
_xorig(0), _xorig(0),
_yorig(0) _yorig(0),
_item(0)
{ {
const int buttonWidth = font.getStringWidth("RunTo PC @ current line") + 20, const int buttonWidth = font.getStringWidth("RunTo PC @ current line") + 20,
buttonHeight = font.getLineHeight() + 4; buttonHeight = font.getLineHeight() + 4;

View File

@ -77,7 +77,7 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont,
_rows = h / _fontHeight; _rows = h / _fontHeight;
// Create a CheckboxWidget for each row in the list // Create a CheckboxWidget for each row in the list
CheckboxWidget* t; CheckboxWidget* t = NULL;
for(int i = 0; i < _rows; ++i) for(int i = 0; i < _rows; ++i)
{ {
t = new CheckboxWidget(boss, lfont, _x + 2, ypos, "", kCheckActionCmd); t = new CheckboxWidget(boss, lfont, _x + 2, ypos, "", kCheckActionCmd);

View File

@ -39,12 +39,11 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont,
x += 5; x += 5;
const int lineHeight = lfont.getLineHeight(); const int lineHeight = lfont.getLineHeight();
int xpos = x, ypos = y; int xpos = x, ypos = y + 10;
int lwidth = lfont.getStringWidth(longstr ? "Frame Cycle:" : "F. Cycle:"); int lwidth = lfont.getStringWidth(longstr ? "Frame Cycle:" : "F. Cycle:");
int fwidth = 5 * lfont.getMaxCharWidth() + 4; int fwidth = 5 * lfont.getMaxCharWidth() + 4;
// Add frame info // Add frame info
xpos = x; ypos = y + 10;
new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight, new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight,
longstr ? "Frame Count:" : "Frame:", longstr ? "Frame Count:" : "Frame:",
kTextAlignLeft); kTextAlignLeft);

View File

@ -39,7 +39,9 @@ TiaOutputWidget::TiaOutputWidget(GuiObject* boss, const GUI::Font& font,
: Widget(boss, font, x, y, w, h), : Widget(boss, font, x, y, w, h),
CommandSender(boss), CommandSender(boss),
myMenu(NULL), myMenu(NULL),
myZoom(NULL) myZoom(NULL),
myClickX(0),
myClickY(0)
{ {
// Create context menu for commands // Create context menu for commands
VariantList l; VariantList l;

View File

@ -29,7 +29,8 @@ TogglePixelWidget::TogglePixelWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int cols, int rows) int x, int y, int cols, int rows)
: ToggleWidget(boss, font, x, y, cols, rows), : ToggleWidget(boss, font, x, y, cols, rows),
_pixelColor(0), _pixelColor(0),
_backgroundColor(kDlgColor) _backgroundColor(kDlgColor),
_swapBits(false)
{ {
_rowHeight = _colWidth = font.getLineHeight(); _rowHeight = _colWidth = font.getLineHeight();

View File

@ -30,6 +30,8 @@ ToggleWidget::ToggleWidget(GuiObject* boss, const GUI::Font& font,
_cols(cols), _cols(cols),
_currentRow(0), _currentRow(0),
_currentCol(0), _currentCol(0),
_rowHeight(0),
_colWidth(0),
_selectedItem(0), _selectedItem(0),
_editable(true) _editable(true)
{ {

View File

@ -61,8 +61,8 @@ class ToggleWidget : public Widget, public CommandSender
int _cols; int _cols;
int _currentRow; int _currentRow;
int _currentCol; int _currentCol;
int _rowHeight; int _rowHeight; // explicitly set in child classes
int _colWidth; int _colWidth; // explicitly set in child classes
int _selectedItem; int _selectedItem;
bool _editable; bool _editable;

View File

@ -63,8 +63,8 @@ class CompuMate
/** /**
Return the left and right CompuMate controllers Return the left and right CompuMate controllers
*/ */
Controller* leftController() { return myLeftController; } Controller* leftController() const { return myLeftController; }
Controller* rightController() { return myRightController; } Controller* rightController() const { return myRightController; }
/** /**
In normal key-handling mode, the update handler receives key events In normal key-handling mode, the update handler receives key events

View File

@ -1147,20 +1147,3 @@ uInt32 Console::ourUserPALPalette[256] = { 0 }; // filled from external file
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Console::ourUserSECAMPalette[256] = { 0 }; // filled from external file uInt32 Console::ourUserSECAMPalette[256] = { 0 }; // filled from external file
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Console::Console(const Console& console)
: myOSystem(console.myOSystem),
myCart(console.myCart),
myEvent(console.myEvent)
{
assert(false);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Console& Console::operator = (const Console&)
{
assert(false);
return *this;
}

View File

@ -70,13 +70,6 @@ class Console : public Serializable
*/ */
Console(OSystem& osystem, Cartridge& cart, const Properties& props); Console(OSystem& osystem, Cartridge& cart, const Properties& props);
/**
Create a new console object by copying another one
@param console The object to copy
*/
Console(const Console& console);
/** /**
Destructor Destructor
*/ */
@ -188,15 +181,6 @@ class Console : public Serializable
*/ */
void stateChanged(EventHandler::State state); void stateChanged(EventHandler::State state);
public:
/**
Overloaded assignment operator
@param console The console object to set myself equal to
@return Myself after assignment has taken place
*/
Console& operator = (const Console& console);
public: public:
/** /**
Toggle between NTSC/PAL/SECAM (and variants) display format. Toggle between NTSC/PAL/SECAM (and variants) display format.
@ -338,6 +322,10 @@ class Console : public Serializable
void toggleTIABit(TIABit bit, const string& bitname, bool show = true) const; void toggleTIABit(TIABit bit, const string& bitname, bool show = true) const;
void toggleTIACollision(TIABit bit, const string& bitname, bool show = true) const; void toggleTIACollision(TIABit bit, const string& bitname, bool show = true) const;
// Copy constructor and assignment operator not supported
Console(const Console&);
Console& operator = (const Console&);
private: private:
// Reference to the osystem object // Reference to the osystem object
OSystem& myOSystem; OSystem& myOSystem;

View File

@ -26,6 +26,8 @@
Driving::Driving(Jack jack, const Event& event, const System& system) Driving::Driving(Jack jack, const Event& event, const System& system)
: Controller(jack, event, system, Controller::Driving), : Controller(jack, event, system, Controller::Driving),
myCounter(0), myCounter(0),
myGrayIndex(0),
myLastYaxis(0),
myControlID(-1), myControlID(-1),
myControlIDX(-1), myControlIDX(-1),
myControlIDY(-1) myControlIDY(-1)

View File

@ -62,6 +62,7 @@ EventHandler::EventHandler(OSystem& osystem)
myState(S_NONE), myState(S_NONE),
myAllowAllDirectionsFlag(false), myAllowAllDirectionsFlag(false),
myFryingFlag(false), myFryingFlag(false),
myUseCtrlKeyFlag(true),
mySkipMouseMotion(true), mySkipMouseMotion(true),
myJoyHandler(NULL) myJoyHandler(NULL)
{ {
@ -1971,7 +1972,7 @@ void EventHandler::setEventState(State state)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 EventHandler::resetEventsCallback(uInt32 interval, void* param) uInt32 EventHandler::resetEventsCallback(uInt32 interval, void* param)
{ {
((EventHandler*)param)->myEvent.clear(); (static_cast<EventHandler*>(param))->myEvent.clear();
return 0; return 0;
} }

View File

@ -479,6 +479,10 @@ class EventHandler
void removeJoystick(int index); void removeJoystick(int index);
private: private:
// Copy constructor and assignment operator not supported
EventHandler(const EventHandler&);
EventHandler& operator = (const EventHandler&);
enum { enum {
kComboSize = 16, kComboSize = 16,
kEventsPerCombo = 8, kEventsPerCombo = 8,

View File

@ -247,7 +247,7 @@ class FilesystemNode
*/ */
string getNameWithExt(const string& ext) const; string getNameWithExt(const string& ext) const;
string getPathWithExt(const string& ext) const; string getPathWithExt(const string& ext) const;
string getShortPathWithExt(const string& ext) const; string getShortPathWithExt(const string& ext) const; // FIXME - dead code
private: private:
Common::SharedPtr<AbstractFSNode> _realNode; Common::SharedPtr<AbstractFSNode> _realNode;

View File

@ -30,7 +30,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M6532::M6532(const Console& console, const Settings& settings) M6532::M6532(const Console& console, const Settings& settings)
: myConsole(console), : myConsole(console),
mySettings(settings) mySettings(settings),
myTimerFlagValid(false),
myEdgeDetectPositive(false)
{ {
} }

View File

@ -58,7 +58,19 @@ MT24LC256::MT24LC256(const string& filename, const System& system)
myCyclesWhenSCLSet(0), myCyclesWhenSCLSet(0),
myDataFile(filename), myDataFile(filename),
myDataFileExists(false), myDataFileExists(false),
myDataChanged(false) myDataChanged(false),
jpee_mdat(0),
jpee_sdat(0),
jpee_mclk(0),
jpee_sizemask(0),
jpee_pagemask(0),
jpee_smallmode(0),
jpee_logmode(0),
jpee_pptr(0),
jpee_state(0),
jpee_nb(0),
jpee_address(0),
jpee_ad_known(0)
{ {
// Load the data from an external file (if it exists) // Load the data from an external file (if it exists)
ifstream in; ifstream in;
@ -211,8 +223,6 @@ void MT24LC256::jpee_data_start()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MT24LC256::jpee_data_stop() void MT24LC256::jpee_data_stop()
{ {
int i;
if (jpee_state == 1 && jpee_nb != 1) if (jpee_state == 1 && jpee_nb != 1)
{ {
JPEE_LOG0("I2C_WARNING ABANDON_WRITE"); JPEE_LOG0("I2C_WARNING ABANDON_WRITE");
@ -233,7 +243,7 @@ void MT24LC256::jpee_data_stop()
jpee_pptr = 4+jpee_pagemask-(jpee_address & jpee_pagemask); jpee_pptr = 4+jpee_pagemask-(jpee_address & jpee_pagemask);
JPEE_LOG1("I2C_WARNING PAGECROSSING!(Truncate to %d bytes)",jpee_pptr-3); JPEE_LOG1("I2C_WARNING PAGECROSSING!(Truncate to %d bytes)",jpee_pptr-3);
} }
for (i=3; i<jpee_pptr; i++) for (int i=3; i<jpee_pptr; i++)
{ {
myDataChanged = true; myDataChanged = true;
myData[(jpee_address++) & jpee_sizemask] = jpee_packet[i]; myData[(jpee_address++) & jpee_sizemask] = jpee_packet[i];

View File

@ -586,7 +586,7 @@ Console* OSystem::openConsole(const FilesystemNode& romfile, string& md5,
// For initial creation of the Cart, we're only concerned with the BS type // For initial creation of the Cart, we're only concerned with the BS type
Properties props; Properties props;
myPropSet->getMD5(md5, props); myPropSet->getMD5(md5, props);
string s = ""; string s;
CMDLINE_PROPS_UPDATE("bs", Cartridge_Type); CMDLINE_PROPS_UPDATE("bs", Cartridge_Type);
CMDLINE_PROPS_UPDATE("type", Cartridge_Type); CMDLINE_PROPS_UPDATE("type", Cartridge_Type);

View File

@ -31,6 +31,7 @@ System::System(const OSystem& osystem)
: myOSystem(osystem), : myOSystem(osystem),
myNumberOfDevices(0), myNumberOfDevices(0),
myM6502(0), myM6502(0),
myM6532(0),
myTIA(0), myTIA(0),
myCycles(0), myCycles(0),
myDataBusState(0), myDataBusState(0),
@ -97,7 +98,7 @@ void System::reset(bool autodetect)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void System::attach(Device* device) void System::attach(Device* device)
{ {
assert(myNumberOfDevices < 100); assert(myNumberOfDevices < 5);
// Add device to my collection of devices // Add device to my collection of devices
myDevices[myNumberOfDevices++] = device; myDevices[myNumberOfDevices++] = device;
@ -123,14 +124,14 @@ void System::attach(M6532* m6532)
myM6532 = m6532; myM6532 = m6532;
// Attach it as a normal device // Attach it as a normal device
attach((Device*) m6532); attach(static_cast<Device*>(m6532));
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void System::attach(TIA* tia) void System::attach(TIA* tia)
{ {
myTIA = tia; myTIA = tia;
attach((Device*) tia); attach(static_cast<Device*>(tia));
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -411,7 +411,7 @@ class System : public Serializable
bool* myPageIsDirtyTable; bool* myPageIsDirtyTable;
// Array of all the devices attached to the system // Array of all the devices attached to the system
Device* myDevices[100]; Device* myDevices[5];
// Number of devices attached to the system // Number of devices attached to the system
uInt32 myNumberOfDevices; uInt32 myNumberOfDevices;

View File

@ -38,7 +38,8 @@ TIASurface::TIASurface(OSystem& system)
myFilterType(kNormal), myFilterType(kNormal),
myUsePhosphor(false), myUsePhosphor(false),
myPhosphorBlend(77), myPhosphorBlend(77),
myScanlinesEnabled(false) myScanlinesEnabled(false),
myPalette(NULL)
{ {
// Load NTSC filter settings // Load NTSC filter settings
myNTSCFilter.loadConfig(myOSystem.settings()); myNTSCFilter.loadConfig(myOSystem.settings());

View File

@ -162,6 +162,7 @@ uInt32 Thumbulator::fetch16 ( uInt32 addr )
return fatalError("fetch16", addr, "abort"); return fatalError("fetch16", addr, "abort");
} }
#if 0 // Currently not used anywhere in this class
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Thumbulator::fetch32 ( uInt32 addr ) uInt32 Thumbulator::fetch32 ( uInt32 addr )
{ {
@ -187,6 +188,7 @@ uInt32 Thumbulator::fetch32 ( uInt32 addr )
} }
return fatalError("fetch32", addr, "abort"); return fatalError("fetch32", addr, "abort");
} }
#endif
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Thumbulator::write16 ( uInt32 addr, uInt32 data ) void Thumbulator::write16 ( uInt32 addr, uInt32 data )

View File

@ -93,7 +93,7 @@ class Thumbulator
uInt32 read_register ( uInt32 reg ); uInt32 read_register ( uInt32 reg );
uInt32 write_register ( uInt32 reg, uInt32 data ); uInt32 write_register ( uInt32 reg, uInt32 data );
uInt32 fetch16 ( uInt32 addr ); uInt32 fetch16 ( uInt32 addr );
uInt32 fetch32 ( uInt32 addr ); //uInt32 fetch32 ( uInt32 addr );
uInt32 read16 ( uInt32 addr ); uInt32 read16 ( uInt32 addr );
uInt32 read32 ( uInt32 ); uInt32 read32 ( uInt32 );
void write16 ( uInt32 addr, uInt32 data ); void write16 ( uInt32 addr, uInt32 data );

View File

@ -40,7 +40,9 @@
BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font, BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font,
int max_w, int max_h) int max_w, int max_h)
: Dialog(boss->instance(), boss->parent(), 0, 0, 0, 0), : Dialog(boss->instance(), boss->parent(), 0, 0, 0, 0),
CommandSender(boss) CommandSender(boss),
_cmd(0),
_mode(FileSave)
{ {
// Set real dimensions // Set real dimensions
_w = max_w; _w = max_w;

View File

@ -33,7 +33,7 @@ CheckListWidget::CheckListWidget(GuiObject* boss, const GUI::Font& font,
_rows = h / _fontHeight; _rows = h / _fontHeight;
// Create a CheckboxWidget for each row in the list // Create a CheckboxWidget for each row in the list
CheckboxWidget* t; CheckboxWidget* t = NULL;
for(int i = 0; i < _rows; ++i) for(int i = 0; i < _rows; ++i)
{ {
t = new CheckboxWidget(boss, font, _x + 2, ypos, "", kCheckActionCmd); t = new CheckboxWidget(boss, font, _x + 2, ypos, "", kCheckActionCmd);

View File

@ -29,7 +29,6 @@
EditTextWidget::EditTextWidget(GuiObject* boss, const GUI::Font& font, EditTextWidget::EditTextWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, const string& text) int x, int y, int w, int h, const string& text)
: EditableWidget(boss, font, x, y, w, h + 2, text), : EditableWidget(boss, font, x, y, w, h + 2, text),
_editable(true),
_changed(false) _changed(false)
{ {
_flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS; _flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS;

View File

@ -47,7 +47,6 @@ class EditTextWidget : public EditableWidget
protected: protected:
string _backupString; string _backupString;
int _editable;
bool _changed; bool _changed;
}; };

View File

@ -63,17 +63,17 @@ FBInitStatus Launcher::initializeVideo()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const string& Launcher::selectedRomMD5() const string& Launcher::selectedRomMD5()
{ {
return ((LauncherDialog*)myBaseDialog)->selectedRomMD5(); return (static_cast<LauncherDialog*>(myBaseDialog))->selectedRomMD5();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const FilesystemNode& Launcher::currentNode() const const FilesystemNode& Launcher::currentNode() const
{ {
return ((LauncherDialog*)myBaseDialog)->currentNode(); return (static_cast<LauncherDialog*>(myBaseDialog))->currentNode();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Launcher::reload() void Launcher::reload()
{ {
((LauncherDialog*)myBaseDialog)->reload(); (static_cast<LauncherDialog*>(myBaseDialog))->reload();
} }

View File

@ -69,7 +69,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
fontHeight = font.getFontHeight(), fontHeight = font.getFontHeight(),
bwidth = (_w - 2 * 10 - 8 * (4 - 1)) / 4, bwidth = (_w - 2 * 10 - 8 * (4 - 1)) / 4,
bheight = font.getLineHeight() + 4; bheight = font.getLineHeight() + 4;
int xpos = 0, ypos = 0, lwidth = 0, lwidth2 = 0, fwidth = 0; int xpos = 0, ypos = 0, lwidth = 0, lwidth2 = 0;
WidgetArray wid; WidgetArray wid;
// Show game name // Show game name
@ -88,7 +88,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
// It has to fit between both labels // It has to fit between both labels
if(w >= 640) if(w >= 640)
{ {
fwidth = BSPF_min(15 * fontWidth, xpos - 20 - lwidth); int fwidth = BSPF_min(15 * fontWidth, xpos - 20 - lwidth);
xpos -= fwidth + 5; xpos -= fwidth + 5;
myPattern = new EditTextWidget(this, font, xpos, ypos, myPattern = new EditTextWidget(this, font, xpos, ypos,
fwidth, fontHeight, ""); fwidth, fontHeight, "");

View File

@ -33,7 +33,8 @@ ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font,
mySlider(NULL), mySlider(NULL),
myStart(0), myStart(0),
myFinish(0), myFinish(0),
myStep(0) myStep(0),
myCurrentStep(0)
{ {
const int fontWidth = font.getMaxCharWidth(), const int fontWidth = font.getMaxCharWidth(),
fontHeight = font.getFontHeight(), fontHeight = font.getFontHeight(),

View File

@ -30,12 +30,11 @@ RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font,
: Widget(boss, font, x, y, w, h), : Widget(boss, font, x, y, w, h),
mySurface(NULL), mySurface(NULL),
mySurfaceIsValid(false), mySurfaceIsValid(false),
myHaveProperties(false) myHaveProperties(false),
myAvail(w > 400 ? GUI::Size(640, 512) : GUI::Size(320, 256))
{ {
_flags = WIDGET_ENABLED; _flags = WIDGET_ENABLED;
_bgcolor = _bgcolorhi = kWidColor; _bgcolor = _bgcolorhi = kWidColor;
myAvail = w > 400 ? GUI::Size(640, 512) : GUI::Size(320, 256);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -51,9 +51,6 @@ class RomInfoWidget : public Widget
// Surface pointer holding the PNG image // Surface pointer holding the PNG image
FBSurface* mySurface; FBSurface* mySurface;
// How much space available for the PNG image
GUI::Size myAvail;
// Whether the surface should be redrawn by drawWidget() // Whether the surface should be redrawn by drawWidget()
bool mySurfaceIsValid; bool mySurfaceIsValid;
@ -68,6 +65,9 @@ class RomInfoWidget : public Widget
// Indicates if an error occurred in creating/displaying the surface // Indicates if an error occurred in creating/displaying the surface
string mySurfaceErrorMsg; string mySurfaceErrorMsg;
// How much space available for the PNG image
GUI::Size myAvail;
}; };
#endif #endif

View File

@ -106,6 +106,7 @@ void TabWidget::setActiveTab(int tabID, bool show)
sendCommand(kTabChangedCmd, _activeTab, _id); sendCommand(kTabChangedCmd, _activeTab, _id);
} }
#if 0 // FIXME
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TabWidget::disableTab(int tabID) void TabWidget::disableTab(int tabID)
{ {
@ -114,6 +115,7 @@ void TabWidget::disableTab(int tabID)
_tabs[tabID].enabled = false; _tabs[tabID].enabled = false;
// TODO - also disable all widgets belonging to this tab // TODO - also disable all widgets belonging to this tab
} }
#endif
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TabWidget::updateActiveTab() void TabWidget::updateActiveTab()

View File

@ -45,7 +45,7 @@ class TabWidget : public Widget, public CommandSender
//void removeTab(int tabID); //void removeTab(int tabID);
// Setting the active tab: // Setting the active tab:
void setActiveTab(int tabID, bool show = false); void setActiveTab(int tabID, bool show = false);
void disableTab(int tabID); // void disableTab(int tabID);
void activateTabs(); void activateTabs();
void cycleTab(int direction); void cycleTab(int direction);
// setActiveTab changes the value of _firstWidget. This means Widgets added afterwards // setActiveTab changes the value of _firstWidget. This means Widgets added afterwards

View File

@ -300,6 +300,7 @@ StaticTextWidget::StaticTextWidget(GuiObject *boss, const GUI::Font& font,
_textcolorhi = kTextColor; _textcolorhi = kTextColor;
_label = text; _label = text;
_editable = false;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -