Fixed tabs to spaces
authorSam Lantinga <slouken@libsdl.org>
Thu, 09 Mar 2017 15:12:19 -0800
changeset 10933a9ce2bbd76e1
parent 10932 98b94b9e3e8c
child 10934 380eae4f5059
Fixed tabs to spaces
test/loopwave.c
     1.1 --- a/test/loopwave.c	Thu Mar 09 14:50:23 2017 -0800
     1.2 +++ b/test/loopwave.c	Thu Mar 09 15:12:19 2017 -0800
     1.3 @@ -51,32 +51,32 @@
     1.4  static void
     1.5  close_audio()
     1.6  {
     1.7 -	if (device != 0) {
     1.8 -		SDL_CloseAudioDevice(device);
     1.9 -		device = 0;
    1.10 -	}
    1.11 +    if (device != 0) {
    1.12 +        SDL_CloseAudioDevice(device);
    1.13 +        device = 0;
    1.14 +    }
    1.15  }
    1.16  
    1.17  static void
    1.18  open_audio()
    1.19  {
    1.20 -	/* Initialize fillerup() variables */
    1.21 -	device = SDL_OpenAudioDevice(NULL, SDL_FALSE, &wave.spec, NULL, 0);
    1.22 -	if (!device) {
    1.23 -		SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open audio: %s\n", SDL_GetError());
    1.24 -		SDL_FreeWAV(wave.sound);
    1.25 -		quit(2);
    1.26 -	}
    1.27 +    /* Initialize fillerup() variables */
    1.28 +    device = SDL_OpenAudioDevice(NULL, SDL_FALSE, &wave.spec, NULL, 0);
    1.29 +    if (!device) {
    1.30 +        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open audio: %s\n", SDL_GetError());
    1.31 +        SDL_FreeWAV(wave.sound);
    1.32 +        quit(2);
    1.33 +    }
    1.34  
    1.35  
    1.36 -	/* Let the audio run */
    1.37 -	SDL_PauseAudioDevice(device, SDL_FALSE);
    1.38 +    /* Let the audio run */
    1.39 +    SDL_PauseAudioDevice(device, SDL_FALSE);
    1.40  }
    1.41  
    1.42  static void reopen_audio()
    1.43  {
    1.44 -	close_audio();
    1.45 -	open_audio();
    1.46 +    close_audio();
    1.47 +    open_audio();
    1.48  }
    1.49  
    1.50  
    1.51 @@ -151,35 +151,35 @@
    1.52      SDL_Log("Available audio drivers:");
    1.53      for (i = 0; i < SDL_GetNumAudioDrivers(); ++i) {
    1.54          SDL_Log("%i: %s", i, SDL_GetAudioDriver(i));
    1.55 -	}
    1.56 +    }
    1.57  
    1.58 -	SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver());
    1.59 +    SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver());
    1.60  
    1.61 -	open_audio();
    1.62 +    open_audio();
    1.63  
    1.64 -	SDL_FlushEvents(SDL_AUDIODEVICEADDED, SDL_AUDIODEVICEREMOVED);
    1.65 +    SDL_FlushEvents(SDL_AUDIODEVICEADDED, SDL_AUDIODEVICEREMOVED);
    1.66  
    1.67  #ifdef __EMSCRIPTEN__
    1.68      emscripten_set_main_loop(loop, 0, 1);
    1.69  #else
    1.70 -	while (!done) {
    1.71 -		SDL_Event event;
    1.72 +    while (!done) {
    1.73 +        SDL_Event event;
    1.74  
    1.75 -		while (SDL_PollEvent(&event) > 0) {
    1.76 -			if (event.type == SDL_QUIT) {
    1.77 -				done = 1;
    1.78 -			}
    1.79 -			if ((event.type == SDL_AUDIODEVICEADDED && !event.adevice.iscapture) ||
    1.80 -				(event.type == SDL_AUDIODEVICEREMOVED && !event.adevice.iscapture && event.adevice.which == device)) {
    1.81 -				reopen_audio();
    1.82 -			}
    1.83 -		}
    1.84 -		SDL_Delay(100);
    1.85 -	}
    1.86 +        while (SDL_PollEvent(&event) > 0) {
    1.87 +            if (event.type == SDL_QUIT) {
    1.88 +                done = 1;
    1.89 +            }
    1.90 +            if ((event.type == SDL_AUDIODEVICEADDED && !event.adevice.iscapture) ||
    1.91 +                (event.type == SDL_AUDIODEVICEREMOVED && !event.adevice.iscapture && event.adevice.which == device)) {
    1.92 +                reopen_audio();
    1.93 +            }
    1.94 +        }
    1.95 +        SDL_Delay(100);
    1.96 +    }
    1.97  #endif
    1.98  
    1.99      /* Clean up on signal */
   1.100 -	close_audio();
   1.101 +    close_audio();
   1.102      SDL_FreeWAV(wave.sound);
   1.103      SDL_Quit();
   1.104      return (0);