From 27e005d7a56f71745c535903b4af514664aa14eb Mon Sep 17 00:00:00 2001 From: stephena Date: Mon, 27 Oct 2014 14:41:46 +0000 Subject: [PATCH] Final batch of fixes from cppcheck. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3024 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/cheat/CheatManager.cxx | 10 +++++----- src/cheat/CheatManager.hxx | 8 ++++---- src/common/FSNodeZIP.cxx | 11 ++++------- src/common/FrameBufferSDL2.cxx | 2 +- src/debugger/CartDebug.hxx | 2 +- src/debugger/Debugger.hxx | 2 +- src/debugger/DebuggerParser.cxx | 3 ++- src/debugger/gui/CartDebugWidget.hxx | 3 ++- src/debugger/gui/PromptWidget.cxx | 5 ++++- src/debugger/gui/PromptWidget.hxx | 2 +- src/debugger/gui/RomListSettings.cxx | 3 ++- src/debugger/gui/RomListWidget.cxx | 2 +- src/debugger/gui/TiaInfoWidget.cxx | 3 +-- src/debugger/gui/TiaOutputWidget.cxx | 4 +++- src/debugger/gui/TogglePixelWidget.cxx | 3 ++- src/debugger/gui/ToggleWidget.cxx | 2 ++ src/debugger/gui/ToggleWidget.hxx | 4 ++-- src/emucore/CompuMate.hxx | 4 ++-- src/emucore/Console.cxx | 17 ----------------- src/emucore/Console.hxx | 20 ++++---------------- src/emucore/Driving.cxx | 2 ++ src/emucore/EventHandler.cxx | 3 ++- src/emucore/EventHandler.hxx | 4 ++++ src/emucore/FSNode.hxx | 2 +- src/emucore/M6532.cxx | 4 +++- src/emucore/MT24LC256.cxx | 18 ++++++++++++++---- src/emucore/OSystem.cxx | 2 +- src/emucore/System.cxx | 7 ++++--- src/emucore/System.hxx | 2 +- src/emucore/TIASurface.cxx | 3 ++- src/emucore/Thumbulator.cxx | 2 ++ src/emucore/Thumbulator.hxx | 2 +- src/gui/BrowserDialog.cxx | 4 +++- src/gui/CheckListWidget.cxx | 2 +- src/gui/EditTextWidget.cxx | 1 - src/gui/EditTextWidget.hxx | 1 - src/gui/Launcher.cxx | 6 +++--- src/gui/LauncherDialog.cxx | 4 ++-- src/gui/ProgressDialog.cxx | 3 ++- src/gui/RomInfoWidget.cxx | 5 ++--- src/gui/RomInfoWidget.hxx | 6 +++--- src/gui/TabWidget.cxx | 2 ++ src/gui/TabWidget.hxx | 2 +- src/gui/Widget.cxx | 1 + 44 files changed, 101 insertions(+), 97 deletions(-) diff --git a/src/cheat/CheatManager.cxx b/src/cheat/CheatManager.cxx index 3a686a4eb..dd9320bf2 100644 --- a/src/cheat/CheatManager.cxx +++ b/src/cheat/CheatManager.cxx @@ -47,10 +47,10 @@ CheatManager::~CheatManager() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const Cheat* CheatManager::add(const string& name, const string& code, - bool enable, int idx) +Cheat* CheatManager::add(const string& name, const string& code, + bool enable, int idx) { - Cheat* cheat = (Cheat*) createCheat(name, code); + Cheat* cheat = createCheat(name, code); if(!cheat) 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)) 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++) if(!isxdigit(code[i])) diff --git a/src/cheat/CheatManager.hxx b/src/cheat/CheatManager.hxx index 3ab42a160..2c01e4125 100644 --- a/src/cheat/CheatManager.hxx +++ b/src/cheat/CheatManager.hxx @@ -55,8 +55,8 @@ class CheatManager @return The cheat (if was created), else NULL. */ - const Cheat* add(const string& name, const string& code, - bool enable = true, int idx = -1); + Cheat* add(const string& name, const string& code, + bool enable = true, int idx = -1); /** Remove the cheat at 'idx' from the cheat list(s). @@ -126,7 +126,7 @@ class CheatManager /** Checks if a code is valid. */ - bool isValidCode(const string& code); + bool isValidCode(const string& code) const; private: /** @@ -137,7 +137,7 @@ class CheatManager @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. diff --git a/src/common/FSNodeZIP.cxx b/src/common/FSNodeZIP.cxx index f4bdc0e8b..601c15d7f 100644 --- a/src/common/FSNodeZIP.cxx +++ b/src/common/FSNodeZIP.cxx @@ -24,22 +24,19 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FilesystemNodeZIP::FilesystemNodeZIP() + : _error(ZIPERR_NOT_A_FILE), + _numFiles(0) { // We need a name, else the node is invalid - _path = _shortPath = _virtualFile = ""; - _error = ZIPERR_NOT_A_FILE; - _numFiles = 0; - AbstractFSNode* tmp = 0; _realNode = Common::SharedPtr(tmp); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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) size_t pos = BSPF_findIgnoreCase(p, ".zip"); if(pos == string::npos) diff --git a/src/common/FrameBufferSDL2.cxx b/src/common/FrameBufferSDL2.cxx index d1939b623..ca0b25d8f 100644 --- a/src/common/FrameBufferSDL2.cxx +++ b/src/common/FrameBufferSDL2.cxx @@ -291,7 +291,7 @@ void FrameBufferSDL2::setWindowIcon() uInt32 rgba[256], icon[32 * 32]; 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)) { myOSystem.logMessage("ERROR: Couldn't load the application icon.", 0); diff --git a/src/debugger/CartDebug.hxx b/src/debugger/CartDebug.hxx index 9079ecb03..60a8c84f2 100644 --- a/src/debugger/CartDebug.hxx +++ b/src/debugger/CartDebug.hxx @@ -194,7 +194,7 @@ class CartDebug : public DebuggerSystem /** Get the name/type of the cartridge. */ - string getCartType() const; + string getCartType() const; // FIXME - dead code /** Add a label and associated address. diff --git a/src/debugger/Debugger.hxx b/src/debugger/Debugger.hxx index c908943be..92a9a8d5b 100644 --- a/src/debugger/Debugger.hxx +++ b/src/debugger/Debugger.hxx @@ -121,7 +121,7 @@ class Debugger : public DialogContainer bool delFunction(const string& name); 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; string builtinHelp() const; diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index e5cc7f066..2d34ea992 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -56,7 +56,8 @@ using namespace Common; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DebuggerParser::DebuggerParser(Debugger& d, Settings& s) : debugger(d), - settings(s) + settings(s), + argCount(0) { } diff --git a/src/debugger/gui/CartDebugWidget.hxx b/src/debugger/gui/CartDebugWidget.hxx index be4a67eee..3a0ea64fb 100644 --- a/src/debugger/gui/CartDebugWidget.hxx +++ b/src/debugger/gui/CartDebugWidget.hxx @@ -45,7 +45,8 @@ class CartDebugWidget : public Widget, public CommandSender myFontWidth(lfont.getMaxCharWidth()), myFontHeight(lfont.getFontHeight()), myLineHeight(lfont.getLineHeight()), - myButtonHeight(myLineHeight + 4) { } + myButtonHeight(myLineHeight + 4), + myDesc(NULL) { } virtual ~CartDebugWidget() { }; diff --git a/src/debugger/gui/PromptWidget.cxx b/src/debugger/gui/PromptWidget.cxx index 4e919cd05..9cad74e52 100644 --- a/src/debugger/gui/PromptWidget.cxx +++ b/src/debugger/gui/PromptWidget.cxx @@ -647,10 +647,13 @@ void PromptWidget::addToHistory(const char *str) _historySize++; } +#if 0 // FIXME // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int PromptWidget::compareHistory(const char *histLine) { +int PromptWidget::compareHistory(const char *histLine) +{ return 1; } +#endif // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void PromptWidget::historyScroll(int direction) diff --git a/src/debugger/gui/PromptWidget.hxx b/src/debugger/gui/PromptWidget.hxx index e6fd176cf..7395339a8 100644 --- a/src/debugger/gui/PromptWidget.hxx +++ b/src/debugger/gui/PromptWidget.hxx @@ -119,7 +119,7 @@ class PromptWidget : public Widget, public CommandSender bool _firstTime; bool _exitedEarly; - int compareHistory(const char *histLine); +// int compareHistory(const char *histLine); }; #endif diff --git a/src/debugger/gui/RomListSettings.cxx b/src/debugger/gui/RomListSettings.cxx index 116c158d8..c3a2ee6b4 100644 --- a/src/debugger/gui/RomListSettings.cxx +++ b/src/debugger/gui/RomListSettings.cxx @@ -29,7 +29,8 @@ RomListSettings::RomListSettings(GuiObject* boss, const GUI::Font& font) : Dialog(boss->instance(), boss->parent(), 0, 0, 16, 16), CommandSender(boss), _xorig(0), - _yorig(0) + _yorig(0), + _item(0) { const int buttonWidth = font.getStringWidth("RunTo PC @ current line") + 20, buttonHeight = font.getLineHeight() + 4; diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx index 213749569..f767552ca 100644 --- a/src/debugger/gui/RomListWidget.cxx +++ b/src/debugger/gui/RomListWidget.cxx @@ -77,7 +77,7 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& lfont, _rows = h / _fontHeight; // Create a CheckboxWidget for each row in the list - CheckboxWidget* t; + CheckboxWidget* t = NULL; for(int i = 0; i < _rows; ++i) { t = new CheckboxWidget(boss, lfont, _x + 2, ypos, "", kCheckActionCmd); diff --git a/src/debugger/gui/TiaInfoWidget.cxx b/src/debugger/gui/TiaInfoWidget.cxx index ad1780a1a..b7d28e95b 100644 --- a/src/debugger/gui/TiaInfoWidget.cxx +++ b/src/debugger/gui/TiaInfoWidget.cxx @@ -39,12 +39,11 @@ TiaInfoWidget::TiaInfoWidget(GuiObject* boss, const GUI::Font& lfont, x += 5; 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 fwidth = 5 * lfont.getMaxCharWidth() + 4; // Add frame info - xpos = x; ypos = y + 10; new StaticTextWidget(boss, lfont, xpos, ypos, lwidth, lineHeight, longstr ? "Frame Count:" : "Frame:", kTextAlignLeft); diff --git a/src/debugger/gui/TiaOutputWidget.cxx b/src/debugger/gui/TiaOutputWidget.cxx index c5567361f..3a005df15 100644 --- a/src/debugger/gui/TiaOutputWidget.cxx +++ b/src/debugger/gui/TiaOutputWidget.cxx @@ -39,7 +39,9 @@ TiaOutputWidget::TiaOutputWidget(GuiObject* boss, const GUI::Font& font, : Widget(boss, font, x, y, w, h), CommandSender(boss), myMenu(NULL), - myZoom(NULL) + myZoom(NULL), + myClickX(0), + myClickY(0) { // Create context menu for commands VariantList l; diff --git a/src/debugger/gui/TogglePixelWidget.cxx b/src/debugger/gui/TogglePixelWidget.cxx index 10afe4ceb..f8e540009 100644 --- a/src/debugger/gui/TogglePixelWidget.cxx +++ b/src/debugger/gui/TogglePixelWidget.cxx @@ -29,7 +29,8 @@ TogglePixelWidget::TogglePixelWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int cols, int rows) : ToggleWidget(boss, font, x, y, cols, rows), _pixelColor(0), - _backgroundColor(kDlgColor) + _backgroundColor(kDlgColor), + _swapBits(false) { _rowHeight = _colWidth = font.getLineHeight(); diff --git a/src/debugger/gui/ToggleWidget.cxx b/src/debugger/gui/ToggleWidget.cxx index cfd393d99..bb7dacc1d 100644 --- a/src/debugger/gui/ToggleWidget.cxx +++ b/src/debugger/gui/ToggleWidget.cxx @@ -30,6 +30,8 @@ ToggleWidget::ToggleWidget(GuiObject* boss, const GUI::Font& font, _cols(cols), _currentRow(0), _currentCol(0), + _rowHeight(0), + _colWidth(0), _selectedItem(0), _editable(true) { diff --git a/src/debugger/gui/ToggleWidget.hxx b/src/debugger/gui/ToggleWidget.hxx index 86541dddc..2fa6efec4 100644 --- a/src/debugger/gui/ToggleWidget.hxx +++ b/src/debugger/gui/ToggleWidget.hxx @@ -61,8 +61,8 @@ class ToggleWidget : public Widget, public CommandSender int _cols; int _currentRow; int _currentCol; - int _rowHeight; - int _colWidth; + int _rowHeight; // explicitly set in child classes + int _colWidth; // explicitly set in child classes int _selectedItem; bool _editable; diff --git a/src/emucore/CompuMate.hxx b/src/emucore/CompuMate.hxx index c472ec101..ae19c867d 100644 --- a/src/emucore/CompuMate.hxx +++ b/src/emucore/CompuMate.hxx @@ -63,8 +63,8 @@ class CompuMate /** Return the left and right CompuMate controllers */ - Controller* leftController() { return myLeftController; } - Controller* rightController() { return myRightController; } + Controller* leftController() const { return myLeftController; } + Controller* rightController() const { return myRightController; } /** In normal key-handling mode, the update handler receives key events diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index e312b7926..2bdaa0a3a 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -1147,20 +1147,3 @@ uInt32 Console::ourUserPALPalette[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; -} diff --git a/src/emucore/Console.hxx b/src/emucore/Console.hxx index 6663d8813..04573aa6b 100644 --- a/src/emucore/Console.hxx +++ b/src/emucore/Console.hxx @@ -69,13 +69,6 @@ class Console : public Serializable @param props The properties for the cartridge */ 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 @@ -188,15 +181,6 @@ class Console : public Serializable */ 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: /** 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 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: // Reference to the osystem object OSystem& myOSystem; diff --git a/src/emucore/Driving.cxx b/src/emucore/Driving.cxx index 9eece45d5..1d2c2ae0e 100644 --- a/src/emucore/Driving.cxx +++ b/src/emucore/Driving.cxx @@ -26,6 +26,8 @@ Driving::Driving(Jack jack, const Event& event, const System& system) : Controller(jack, event, system, Controller::Driving), myCounter(0), + myGrayIndex(0), + myLastYaxis(0), myControlID(-1), myControlIDX(-1), myControlIDY(-1) diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index 79554c7a2..db24905ef 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -62,6 +62,7 @@ EventHandler::EventHandler(OSystem& osystem) myState(S_NONE), myAllowAllDirectionsFlag(false), myFryingFlag(false), + myUseCtrlKeyFlag(true), mySkipMouseMotion(true), myJoyHandler(NULL) { @@ -1971,7 +1972,7 @@ void EventHandler::setEventState(State state) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt32 EventHandler::resetEventsCallback(uInt32 interval, void* param) { - ((EventHandler*)param)->myEvent.clear(); + (static_cast(param))->myEvent.clear(); return 0; } diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 01eedd04e..dd9e8b68b 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -479,6 +479,10 @@ class EventHandler void removeJoystick(int index); private: + // Copy constructor and assignment operator not supported + EventHandler(const EventHandler&); + EventHandler& operator = (const EventHandler&); + enum { kComboSize = 16, kEventsPerCombo = 8, diff --git a/src/emucore/FSNode.hxx b/src/emucore/FSNode.hxx index 9201959e7..10bdd481f 100644 --- a/src/emucore/FSNode.hxx +++ b/src/emucore/FSNode.hxx @@ -247,7 +247,7 @@ class FilesystemNode */ string getNameWithExt(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: Common::SharedPtr _realNode; diff --git a/src/emucore/M6532.cxx b/src/emucore/M6532.cxx index d1f214622..6efd50627 100644 --- a/src/emucore/M6532.cxx +++ b/src/emucore/M6532.cxx @@ -30,7 +30,9 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - M6532::M6532(const Console& console, const Settings& settings) : myConsole(console), - mySettings(settings) + mySettings(settings), + myTimerFlagValid(false), + myEdgeDetectPositive(false) { } diff --git a/src/emucore/MT24LC256.cxx b/src/emucore/MT24LC256.cxx index 7d80255fe..ba60a5bfe 100644 --- a/src/emucore/MT24LC256.cxx +++ b/src/emucore/MT24LC256.cxx @@ -58,7 +58,19 @@ MT24LC256::MT24LC256(const string& filename, const System& system) myCyclesWhenSCLSet(0), myDataFile(filename), 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) ifstream in; @@ -211,8 +223,6 @@ void MT24LC256::jpee_data_start() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void MT24LC256::jpee_data_stop() { - int i; - if (jpee_state == 1 && jpee_nb != 1) { 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_LOG1("I2C_WARNING PAGECROSSING!(Truncate to %d bytes)",jpee_pptr-3); } - for (i=3; igetMD5(md5, props); - string s = ""; + string s; CMDLINE_PROPS_UPDATE("bs", Cartridge_Type); CMDLINE_PROPS_UPDATE("type", Cartridge_Type); diff --git a/src/emucore/System.cxx b/src/emucore/System.cxx index cbda4e09a..115f9ca3a 100644 --- a/src/emucore/System.cxx +++ b/src/emucore/System.cxx @@ -31,6 +31,7 @@ System::System(const OSystem& osystem) : myOSystem(osystem), myNumberOfDevices(0), myM6502(0), + myM6532(0), myTIA(0), myCycles(0), myDataBusState(0), @@ -97,7 +98,7 @@ void System::reset(bool autodetect) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void System::attach(Device* device) { - assert(myNumberOfDevices < 100); + assert(myNumberOfDevices < 5); // Add device to my collection of devices myDevices[myNumberOfDevices++] = device; @@ -123,14 +124,14 @@ void System::attach(M6532* m6532) myM6532 = m6532; // Attach it as a normal device - attach((Device*) m6532); + attach(static_cast(m6532)); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void System::attach(TIA* tia) { myTIA = tia; - attach((Device*) tia); + attach(static_cast(tia)); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/System.hxx b/src/emucore/System.hxx index e86ae69b7..a334bce6a 100644 --- a/src/emucore/System.hxx +++ b/src/emucore/System.hxx @@ -411,7 +411,7 @@ class System : public Serializable bool* myPageIsDirtyTable; // Array of all the devices attached to the system - Device* myDevices[100]; + Device* myDevices[5]; // Number of devices attached to the system uInt32 myNumberOfDevices; diff --git a/src/emucore/TIASurface.cxx b/src/emucore/TIASurface.cxx index b371106c3..2e0902403 100644 --- a/src/emucore/TIASurface.cxx +++ b/src/emucore/TIASurface.cxx @@ -38,7 +38,8 @@ TIASurface::TIASurface(OSystem& system) myFilterType(kNormal), myUsePhosphor(false), myPhosphorBlend(77), - myScanlinesEnabled(false) + myScanlinesEnabled(false), + myPalette(NULL) { // Load NTSC filter settings myNTSCFilter.loadConfig(myOSystem.settings()); diff --git a/src/emucore/Thumbulator.cxx b/src/emucore/Thumbulator.cxx index 3decc1a69..cc4359d01 100644 --- a/src/emucore/Thumbulator.cxx +++ b/src/emucore/Thumbulator.cxx @@ -162,6 +162,7 @@ uInt32 Thumbulator::fetch16 ( uInt32 addr ) return fatalError("fetch16", addr, "abort"); } +#if 0 // Currently not used anywhere in this class // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt32 Thumbulator::fetch32 ( uInt32 addr ) { @@ -187,6 +188,7 @@ uInt32 Thumbulator::fetch32 ( uInt32 addr ) } return fatalError("fetch32", addr, "abort"); } +#endif // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Thumbulator::write16 ( uInt32 addr, uInt32 data ) diff --git a/src/emucore/Thumbulator.hxx b/src/emucore/Thumbulator.hxx index 1612fdcfb..5f0e7fd5b 100644 --- a/src/emucore/Thumbulator.hxx +++ b/src/emucore/Thumbulator.hxx @@ -93,7 +93,7 @@ class Thumbulator uInt32 read_register ( uInt32 reg ); uInt32 write_register ( uInt32 reg, uInt32 data ); uInt32 fetch16 ( uInt32 addr ); - uInt32 fetch32 ( uInt32 addr ); + //uInt32 fetch32 ( uInt32 addr ); uInt32 read16 ( uInt32 addr ); uInt32 read32 ( uInt32 ); void write16 ( uInt32 addr, uInt32 data ); diff --git a/src/gui/BrowserDialog.cxx b/src/gui/BrowserDialog.cxx index b06d50ecb..4175b0193 100644 --- a/src/gui/BrowserDialog.cxx +++ b/src/gui/BrowserDialog.cxx @@ -40,7 +40,9 @@ BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font, int max_w, int max_h) : Dialog(boss->instance(), boss->parent(), 0, 0, 0, 0), - CommandSender(boss) + CommandSender(boss), + _cmd(0), + _mode(FileSave) { // Set real dimensions _w = max_w; diff --git a/src/gui/CheckListWidget.cxx b/src/gui/CheckListWidget.cxx index 29730ad5a..7dfd74a23 100644 --- a/src/gui/CheckListWidget.cxx +++ b/src/gui/CheckListWidget.cxx @@ -33,7 +33,7 @@ CheckListWidget::CheckListWidget(GuiObject* boss, const GUI::Font& font, _rows = h / _fontHeight; // Create a CheckboxWidget for each row in the list - CheckboxWidget* t; + CheckboxWidget* t = NULL; for(int i = 0; i < _rows; ++i) { t = new CheckboxWidget(boss, font, _x + 2, ypos, "", kCheckActionCmd); diff --git a/src/gui/EditTextWidget.cxx b/src/gui/EditTextWidget.cxx index 2a7ff479c..bf1af41b9 100644 --- a/src/gui/EditTextWidget.cxx +++ b/src/gui/EditTextWidget.cxx @@ -29,7 +29,6 @@ EditTextWidget::EditTextWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const string& text) : EditableWidget(boss, font, x, y, w, h + 2, text), - _editable(true), _changed(false) { _flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS; diff --git a/src/gui/EditTextWidget.hxx b/src/gui/EditTextWidget.hxx index 83f78284e..c46cdb6dd 100644 --- a/src/gui/EditTextWidget.hxx +++ b/src/gui/EditTextWidget.hxx @@ -47,7 +47,6 @@ class EditTextWidget : public EditableWidget protected: string _backupString; - int _editable; bool _changed; }; diff --git a/src/gui/Launcher.cxx b/src/gui/Launcher.cxx index 44352fbdd..543395396 100644 --- a/src/gui/Launcher.cxx +++ b/src/gui/Launcher.cxx @@ -63,17 +63,17 @@ FBInitStatus Launcher::initializeVideo() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const string& Launcher::selectedRomMD5() { - return ((LauncherDialog*)myBaseDialog)->selectedRomMD5(); + return (static_cast(myBaseDialog))->selectedRomMD5(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const FilesystemNode& Launcher::currentNode() const { - return ((LauncherDialog*)myBaseDialog)->currentNode(); + return (static_cast(myBaseDialog))->currentNode(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Launcher::reload() { - ((LauncherDialog*)myBaseDialog)->reload(); + (static_cast(myBaseDialog))->reload(); } diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 357b96e86..6c565d6cd 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -69,7 +69,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent, fontHeight = font.getFontHeight(), bwidth = (_w - 2 * 10 - 8 * (4 - 1)) / 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; // Show game name @@ -88,7 +88,7 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent, // It has to fit between both labels if(w >= 640) { - fwidth = BSPF_min(15 * fontWidth, xpos - 20 - lwidth); + int fwidth = BSPF_min(15 * fontWidth, xpos - 20 - lwidth); xpos -= fwidth + 5; myPattern = new EditTextWidget(this, font, xpos, ypos, fwidth, fontHeight, ""); diff --git a/src/gui/ProgressDialog.cxx b/src/gui/ProgressDialog.cxx index 741d1991a..f5eed0c40 100644 --- a/src/gui/ProgressDialog.cxx +++ b/src/gui/ProgressDialog.cxx @@ -33,7 +33,8 @@ ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font, mySlider(NULL), myStart(0), myFinish(0), - myStep(0) + myStep(0), + myCurrentStep(0) { const int fontWidth = font.getMaxCharWidth(), fontHeight = font.getFontHeight(), diff --git a/src/gui/RomInfoWidget.cxx b/src/gui/RomInfoWidget.cxx index 70573b9ca..5467b55e2 100644 --- a/src/gui/RomInfoWidget.cxx +++ b/src/gui/RomInfoWidget.cxx @@ -30,12 +30,11 @@ RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font, : Widget(boss, font, x, y, w, h), mySurface(NULL), mySurfaceIsValid(false), - myHaveProperties(false) + myHaveProperties(false), + myAvail(w > 400 ? GUI::Size(640, 512) : GUI::Size(320, 256)) { _flags = WIDGET_ENABLED; _bgcolor = _bgcolorhi = kWidColor; - - myAvail = w > 400 ? GUI::Size(640, 512) : GUI::Size(320, 256); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/RomInfoWidget.hxx b/src/gui/RomInfoWidget.hxx index c1f004515..6b55af654 100644 --- a/src/gui/RomInfoWidget.hxx +++ b/src/gui/RomInfoWidget.hxx @@ -51,9 +51,6 @@ class RomInfoWidget : public Widget // Surface pointer holding the PNG image FBSurface* mySurface; - // How much space available for the PNG image - GUI::Size myAvail; - // Whether the surface should be redrawn by drawWidget() bool mySurfaceIsValid; @@ -68,6 +65,9 @@ class RomInfoWidget : public Widget // Indicates if an error occurred in creating/displaying the surface string mySurfaceErrorMsg; + + // How much space available for the PNG image + GUI::Size myAvail; }; #endif diff --git a/src/gui/TabWidget.cxx b/src/gui/TabWidget.cxx index 76a23a2a1..4f79d5309 100644 --- a/src/gui/TabWidget.cxx +++ b/src/gui/TabWidget.cxx @@ -106,6 +106,7 @@ void TabWidget::setActiveTab(int tabID, bool show) sendCommand(kTabChangedCmd, _activeTab, _id); } +#if 0 // FIXME // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void TabWidget::disableTab(int tabID) { @@ -114,6 +115,7 @@ void TabWidget::disableTab(int tabID) _tabs[tabID].enabled = false; // TODO - also disable all widgets belonging to this tab } +#endif // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void TabWidget::updateActiveTab() diff --git a/src/gui/TabWidget.hxx b/src/gui/TabWidget.hxx index 06ba4e5e2..8e54e8de8 100644 --- a/src/gui/TabWidget.hxx +++ b/src/gui/TabWidget.hxx @@ -45,7 +45,7 @@ class TabWidget : public Widget, public CommandSender //void removeTab(int tabID); // Setting the active tab: void setActiveTab(int tabID, bool show = false); - void disableTab(int tabID); +// void disableTab(int tabID); void activateTabs(); void cycleTab(int direction); // setActiveTab changes the value of _firstWidget. This means Widgets added afterwards diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 6f036c1b0..9111f25ee 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -300,6 +300,7 @@ StaticTextWidget::StaticTextWidget(GuiObject *boss, const GUI::Font& font, _textcolorhi = kTextColor; _label = text; + _editable = false; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -