Fixes for minor warnings from cppcheck.

This commit is contained in:
Stephen Anthony 2018-11-19 11:08:44 -03:30
parent a8a0c57deb
commit f3a185f04a
9 changed files with 16 additions and 9 deletions

View File

@ -307,7 +307,7 @@ bool Playfield::save(Serializer& out) const
out.putByte(myDebugColor);
out.putBool(myDebugEnabled);
out.putByte(myColorMode);
out.putByte(uInt8(myColorMode));
out.putInt(myPattern);
out.putInt(myEffectivePattern);

View File

@ -76,7 +76,7 @@ class Playfield : public Serializable
private:
enum ColorMode: uInt8 {normal, score};
enum class ColorMode: uInt8 {normal, score};
private:

View File

@ -484,13 +484,13 @@ class TIA : public Device
/**
* During each line, the TIA cycles through these two states.
*/
enum HState {blank, frame};
enum class HState {blank, frame};
/**
* The three different modes of the priority encoder. Check TIA::renderPixel
* for a precise definition.
*/
enum Priority {pfp, score, normal};
enum class Priority {pfp, score, normal};
/**
* Palette and indices for fixed debug colors.

View File

@ -19,6 +19,9 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AbstractFrameManager::AbstractFrameManager() :
myIsRendering(false),
myVsync(false),
myVblank(false),
myLayout(FrameLayout::pal),
myOnFrameStart(nullptr),
myOnFrameComplete(nullptr)

View File

@ -44,6 +44,7 @@ FrameLayout FrameLayoutDetector::detectedLayout() const{
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FrameLayoutDetector::FrameLayoutDetector()
: myState(State::waitForVsyncStart)
{
reset();
}

View File

@ -59,7 +59,7 @@ class FrameLayoutDetector: public AbstractFrameManager {
/**
* This frame manager only tracks frame boundaries, so we have only two states.
*/
enum State {
enum class State {
// Wait for VSYNC to be enabled.
waitForVsyncStart,

View File

@ -66,7 +66,7 @@ class FrameManager: public AbstractFrameManager {
private:
enum State {
enum class State {
waitForVsyncStart,
waitForVsyncEnd,
waitForFrameStart,
@ -75,7 +75,7 @@ class FrameManager: public AbstractFrameManager {
private:
void setState(State state);
void setState(State state);
void updateIsRendering();

View File

@ -48,6 +48,9 @@ enum Metrics: uInt32 {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
YStartDetector::YStartDetector()
: myState(State::waitForVsyncStart),
myVblankMode(VblankMode::floating),
myVblankViolated(false)
{
reset();
}

View File

@ -64,7 +64,7 @@ class YStartDetector: public AbstractFrameManager {
/**
* Our various states.
*/
enum State {
enum class State {
// Wait for vsync on
waitForVsyncStart,
@ -78,7 +78,7 @@ class YStartDetector: public AbstractFrameManager {
/**
* Have we settled on a frame start?
*/
enum VblankMode {
enum class VblankMode {
// We have settled on a frame start and have some hysteresis before we return to floating
locked,