Skip to content

Commit a075583

Browse files
committed
fixed compiler warnings
1 parent 94f95c2 commit a075583

File tree

11 files changed

+27
-20
lines changed

11 files changed

+27
-20
lines changed

examples/VGA/ClassicRacer/controllers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct GameController
1111
int id = 0; // device number assigned by client
1212
bool active = false;
1313

14-
GameController( int id_, gcmode mode_) : id( id_ ), mode(mode_) { }
14+
GameController( int id_, gcmode mode_) : mode(mode_), id( id_ ) { }
1515

1616
virtual bool isLeft() { return false; };
1717
virtual bool isRight() { return false; };

examples/VGA/ClassicRacer/menu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct Menu : public Scene
2020

2121
long menulastactivity = 0;
2222
int exitValue = -1;
23-
char *textControls[6] = { ".......", " MOUSE ", "JOYSTICK", " ARROWS ", "A S T F ", "Q A O P" };
23+
char const *textControls[6] = { ".......", " MOUSE ", "JOYSTICK", " ARROWS ", "A S T F ", "Q A O P" };
2424
bool lockedControls[6] = { false, false, false, false,false,false };
2525

2626
void init()

examples/VGA/ClassicRacer/race.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ struct Race : public Scene
534534
sprintf( buffer, "SCORE: %4d", players[player].points );
535535
slowDrawText( players[player].minx + 2 * 8 + 1, 11 * 8, buffer );
536536

537-
sprintf( buffer, "TIME : %02d:%02d", (currentTime / 1000) / 60, (currentTime / 1000) % 60 );
537+
sprintf( buffer, "TIME : %02ld:%02ld", (currentTime / 1000) / 60, (currentTime / 1000) % 60 );
538538
slowDrawText( players[player].minx + 2 * 8 + 1, 12 * 8, buffer );
539539

540540
sprintf( buffer, "CARS : %4d", players[player].cars );

examples/VGA/ClassicRacer/score.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ struct Score : public Scene
173173
bitmap_mouse_data, bitmap_joystick_data,
174174
bitmap_keybb_data, bitmap_keyba_data, bitmap_keybo_data };
175175

176-
int nselected = 1;
176+
//int nselected = 1;
177177

178178
canvas.setBrushColor(RGB888(0, 0xff, 0));
179179
canvas.clear();
@@ -310,7 +310,7 @@ struct Score : public Scene
310310
}
311311
}
312312

313-
canvas.setPenColor(millis()%250 > 125 == 0 ? RGB888(0,255,0):scorecolors[editItem] );
313+
canvas.setPenColor( millis() % 250 == 0 ? RGB888(0,255,0) : scorecolors[editItem] );
314314
canvas.setBrushColor(RGB888(0,255,0) );
315315
canvas.drawChar((9+editInitial)*8, 12*8, top[editItem].initials[editInitial]);
316316
canvas.waitCompletion();

examples/VGA/ClassicRacer/soundchip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void iPlaySound( void *pvParameters )
2929
{
3030
playsounddata psd = *(playsounddata *)pvParameters;
3131

32-
WaveformGenerator *pwave;
32+
WaveformGenerator *pwave = nullptr;
3333
if ( psd.wave == WAVE_SQUARE) pwave = new SquareWaveformGenerator();
3434
if ( psd.wave == WAVE_SINE) pwave = new SineWaveformGenerator();
3535
if ( psd.wave == WAVE_TRIANGLE) pwave = new TriangleWaveformGenerator();

examples/VGA/DirectVGA_ElMuro/controllers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct GameController
1111
int id = 0; // device number assigned by client
1212
bool active = false;
1313

14-
GameController( int id_, gcmode mode_) : id( id_ ), mode(mode_) { }
14+
GameController( int id_, gcmode mode_) : mode(mode_), id( id_ ) { }
1515

1616
virtual bool isLeft() { return false; };
1717
virtual bool isRight() { return false; };

examples/VGA/DirectVGA_ElMuro/soundchip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void iPlaySound( void *pvParameters )
2929
{
3030
playsounddata psd = *(playsounddata *)pvParameters;
3131

32-
WaveformGenerator *pwave;
32+
WaveformGenerator *pwave = nullptr;
3333
if ( psd.wave == WAVE_SQUARE) pwave = new SquareWaveformGenerator();
3434
if ( psd.wave == WAVE_SINE) pwave = new SineWaveformGenerator();
3535
if ( psd.wave == WAVE_TRIANGLE) pwave = new TriangleWaveformGenerator();

examples/VGA/Songs/Songs.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void iPlaySound( void *pvParameters )
6363
{
6464
playsounddata psd = *(playsounddata *)pvParameters;
6565

66-
WaveformGenerator *pwave;
66+
WaveformGenerator *pwave = nullptr;
6767
if ( psd.wave == WAVE_SQUARE) pwave = new SquareWaveformGenerator();
6868
if ( psd.wave == WAVE_SINE) pwave = new SineWaveformGenerator();
6969
if ( psd.wave == WAVE_TRIANGLE) pwave = new TriangleWaveformGenerator();
@@ -200,7 +200,7 @@ char const * noteToDelayEx(char const * note, int * delayMS)
200200
if (val > 0)
201201
*delayMS = 250 * val;
202202

203-
while (*note && isdigit(*note) || *note == '.')
203+
while ((*note && isdigit(*note)) || *note == '.')
204204
++note;
205205

206206
return note;

examples/VGA/VIC20/VIC20.ino

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ class Menu : public uiApp {
351351
case VirtualKey::VK_F12:
352352
runVIC20();
353353
break;
354+
// just to avoid compiler warning
355+
default:
356+
break;
354357
}
355358
};
356359

@@ -372,6 +375,9 @@ class Menu : public uiApp {
372375
updateFreeSpaceLabel();
373376
}
374377
break;
378+
// just to avoid compiler warning
379+
default:
380+
break;
375381
}
376382
};
377383

@@ -430,7 +436,7 @@ class Menu : public uiApp {
430436

431437
// RAM expansion options
432438
y += 50;
433-
auto lbl = new uiLabel(rootWindow(), "RAM Expansion:", Point(150, y), Size(0, 0), true, STYLE_LABELGROUP);
439+
new uiLabel(rootWindow(), "RAM Expansion:", Point(150, y), Size(0, 0), true, STYLE_LABELGROUP);
434440
RAMExpComboBox = new uiComboBox(rootWindow(), Point(158, y + 20), Size(75, 19), 130, true, STYLE_COMBOBOX);
435441
char const * RAMOPTS[] = { "Unexpanded", "3K", "8K", "16K", "24K", "27K (24K+3K)", "32K", "35K (32K+3K)" };
436442
for (int i = 0; i < 8; ++i)
@@ -442,7 +448,7 @@ class Menu : public uiApp {
442448

443449
// joystick emulation options
444450
y += 50;
445-
lbl = new uiLabel(rootWindow(), "Joystick:", Point(150, y), Size(0, 0), true, STYLE_LABELGROUP);
451+
new uiLabel(rootWindow(), "Joystick:", Point(150, y), Size(0, 0), true, STYLE_LABELGROUP);
446452
new uiLabel(rootWindow(), "None", Point(180, y + 21), Size(0, 0), true, STYLE_LABEL);
447453
auto radioJNone = new uiCheckBox(rootWindow(), Point(158, y + 20), Size(16, 16), uiCheckBoxKind::RadioButton, true, STYLE_CHECKBOX);
448454
new uiLabel(rootWindow(), "Cursor Keys", Point(180, y + 41), Size(0, 0), true, STYLE_LABEL);
@@ -464,7 +470,7 @@ class Menu : public uiApp {
464470
updateFreeSpaceLabel();
465471

466472
// "Download From" label
467-
auto downloadFromLbl = new uiLabel(rootWindow(), "Download From:", Point(5, 326), Size(0, 0), true, STYLE_LABELGROUP);
473+
new uiLabel(rootWindow(), "Download From:", Point(5, 326), Size(0, 0), true, STYLE_LABELGROUP);
468474

469475
// Download List button (download programs listed and linked in LIST_URL)
470476
auto downloadProgsBtn = new uiButton(rootWindow(), "List", Point(13, 345), Size(27, 20), uiButtonKind::Button, true, STYLE_BUTTON);
@@ -893,4 +899,3 @@ void loop()
893899
auto menu = new Menu;
894900
menu->run(&DisplayController);
895901
}
896-

src/devdrivers/keyboard.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ int Keyboard::scancodeToVirtualKeyTaskStackSize = FABGLIB_DEFAULT_SCODETOVK_TASK
4545

4646
Keyboard::Keyboard()
4747
: m_keyboardAvailable(false),
48-
m_lastDeadKey(VK_NONE),
49-
m_scancodeSet(2)
48+
m_scancodeSet(2),
49+
m_lastDeadKey(VK_NONE)
5050
{
5151
}
5252

@@ -560,6 +560,8 @@ VirtualKey Keyboard::scancodeToVK(uint8_t scancode, bool isExtended, KeyboardLay
560560
case VK_KP_PAGEUP:
561561
vk = VK_KP_9;
562562
break;
563+
default:
564+
break;
563565
}
564566
}
565567

0 commit comments

Comments
 (0)