diff --git a/examples/VGA/ClassicRacer/controllers.h b/examples/VGA/ClassicRacer/controllers.h index 5378faffe..c76e1e8b4 100644 --- a/examples/VGA/ClassicRacer/controllers.h +++ b/examples/VGA/ClassicRacer/controllers.h @@ -11,7 +11,7 @@ struct GameController int id = 0; // device number assigned by client bool active = false; - GameController( int id_, gcmode mode_) : id( id_ ), mode(mode_) { } + GameController( int id_, gcmode mode_) : mode(mode_), id( id_ ) { } virtual bool isLeft() { return false; }; virtual bool isRight() { return false; }; diff --git a/examples/VGA/ClassicRacer/menu.h b/examples/VGA/ClassicRacer/menu.h index c84339bff..b68344376 100644 --- a/examples/VGA/ClassicRacer/menu.h +++ b/examples/VGA/ClassicRacer/menu.h @@ -20,7 +20,7 @@ struct Menu : public Scene long menulastactivity = 0; int exitValue = -1; - char *textControls[6] = { ".......", " MOUSE ", "JOYSTICK", " ARROWS ", "A S T F ", "Q A O P" }; + char const *textControls[6] = { ".......", " MOUSE ", "JOYSTICK", " ARROWS ", "A S T F ", "Q A O P" }; bool lockedControls[6] = { false, false, false, false,false,false }; void init() diff --git a/examples/VGA/ClassicRacer/race.h b/examples/VGA/ClassicRacer/race.h index 0029bc3c6..893a3a0d7 100644 --- a/examples/VGA/ClassicRacer/race.h +++ b/examples/VGA/ClassicRacer/race.h @@ -534,7 +534,7 @@ struct Race : public Scene sprintf( buffer, "SCORE: %4d", players[player].points ); slowDrawText( players[player].minx + 2 * 8 + 1, 11 * 8, buffer ); - sprintf( buffer, "TIME : %02d:%02d", (currentTime / 1000) / 60, (currentTime / 1000) % 60 ); + sprintf( buffer, "TIME : %02ld:%02ld", (currentTime / 1000) / 60, (currentTime / 1000) % 60 ); slowDrawText( players[player].minx + 2 * 8 + 1, 12 * 8, buffer ); sprintf( buffer, "CARS : %4d", players[player].cars ); diff --git a/examples/VGA/ClassicRacer/score.h b/examples/VGA/ClassicRacer/score.h index 06bc1d4e0..be741bd9e 100644 --- a/examples/VGA/ClassicRacer/score.h +++ b/examples/VGA/ClassicRacer/score.h @@ -173,7 +173,7 @@ struct Score : public Scene bitmap_mouse_data, bitmap_joystick_data, bitmap_keybb_data, bitmap_keyba_data, bitmap_keybo_data }; - int nselected = 1; + //int nselected = 1; canvas.setBrushColor(RGB888(0, 0xff, 0)); canvas.clear(); @@ -310,7 +310,7 @@ struct Score : public Scene } } - canvas.setPenColor(millis()%250 > 125 == 0 ? RGB888(0,255,0):scorecolors[editItem] ); + canvas.setPenColor( millis() % 250 == 0 ? RGB888(0,255,0) : scorecolors[editItem] ); canvas.setBrushColor(RGB888(0,255,0) ); canvas.drawChar((9+editInitial)*8, 12*8, top[editItem].initials[editInitial]); canvas.waitCompletion(); diff --git a/examples/VGA/ClassicRacer/soundchip.h b/examples/VGA/ClassicRacer/soundchip.h index 0b6445a13..6e7997994 100644 --- a/examples/VGA/ClassicRacer/soundchip.h +++ b/examples/VGA/ClassicRacer/soundchip.h @@ -29,7 +29,7 @@ void iPlaySound( void *pvParameters ) { playsounddata psd = *(playsounddata *)pvParameters; - WaveformGenerator *pwave; + WaveformGenerator *pwave = nullptr; if ( psd.wave == WAVE_SQUARE) pwave = new SquareWaveformGenerator(); if ( psd.wave == WAVE_SINE) pwave = new SineWaveformGenerator(); if ( psd.wave == WAVE_TRIANGLE) pwave = new TriangleWaveformGenerator(); diff --git a/examples/VGA/DirectVGA_ElMuro/controllers.h b/examples/VGA/DirectVGA_ElMuro/controllers.h index 5378faffe..8c16968ca 100644 --- a/examples/VGA/DirectVGA_ElMuro/controllers.h +++ b/examples/VGA/DirectVGA_ElMuro/controllers.h @@ -11,7 +11,7 @@ struct GameController int id = 0; // device number assigned by client bool active = false; - GameController( int id_, gcmode mode_) : id( id_ ), mode(mode_) { } + GameController( int id_, gcmode mode_) : mode(mode_), id( id_ ) { } virtual bool isLeft() { return false; }; virtual bool isRight() { return false; }; diff --git a/examples/VGA/DirectVGA_ElMuro/soundchip.h b/examples/VGA/DirectVGA_ElMuro/soundchip.h index 7e390ffe3..f62b9d71c 100644 --- a/examples/VGA/DirectVGA_ElMuro/soundchip.h +++ b/examples/VGA/DirectVGA_ElMuro/soundchip.h @@ -29,7 +29,7 @@ void iPlaySound( void *pvParameters ) { playsounddata psd = *(playsounddata *)pvParameters; - WaveformGenerator *pwave; + WaveformGenerator *pwave = nullptr; if ( psd.wave == WAVE_SQUARE) pwave = new SquareWaveformGenerator(); if ( psd.wave == WAVE_SINE) pwave = new SineWaveformGenerator(); if ( psd.wave == WAVE_TRIANGLE) pwave = new TriangleWaveformGenerator(); diff --git a/examples/VGA/Songs/Songs.ino b/examples/VGA/Songs/Songs.ino index 3148a9f63..498320a1d 100644 --- a/examples/VGA/Songs/Songs.ino +++ b/examples/VGA/Songs/Songs.ino @@ -63,7 +63,7 @@ void iPlaySound( void *pvParameters ) { playsounddata psd = *(playsounddata *)pvParameters; - WaveformGenerator *pwave; + WaveformGenerator *pwave = nullptr; if ( psd.wave == WAVE_SQUARE) pwave = new SquareWaveformGenerator(); if ( psd.wave == WAVE_SINE) pwave = new SineWaveformGenerator(); if ( psd.wave == WAVE_TRIANGLE) pwave = new TriangleWaveformGenerator(); @@ -200,7 +200,7 @@ char const * noteToDelayEx(char const * note, int * delayMS) if (val > 0) *delayMS = 250 * val; - while (*note && isdigit(*note) || *note == '.') + while ((*note && isdigit(*note)) || *note == '.') ++note; return note; diff --git a/examples/VGA/VIC20/VIC20.ino b/examples/VGA/VIC20/VIC20.ino index 288a641ae..504bba32f 100644 --- a/examples/VGA/VIC20/VIC20.ino +++ b/examples/VGA/VIC20/VIC20.ino @@ -351,6 +351,9 @@ class Menu : public uiApp { case VirtualKey::VK_F12: runVIC20(); break; + // just to avoid compiler warning + default: + break; } }; @@ -372,6 +375,9 @@ class Menu : public uiApp { updateFreeSpaceLabel(); } break; + // just to avoid compiler warning + default: + break; } }; @@ -430,7 +436,7 @@ class Menu : public uiApp { // RAM expansion options y += 50; - auto lbl = new uiLabel(rootWindow(), "RAM Expansion:", Point(150, y), Size(0, 0), true, STYLE_LABELGROUP); + new uiLabel(rootWindow(), "RAM Expansion:", Point(150, y), Size(0, 0), true, STYLE_LABELGROUP); RAMExpComboBox = new uiComboBox(rootWindow(), Point(158, y + 20), Size(75, 19), 130, true, STYLE_COMBOBOX); char const * RAMOPTS[] = { "Unexpanded", "3K", "8K", "16K", "24K", "27K (24K+3K)", "32K", "35K (32K+3K)" }; for (int i = 0; i < 8; ++i) @@ -442,7 +448,7 @@ class Menu : public uiApp { // joystick emulation options y += 50; - lbl = new uiLabel(rootWindow(), "Joystick:", Point(150, y), Size(0, 0), true, STYLE_LABELGROUP); + new uiLabel(rootWindow(), "Joystick:", Point(150, y), Size(0, 0), true, STYLE_LABELGROUP); new uiLabel(rootWindow(), "None", Point(180, y + 21), Size(0, 0), true, STYLE_LABEL); auto radioJNone = new uiCheckBox(rootWindow(), Point(158, y + 20), Size(16, 16), uiCheckBoxKind::RadioButton, true, STYLE_CHECKBOX); new uiLabel(rootWindow(), "Cursor Keys", Point(180, y + 41), Size(0, 0), true, STYLE_LABEL); @@ -464,7 +470,7 @@ class Menu : public uiApp { updateFreeSpaceLabel(); // "Download From" label - auto downloadFromLbl = new uiLabel(rootWindow(), "Download From:", Point(5, 326), Size(0, 0), true, STYLE_LABELGROUP); + new uiLabel(rootWindow(), "Download From:", Point(5, 326), Size(0, 0), true, STYLE_LABELGROUP); // Download List button (download programs listed and linked in LIST_URL) auto downloadProgsBtn = new uiButton(rootWindow(), "List", Point(13, 345), Size(27, 20), uiButtonKind::Button, true, STYLE_BUTTON); @@ -893,4 +899,3 @@ void loop() auto menu = new Menu; menu->run(&DisplayController); } - diff --git a/src/devdrivers/keyboard.cpp b/src/devdrivers/keyboard.cpp index 5295bb823..e413d885d 100644 --- a/src/devdrivers/keyboard.cpp +++ b/src/devdrivers/keyboard.cpp @@ -45,8 +45,8 @@ int Keyboard::scancodeToVirtualKeyTaskStackSize = FABGLIB_DEFAULT_SCODETOVK_TASK Keyboard::Keyboard() : m_keyboardAvailable(false), - m_lastDeadKey(VK_NONE), - m_scancodeSet(2) + m_scancodeSet(2), + m_lastDeadKey(VK_NONE) { } @@ -560,6 +560,8 @@ VirtualKey Keyboard::scancodeToVK(uint8_t scancode, bool isExtended, KeyboardLay case VK_KP_PAGEUP: vk = VK_KP_9; break; + default: + break; } } diff --git a/src/dispdrivers/vgadirectcontroller.cpp b/src/dispdrivers/vgadirectcontroller.cpp index cfdb6091d..5d4199841 100755 --- a/src/dispdrivers/vgadirectcontroller.cpp +++ b/src/dispdrivers/vgadirectcontroller.cpp @@ -64,10 +64,10 @@ bool VGADirectController::s_VSync; VGADirectController::VGADirectController(bool autoRun) - : m_drawScanlineCallback(nullptr), - m_autoRun(autoRun), - m_linesCount(2), - m_lines(nullptr) + : m_linesCount(2), + m_lines(nullptr), + m_drawScanlineCallback(nullptr), + m_autoRun(autoRun) { s_instance = this; }