2
2
#include <assert.h>
3
3
#include <stdio.h>
4
4
#include <stdlib.h>
5
+ #include <stdbool.h>
5
6
#include <string.h>
6
7
#include <time.h>
7
8
8
- #include <SDL.h>
9
+ #include <SDL2/ SDL.h>
9
10
10
11
#include "./digits.h"
11
12
@@ -155,14 +156,14 @@ int main(int argc, char **argv)
155
156
{
156
157
Mode mode = MODE_ASCENDING ;
157
158
float displayed_time = 0.0f ;
158
- int paused = 0 ;
159
- int exit_after_countdown = 0 ;
159
+ bool paused = false ;
160
+ bool exit_after_countdown = false ;
160
161
161
162
for (int i = 1 ; i < argc ; ++ i ) {
162
163
if (strcmp (argv [i ], "-p" ) == 0 ) {
163
- paused = 1 ;
164
+ paused = true ;
164
165
} else if (strcmp (argv [i ], "-e" ) == 0 ) {
165
- exit_after_countdown = 1 ;
166
+ exit_after_countdown = true ;
166
167
} else if (strcmp (argv [i ], "clock" ) == 0 ) {
167
168
mode = MODE_CLOCK ;
168
169
} else {
@@ -195,7 +196,7 @@ int main(int argc, char **argv)
195
196
secc (SDL_SetTextureColorMod (digits , MAIN_COLOR_R , MAIN_COLOR_G , MAIN_COLOR_B ));
196
197
}
197
198
198
- int quit = 0 ;
199
+ bool quit = false ;
199
200
size_t wiggle_index = 0 ;
200
201
float wiggle_cooldown = WIGGLE_DURATION ;
201
202
float user_scale = 1.0f ;
@@ -206,7 +207,7 @@ int main(int argc, char **argv)
206
207
while (SDL_PollEvent (& event )) {
207
208
switch (event .type ) {
208
209
case SDL_QUIT : {
209
- quit = 1 ;
210
+ quit = true ;
210
211
} break ;
211
212
212
213
case SDL_KEYDOWN : {
@@ -237,10 +238,10 @@ int main(int argc, char **argv)
237
238
238
239
case SDLK_F5 : {
239
240
displayed_time = 0.0f ;
240
- paused = 0 ;
241
+ paused = false ;
241
242
for (int i = 1 ; i < argc ; ++ i ) {
242
243
if (strcmp (argv [i ], "-p" ) == 0 ) {
243
- paused = 1 ;
244
+ paused = true ;
244
245
} else {
245
246
displayed_time = parse_time (argv [i ]);
246
247
}
0 commit comments