test/testerror.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/test/testerror.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/test/testerror.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -12,53 +12,53 @@
     1.4  
     1.5  /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
     1.6  static void
     1.7 -quit (int rc)
     1.8 +quit(int rc)
     1.9  {
    1.10 -    SDL_Quit ();
    1.11 -    exit (rc);
    1.12 +    SDL_Quit();
    1.13 +    exit(rc);
    1.14  }
    1.15  
    1.16  int SDLCALL
    1.17 -ThreadFunc (void *data)
    1.18 +ThreadFunc(void *data)
    1.19  {
    1.20      /* Set the child thread error string */
    1.21 -    SDL_SetError ("Thread %s (%d) had a problem: %s",
    1.22 -                  (char *) data, SDL_ThreadID (), "nevermind");
    1.23 +    SDL_SetError("Thread %s (%d) had a problem: %s",
    1.24 +                 (char *) data, SDL_ThreadID(), "nevermind");
    1.25      while (alive) {
    1.26 -        printf ("Thread '%s' is alive!\n", (char *) data);
    1.27 -        SDL_Delay (1 * 1000);
    1.28 +        printf("Thread '%s' is alive!\n", (char *) data);
    1.29 +        SDL_Delay(1 * 1000);
    1.30      }
    1.31 -    printf ("Child thread error string: %s\n", SDL_GetError ());
    1.32 +    printf("Child thread error string: %s\n", SDL_GetError());
    1.33      return (0);
    1.34  }
    1.35  
    1.36  int
    1.37 -main (int argc, char *argv[])
    1.38 +main(int argc, char *argv[])
    1.39  {
    1.40      SDL_Thread *thread;
    1.41  
    1.42      /* Load the SDL library */
    1.43 -    if (SDL_Init (0) < 0) {
    1.44 -        fprintf (stderr, "Couldn't initialize SDL: %s\n", SDL_GetError ());
    1.45 +    if (SDL_Init(0) < 0) {
    1.46 +        fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
    1.47          return (1);
    1.48      }
    1.49  
    1.50      /* Set the error value for the main thread */
    1.51 -    SDL_SetError ("No worries");
    1.52 +    SDL_SetError("No worries");
    1.53  
    1.54      alive = 1;
    1.55 -    thread = SDL_CreateThread (ThreadFunc, "#1");
    1.56 +    thread = SDL_CreateThread(ThreadFunc, "#1");
    1.57      if (thread == NULL) {
    1.58 -        fprintf (stderr, "Couldn't create thread: %s\n", SDL_GetError ());
    1.59 -        quit (1);
    1.60 +        fprintf(stderr, "Couldn't create thread: %s\n", SDL_GetError());
    1.61 +        quit(1);
    1.62      }
    1.63 -    SDL_Delay (5 * 1000);
    1.64 -    printf ("Waiting for thread #1\n");
    1.65 +    SDL_Delay(5 * 1000);
    1.66 +    printf("Waiting for thread #1\n");
    1.67      alive = 0;
    1.68 -    SDL_WaitThread (thread, NULL);
    1.69 +    SDL_WaitThread(thread, NULL);
    1.70  
    1.71 -    printf ("Main thread error string: %s\n", SDL_GetError ());
    1.72 +    printf("Main thread error string: %s\n", SDL_GetError());
    1.73  
    1.74 -    SDL_Quit ();
    1.75 +    SDL_Quit();
    1.76      return (0);
    1.77  }