diff --git a/src/common/LinkedObjectPool.hxx b/src/common/LinkedObjectPool.hxx index 2619acba7..01ce503b3 100644 --- a/src/common/LinkedObjectPool.hxx +++ b/src/common/LinkedObjectPool.hxx @@ -199,6 +199,8 @@ class LinkedObjectPool const_iter begin() const { return myList.cbegin(); } const_iter end() const { return myList.cend(); } + uInt32 capacity() const { return CAPACITY; } + uInt32 size() const { return myList.size(); } bool empty() const { return myList.size() == 0; } bool full() const { return myList.size() >= CAPACITY; } diff --git a/src/common/RewindManager.cxx b/src/common/RewindManager.cxx index e628838f6..42c0ad6b8 100644 --- a/src/common/RewindManager.cxx +++ b/src/common/RewindManager.cxx @@ -171,7 +171,7 @@ void RewindManager::compressStates() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string RewindManager::getMessage(RewindState& state) { - Int32 diff = Int32(myOSystem.console().tia().cycles() - state.cycle); + Int64 diff = myOSystem.console().tia().cycles() - state.cycle; stringstream message; message << (diff >= 0 ? "Rewind" : "Unwind") << " " << getUnitString(diff); @@ -183,7 +183,7 @@ string RewindManager::getMessage(RewindState& state) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -string RewindManager::getUnitString(Int32 cycles) +string RewindManager::getUnitString(Int64 cycles) { const Int32 scanlines = std::max(myOSystem.console().tia().scanlinesLastFrame(), 240u); const bool isNTSC = scanlines <= 285; // TODO: replace magic number @@ -194,8 +194,8 @@ string RewindManager::getUnitString(Int32 cycles) // TODO: do we need hours here? don't think so const Int32 NUM_UNITS = 5; const string UNIT_NAMES[NUM_UNITS] = { "cycle", "scanline", "frame", "second", "minute" }; - const Int32 UNIT_CYCLES[NUM_UNITS + 1] = { 1, 76, 76 * scanlines, freq, - freq * 60, 1 << 31 }; + const Int64 UNIT_CYCLES[NUM_UNITS + 1] = { 1, 76, 76 * scanlines, freq, + freq * 60, Int64(1) << 62 }; stringstream result; Int32 i; diff --git a/src/common/RewindManager.hxx b/src/common/RewindManager.hxx index 1521385ff..42d7d1cda 100644 --- a/src/common/RewindManager.hxx +++ b/src/common/RewindManager.hxx @@ -73,7 +73,7 @@ class RewindManager /** Convert the cycles into a unit string. */ - string getUnitString(Int32 cycles); + string getUnitString(Int64 cycles); private: // Maximum number of states to save diff --git a/src/common/StateManager.hxx b/src/common/StateManager.hxx index 889e5aa37..5e7b83c10 100644 --- a/src/common/StateManager.hxx +++ b/src/common/StateManager.hxx @@ -69,7 +69,7 @@ class StateManager Sets state rewind recording mode; this uses the RewindManager for its functionality. */ - void setRewindMode(Mode mode) { myActiveMode = mode; }; + void setRewindMode(Mode mode) { myActiveMode = mode; } /** Rewinds one state; this uses the RewindManager for its functionality. diff --git a/src/debugger/Debugger.cxx b/src/debugger/Debugger.cxx index 80f2bb673..c8e39d48a 100644 --- a/src/debugger/Debugger.cxx +++ b/src/debugger/Debugger.cxx @@ -544,7 +544,7 @@ uInt16 Debugger::windStates(uInt16 states, bool unwind, string& message) winds++; else break; - message = r.getUnitString(Int32(myOSystem.console().tia().cycles() - startCycles)); + message = r.getUnitString(myOSystem.console().tia().cycles() - startCycles); lockBankswitchState(); diff --git a/src/debugger/gui/AudioWidget.cxx b/src/debugger/gui/AudioWidget.cxx index b977295f5..da7441ad5 100644 --- a/src/debugger/gui/AudioWidget.cxx +++ b/src/debugger/gui/AudioWidget.cxx @@ -52,7 +52,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont, for(int col = 0; col < 2; ++col) { - new StaticTextWidget(boss, lfont, xpos + col * myAudF->colWidth() + (int)(myAudF->colWidth() / 2.75), + new StaticTextWidget(boss, lfont, xpos + col * myAudF->colWidth() + int(myAudF->colWidth() / 2.75), ypos - lineHeight, fontWidth, fontHeight, Common::Base::toString(col, Common::Base::F_16_1), kTextAlignLeft); @@ -63,7 +63,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont, new StaticTextWidget(boss, lfont, xpos, ypos+2, lwidth, fontHeight, "AUDC", kTextAlignLeft); xpos += lwidth; - myAudC = new DataGridWidget(boss, nfont, xpos + (int)(myAudF->colWidth() / 2.75), ypos, + myAudC = new DataGridWidget(boss, nfont, xpos + int(myAudF->colWidth() / 2.75), ypos, 2, 1, 1, 4, Common::Base::F_16_1); myAudC->setTarget(this); myAudC->setID(kAUDCID); @@ -74,7 +74,7 @@ AudioWidget::AudioWidget(GuiObject* boss, const GUI::Font& lfont, new StaticTextWidget(boss, lfont, xpos, ypos+2, lwidth, fontHeight, "AUDV", kTextAlignLeft); xpos += lwidth; - myAudV = new DataGridWidget(boss, nfont, xpos + (int)(myAudF->colWidth() / 2.75), ypos, + myAudV = new DataGridWidget(boss, nfont, xpos + int(myAudF->colWidth() / 2.75), ypos, 2, 1, 1, 4, Common::Base::F_16_1); myAudV->setTarget(this); myAudV->setID(kAUDVID); diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index c5da76987..098cebbb6 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -608,7 +608,7 @@ void DeveloperDialog::loadConfig() loadSettings(SettingsSet::player); loadSettings(SettingsSet::developer); // ...and select the current one - setWidgetStates((SettingsSet)mySettingsGroup0->getSelected()); + setWidgetStates(SettingsSet(mySettingsGroup0->getSelected())); // Debug colours handleDebugColours(instance().settings().getString("tia.dbgcolors")); @@ -644,7 +644,7 @@ void DeveloperDialog::saveConfig() { instance().settings().setValue("dev.settings", mySettingsGroup0->getSelected() == SettingsSet::developer); // copy current widget status into set... - getWidgetStates((SettingsSet)mySettingsGroup0->getSelected()); + getWidgetStates(SettingsSet(mySettingsGroup0->getSelected())); // ...and save both sets saveSettings(SettingsSet::player); saveSettings(SettingsSet::developer); @@ -728,7 +728,7 @@ void DeveloperDialog::saveConfig() void DeveloperDialog::setDefaults() { bool devSettings = mySettingsGroup0->getSelected() == 1; - SettingsSet set = (SettingsSet)mySettingsGroup0->getSelected(); + SettingsSet set = SettingsSet(mySettingsGroup0->getSelected()); switch(myTab->getActiveTab()) { @@ -1195,14 +1195,14 @@ void DeveloperDialog::handleFontSize() minH = std::min(instance().frameBuffer().desktopSize().h, minH); myDebuggerWidthSlider->setMinValue(minW); - if(minW > myDebuggerWidthSlider->getValue()) + if(minW > uInt32(myDebuggerWidthSlider->getValue())) { myDebuggerWidthSlider->setValue(minW); myDebuggerWidthLabel->setValue(minW); } myDebuggerHeightSlider->setMinValue(minH); - if(minH > myDebuggerHeightSlider->getValue()) + if(minH > uInt32(myDebuggerHeightSlider->getValue())) { myDebuggerHeightSlider->setValue(minH); myDebuggerHeightLabel->setValue(minH); diff --git a/src/gui/DeveloperDialog.hxx b/src/gui/DeveloperDialog.hxx index 500f3101a..fa5461f57 100644 --- a/src/gui/DeveloperDialog.hxx +++ b/src/gui/DeveloperDialog.hxx @@ -96,7 +96,7 @@ class DeveloperDialog : public Dialog const string HORIZONS[NUM_HORIZONS] = { "~1 frame", "~10 frames", "~1 second", "~10 seconds", "~1 minute", "~10 minutes", "~60 minutes" }; const uInt64 HORIZON_CYCLES[NUM_HORIZONS] = { 76 * 262, 76 * 262 * 10, 76 * 262 * 60, 76 * 262 * 60 * 10, - 76 * 262 * 60 * 60, 76 * 262 * 60 * 60 * 10, (uInt64)76 * 262 * 60 * 60 * 60 }; + 76 * 262 * 60 * 60, 76 * 262 * 60 * 60 * 10, uInt64(76) * 262 * 60 * 60 * 60 }; static const int DEBUG_COLORS = 6; diff --git a/src/gui/RadioButtonWidget.cxx b/src/gui/RadioButtonWidget.cxx index 1e8000b41..0e9e58a26 100644 --- a/src/gui/RadioButtonWidget.cxx +++ b/src/gui/RadioButtonWidget.cxx @@ -201,7 +201,7 @@ void RadioButtonGroup::setSelected(uInt32 selected) mySelected = selected; for(const auto& w : myWidgets) { - ((RadioButtonWidget*)w)->setState(i == mySelected); + (static_cast(w))->setState(i == mySelected); i++; } } diff --git a/src/gui/RadioButtonWidget.hxx b/src/gui/RadioButtonWidget.hxx index e33b6d0e0..44cefad06 100644 --- a/src/gui/RadioButtonWidget.hxx +++ b/src/gui/RadioButtonWidget.hxx @@ -56,14 +56,14 @@ class RadioButtonWidget : public CheckboxWidget class RadioButtonGroup { public: - RadioButtonGroup() {}; + RadioButtonGroup() = default; // add widget to group void addWidget(RadioButtonWidget* widget); // tell the group which widget was selected void select(RadioButtonWidget* widget); void setSelected(uInt32 selected); - uInt32 getSelected() { return mySelected; }; + uInt32 getSelected() { return mySelected; } private: WidgetArray myWidgets;