From e64e0ea844a577c92b802c1572f6dcb735bb4371 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Thu, 19 Oct 2017 22:14:17 -0230 Subject: [PATCH] Fix compile errors when certain options are disabled by 'configure'. --- src/common/SoundNull.hxx | 13 ++++++------- src/emucore/Cart.cxx | 1 + src/emucore/CartFE.cxx | 1 + src/emucore/M6532.cxx | 3 +-- src/emucore/tia/TIA.hxx | 3 +-- src/gui/UIDialog.cxx | 2 ++ src/gui/UIDialog.hxx | 2 ++ src/gui/VideoDialog.cxx | 2 +- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/common/SoundNull.hxx b/src/common/SoundNull.hxx index 768da91d5..ba4f5f909 100644 --- a/src/common/SoundNull.hxx +++ b/src/common/SoundNull.hxx @@ -51,10 +51,9 @@ class SoundNull : public Sound /** Enables/disables the sound subsystem. - @param enable Either true or false, to enable or disable the sound system - @return Whether the sound system was enabled or disabled + @param state True or false, to enable or disable the sound system */ - void setEnabled(bool enable) override { } + void setEnabled(bool state) override { } /** Sets the number of channels (mono or stereo sound). @@ -93,7 +92,7 @@ class SoundNull : public Sound /** Reset the sound device. */ - void reset() { } + void reset() override { } /** Sets the sound register to a given value. @@ -128,7 +127,7 @@ class SoundNull : public Sound @param out The serializer device to save to. @return The result of the save. True on success, false on failure. */ - bool save(Serializer& out) const + bool save(Serializer& out) const override { out.putString("TIASound"); @@ -147,7 +146,7 @@ class SoundNull : public Sound @param in The Serializer device to load from. @return The result of the load. True on success, false on failure. */ - bool load(Serializer& in) + bool load(Serializer& in) override { if(in.getString() != "TIASound") return false; @@ -167,7 +166,7 @@ class SoundNull : public Sound @return The name of the object */ - string name() const { return "TIASound"; } + string name() const override { return "TIASound"; } private: // Following constructors and assignment operators not supported diff --git a/src/emucore/Cart.cxx b/src/emucore/Cart.cxx index efab74363..f3d07f6ec 100644 --- a/src/emucore/Cart.cxx +++ b/src/emucore/Cart.cxx @@ -16,6 +16,7 @@ //============================================================================ #include "Settings.hxx" +#include "System.hxx" #ifdef DEBUGGER_SUPPORT #include "Debugger.hxx" #include "CartDebug.hxx" diff --git a/src/emucore/CartFE.cxx b/src/emucore/CartFE.cxx index cabb070f3..ab10e831c 100644 --- a/src/emucore/CartFE.cxx +++ b/src/emucore/CartFE.cxx @@ -15,6 +15,7 @@ // this file, and for a DISCLAIMER OF ALL WARRANTIES. //============================================================================ +#include "M6532.hxx" #include "System.hxx" #include "CartFE.hxx" diff --git a/src/emucore/M6532.cxx b/src/emucore/M6532.cxx index 056414d6d..6149e313e 100644 --- a/src/emucore/M6532.cxx +++ b/src/emucore/M6532.cxx @@ -39,8 +39,7 @@ M6532::M6532(const Console& console, const Settings& settings) mySetTimerCycle(0), myLastCycle(0), myDDRA(0), myDDRB(0), myOutA(0), myOutB(0), myInterruptFlag(false), - myEdgeDetectPositive(false), - myRAMAccessBase(nullptr) + myEdgeDetectPositive(false) { } diff --git a/src/emucore/tia/TIA.hxx b/src/emucore/tia/TIA.hxx index d764a4397..0623ec6f7 100644 --- a/src/emucore/tia/TIA.hxx +++ b/src/emucore/tia/TIA.hxx @@ -750,17 +750,16 @@ class TIA : public Device bool myEnableJitter; uInt8 myJitterFactor; - #ifdef DEBUGGER_SUPPORT // The arrays containing information about every byte of TIA // indicating whether and how (RW) it is used. BytePtr myAccessBase; // The array used to skip the first two TIA access trackings BytePtr myAccessDelay; +#endif // DEBUGGER_SUPPORT static constexpr uInt16 TIA_SIZE = 0x40, TIA_MASK = TIA_SIZE - 1, TIA_READ_MASK = 0x0f, TIA_BIT = 0x080, TIA_DELAY = 2; -#endif // DEBUGGER_SUPPORT private: TIA() = delete; diff --git a/src/gui/UIDialog.cxx b/src/gui/UIDialog.cxx index 565ad7844..7b6ab92af 100644 --- a/src/gui/UIDialog.cxx +++ b/src/gui/UIDialog.cxx @@ -384,6 +384,7 @@ void UIDialog::saveConfig() instance().settings().setValue("exitlauncher", myLauncherExitPopup->getSelectedTag().toString()); +#ifdef DEBUGGER_SUPPORT // Debugger size instance().settings().setValue("dbg.res", GUI::Size(myDebuggerWidthSlider->getValue(), @@ -392,6 +393,7 @@ void UIDialog::saveConfig() // Debugger font style instance().settings().setValue("dbg.fontstyle", myDebuggerFontStyle->getSelectedTag().toString()); +#endif // UI palette instance().settings().setValue("uipalette", diff --git a/src/gui/UIDialog.hxx b/src/gui/UIDialog.hxx index 52409d04c..1f885fd35 100644 --- a/src/gui/UIDialog.hxx +++ b/src/gui/UIDialog.hxx @@ -55,12 +55,14 @@ class UIDialog : public Dialog PopUpWidget* myLauncherFontPopup; PopUpWidget* myRomViewerPopup; +#ifdef DEBUGGER_SUPPORT // Debugger options SliderWidget* myDebuggerWidthSlider; StaticTextWidget* myDebuggerWidthLabel; SliderWidget* myDebuggerHeightSlider; StaticTextWidget* myDebuggerHeightLabel; PopUpWidget* myDebuggerFontStyle; +#endif // Misc options PopUpWidget* myPalettePopup; diff --git a/src/gui/VideoDialog.cxx b/src/gui/VideoDialog.cxx index 1a35df895..3977fb27a 100644 --- a/src/gui/VideoDialog.cxx +++ b/src/gui/VideoDialog.cxx @@ -382,7 +382,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent, // Disable certain functions when we know they aren't present #ifndef WINDOWED_SUPPORT - myFullscreenCheckbox->clearFlags(WIDGET_ENABLED); + myFullscreen->clearFlags(WIDGET_ENABLED); myCenter->clearFlags(WIDGET_ENABLED); #endif }