Cleaned out tabstops, other minor style nitpicks.

This commit is contained in:
Ryan C. Gordon 2012-12-11 11:28:29 -05:00
parent 0b1237e790
commit f8eaaf3a51

View file

@ -229,18 +229,18 @@ main(int argc, char *argv[])
} }
if (argv[1]) { if (argv[1]) {
int nreportederror = 0; SDL_bool reportederror = SDL_FALSE;
SDL_bool keepGoing = SDL_TRUE; SDL_bool keepGoing = SDL_TRUE;
SDL_Event event; SDL_Event event;
joystick = SDL_JoystickOpen(atoi(argv[1])); joystick = SDL_JoystickOpen(atoi(argv[1]));
while ( keepGoing ) { while ( keepGoing ) {
if (joystick == NULL) { if (joystick == NULL) {
if ( nreportederror == 0 ) { if ( !reportederror ) {
printf("Couldn't open joystick %d: %s\n", atoi(argv[1]), SDL_GetError()); printf("Couldn't open joystick %d: %s\n", atoi(argv[1]), SDL_GetError());
nreportederror = 1; reportederror = SDL_TRUE;
} }
} else { } else {
nreportederror = 0; reportederror = SDL_FALSE;
keepGoing = WatchJoystick(joystick); keepGoing = WatchJoystick(joystick);
SDL_JoystickClose(joystick); SDL_JoystickClose(joystick);
} }
@ -248,11 +248,12 @@ main(int argc, char *argv[])
if (keepGoing) { if (keepGoing) {
joystick = NULL; joystick = NULL;
SDL_WaitEvent( &event ); SDL_WaitEvent( &event );
if ( event.type == SDL_JOYDEVICEADDED ) if ( event.type == SDL_JOYDEVICEADDED ) {
joystick = SDL_JoystickOpen(atoi(argv[1])); joystick = SDL_JoystickOpen(atoi(argv[1]));
} }
} }
} }
}
SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK); SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
return 0; return 0;