Fixed warnings from Xcode (some pretty big issues were caught here)

This commit is contained in:
Stephen Anthony 2018-02-03 20:44:46 -03:30
parent 1f1ced0f01
commit 77f2c478a0
4 changed files with 11 additions and 11 deletions

View File

@ -308,13 +308,13 @@ string RewindManager::getUnitString(Int64 cycles)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 RewindManager::getFirstCycles() const uInt64 RewindManager::getFirstCycles() const
{ {
return !myStateList.empty() ? myStateList.first()->cycles : 0; return !myStateList.empty() ? myStateList.first()->cycles : 0;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 RewindManager::getCurrentCycles() const uInt64 RewindManager::getCurrentCycles() const
{ {
if(myStateList.currentIsValid()) if(myStateList.currentIsValid())
return myStateList.current().cycles; return myStateList.current().cycles;
@ -323,7 +323,7 @@ uInt32 RewindManager::getCurrentCycles() const
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 RewindManager::getLastCycles() const uInt64 RewindManager::getLastCycles() const
{ {
return !myStateList.empty() ? myStateList.last()->cycles : 0; return !myStateList.empty() ? myStateList.last()->cycles : 0;
} }

View File

@ -149,9 +149,9 @@ class RewindManager
uInt32 getCurrentIdx() { return myStateList.currentIdx(); } uInt32 getCurrentIdx() { return myStateList.currentIdx(); }
uInt32 getLastIdx() { return myStateList.size(); } uInt32 getLastIdx() { return myStateList.size(); }
uInt32 getFirstCycles() const; uInt64 getFirstCycles() const;
uInt32 getCurrentCycles() const; uInt64 getCurrentCycles() const;
uInt32 getLastCycles() const; uInt64 getLastCycles() const;
/** /**
Get a collection of cycle timestamps, offset from the first one in Get a collection of cycle timestamps, offset from the first one in

View File

@ -161,7 +161,7 @@ void TimeLineWidget::drawWidget(bool hilite)
int numTicks = std::min(5, int(_stepValue.size())); int numTicks = std::min(5, int(_stepValue.size()));
for(int i = 1; i < numTicks; ++i) for(int i = 1; i < numTicks; ++i)
{ {
int idx = (_stepValue.size() * i + numTicks / 2) / numTicks; int idx = int((_stepValue.size() * i + numTicks / 2) / numTicks);
if(idx > 1) if(idx > 1)
{ {
int tp = valueToPos(idx - 1); int tp = valueToPos(idx - 1);

View File

@ -212,7 +212,7 @@ void TimeMachineDialog::loadConfig()
IntArray cycles = r.cyclesList(); IntArray cycles = r.cyclesList();
// Set range and intervals for timeline // Set range and intervals for timeline
myTimeline->setMaxValue(cycles.size() - 1); myTimeline->setMaxValue(int(cycles.size()) - 1);
myTimeline->setStepValues(cycles); myTimeline->setStepValues(cycles);
// Enable blending (only once is necessary) // Enable blending (only once is necessary)
@ -319,11 +319,11 @@ string TimeMachineDialog::getTimeString(uInt64 cycles)
const Int32 PAL_FREQ = 1182298; // ~76*312*50 const Int32 PAL_FREQ = 1182298; // ~76*312*50
const Int32 freq = isNTSC ? NTSC_FREQ : PAL_FREQ; // = cycles/second const Int32 freq = isNTSC ? NTSC_FREQ : PAL_FREQ; // = cycles/second
uInt32 minutes = cycles / (freq * 60); uInt32 minutes = uInt32(cycles / (freq * 60));
cycles -= minutes * (freq * 60); cycles -= minutes * (freq * 60);
uInt32 seconds = cycles / freq; uInt32 seconds = uInt32(cycles / freq);
cycles -= seconds * freq; cycles -= seconds * freq;
uInt32 frames = cycles / (scanlines * 76); uInt32 frames = uInt32(cycles / (scanlines * 76));
ostringstream time; ostringstream time;
time << Common::Base::toString(minutes, Common::Base::F_10_2) << ":"; time << Common::Base::toString(minutes, Common::Base::F_10_2) << ":";