Skip to content

Commit

Permalink
fixed compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fdivitto committed Jan 27, 2021
1 parent 94f95c2 commit a075583
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion examples/VGA/ClassicRacer/controllers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; };
Expand Down
2 changes: 1 addition & 1 deletion examples/VGA/ClassicRacer/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion examples/VGA/ClassicRacer/race.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions examples/VGA/ClassicRacer/score.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion examples/VGA/ClassicRacer/soundchip.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion examples/VGA/DirectVGA_ElMuro/controllers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; };
Expand Down
2 changes: 1 addition & 1 deletion examples/VGA/DirectVGA_ElMuro/soundchip.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions examples/VGA/Songs/Songs.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
13 changes: 9 additions & 4 deletions examples/VGA/VIC20/VIC20.ino
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ class Menu : public uiApp {
case VirtualKey::VK_F12:
runVIC20();
break;
// just to avoid compiler warning
default:
break;
}
};

Expand All @@ -372,6 +375,9 @@ class Menu : public uiApp {
updateFreeSpaceLabel();
}
break;
// just to avoid compiler warning
default:
break;
}
};

Expand Down Expand Up @@ -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)
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -893,4 +899,3 @@ void loop()
auto menu = new Menu;
menu->run(&DisplayController);
}

6 changes: 4 additions & 2 deletions src/devdrivers/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down Expand Up @@ -560,6 +560,8 @@ VirtualKey Keyboard::scancodeToVK(uint8_t scancode, bool isExtended, KeyboardLay
case VK_KP_PAGEUP:
vk = VK_KP_9;
break;
default:
break;
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/dispdrivers/vgadirectcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a075583

Please sign in to comment.