test/testmultiaudio.c
changeset 2060 866052b01ee5
parent 2049 5f6550e5184f
child 2146 9fcde304c7b6
     1.1 --- a/test/testmultiaudio.c	Sat Oct 28 16:41:54 2006 +0000
     1.2 +++ b/test/testmultiaudio.c	Sat Oct 28 16:48:03 2006 +0000
     1.3 @@ -1,8 +1,8 @@
     1.4  #include "SDL.h"
     1.5  
     1.6  static SDL_AudioSpec spec;
     1.7 -static Uint8 *sound = NULL;            /* Pointer to wave data */
     1.8 -static Uint32 soundlen = 0;            /* Length of wave data */
     1.9 +static Uint8 *sound = NULL;     /* Pointer to wave data */
    1.10 +static Uint32 soundlen = 0;     /* Length of wave data */
    1.11  
    1.12  typedef struct
    1.13  {
    1.14 @@ -11,7 +11,8 @@
    1.15      volatile int done;
    1.16  } callback_data;
    1.17  
    1.18 -void SDLCALL play_through_once(void *arg, Uint8 * stream, int len)
    1.19 +void SDLCALL
    1.20 +play_through_once(void *arg, Uint8 * stream, int len)
    1.21  {
    1.22      callback_data *cbd = (callback_data *) arg;
    1.23      Uint8 *waveptr = sound + cbd->soundpos;
    1.24 @@ -30,14 +31,16 @@
    1.25      }
    1.26  }
    1.27  
    1.28 -static void test_multi_audio(int devcount)
    1.29 +static void
    1.30 +test_multi_audio(int devcount)
    1.31  {
    1.32      callback_data cbd[64];
    1.33      int keep_going = 1;
    1.34      int i;
    1.35  
    1.36      if (devcount > 64) {
    1.37 -        fprintf(stderr, "Too many devices (%d), clamping to 64...\n", devcount);
    1.38 +        fprintf(stderr, "Too many devices (%d), clamping to 64...\n",
    1.39 +                devcount);
    1.40          devcount = 64;
    1.41      }
    1.42  
    1.43 @@ -48,7 +51,7 @@
    1.44          printf("playing on device #%d: ('%s')...", i, devname);
    1.45          fflush(stdout);
    1.46  
    1.47 -        memset(&cbd[0], '\0', sizeof (callback_data));
    1.48 +        memset(&cbd[0], '\0', sizeof(callback_data));
    1.49          spec.userdata = &cbd[0];
    1.50          cbd[0].dev = SDL_OpenAudioDevice(devname, 0, &spec, NULL);
    1.51          if (cbd[0].dev == 0) {
    1.52 @@ -63,7 +66,7 @@
    1.53          }
    1.54      }
    1.55  
    1.56 -    memset(cbd, '\0', sizeof (cbd));
    1.57 +    memset(cbd, '\0', sizeof(cbd));
    1.58  
    1.59      printf("playing on all devices...\n");
    1.60      for (i = 0; i < devcount; i++) {
    1.61 @@ -102,7 +105,8 @@
    1.62  }
    1.63  
    1.64  
    1.65 -int main(int argc, char **argv)
    1.66 +int
    1.67 +main(int argc, char **argv)
    1.68  {
    1.69      int devcount = 0;
    1.70  
    1.71 @@ -124,7 +128,8 @@
    1.72  
    1.73          /* Load the wave file into memory */
    1.74          if (SDL_LoadWAV(argv[1], &spec, &sound, &soundlen) == NULL) {
    1.75 -            fprintf(stderr, "Couldn't load %s: %s\n", argv[1], SDL_GetError());
    1.76 +            fprintf(stderr, "Couldn't load %s: %s\n", argv[1],
    1.77 +                    SDL_GetError());
    1.78          } else {
    1.79              test_multi_audio(devcount);
    1.80              SDL_FreeWAV(sound);