src/audio/dummy/SDL_dummyaudio.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/src/audio/dummy/SDL_dummyaudio.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/audio/dummy/SDL_dummyaudio.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -37,50 +37,50 @@
     1.4  #define DUMMYAUD_DRIVER_NAME         "dummy"
     1.5  
     1.6  /* Audio driver functions */
     1.7 -static int DUMMYAUD_OpenAudio (_THIS, SDL_AudioSpec * spec);
     1.8 -static void DUMMYAUD_WaitAudio (_THIS);
     1.9 -static void DUMMYAUD_PlayAudio (_THIS);
    1.10 -static Uint8 *DUMMYAUD_GetAudioBuf (_THIS);
    1.11 -static void DUMMYAUD_CloseAudio (_THIS);
    1.12 +static int DUMMYAUD_OpenAudio(_THIS, SDL_AudioSpec * spec);
    1.13 +static void DUMMYAUD_WaitAudio(_THIS);
    1.14 +static void DUMMYAUD_PlayAudio(_THIS);
    1.15 +static Uint8 *DUMMYAUD_GetAudioBuf(_THIS);
    1.16 +static void DUMMYAUD_CloseAudio(_THIS);
    1.17  
    1.18  /* Audio driver bootstrap functions */
    1.19  static int
    1.20 -DUMMYAUD_Available (void)
    1.21 +DUMMYAUD_Available(void)
    1.22  {
    1.23 -    const char *envr = SDL_getenv ("SDL_AUDIODRIVER");
    1.24 -    if (envr && (SDL_strcmp (envr, DUMMYAUD_DRIVER_NAME) == 0)) {
    1.25 +    const char *envr = SDL_getenv("SDL_AUDIODRIVER");
    1.26 +    if (envr && (SDL_strcmp(envr, DUMMYAUD_DRIVER_NAME) == 0)) {
    1.27          return (1);
    1.28      }
    1.29      return (0);
    1.30  }
    1.31  
    1.32  static void
    1.33 -DUMMYAUD_DeleteDevice (SDL_AudioDevice * device)
    1.34 +DUMMYAUD_DeleteDevice(SDL_AudioDevice * device)
    1.35  {
    1.36 -    SDL_free (device->hidden);
    1.37 -    SDL_free (device);
    1.38 +    SDL_free(device->hidden);
    1.39 +    SDL_free(device);
    1.40  }
    1.41  
    1.42  static SDL_AudioDevice *
    1.43 -DUMMYAUD_CreateDevice (int devindex)
    1.44 +DUMMYAUD_CreateDevice(int devindex)
    1.45  {
    1.46      SDL_AudioDevice *this;
    1.47  
    1.48      /* Initialize all variables that we clean on shutdown */
    1.49 -    this = (SDL_AudioDevice *) SDL_malloc (sizeof (SDL_AudioDevice));
    1.50 +    this = (SDL_AudioDevice *) SDL_malloc(sizeof(SDL_AudioDevice));
    1.51      if (this) {
    1.52 -        SDL_memset (this, 0, (sizeof *this));
    1.53 +        SDL_memset(this, 0, (sizeof *this));
    1.54          this->hidden = (struct SDL_PrivateAudioData *)
    1.55 -            SDL_malloc ((sizeof *this->hidden));
    1.56 +            SDL_malloc((sizeof *this->hidden));
    1.57      }
    1.58      if ((this == NULL) || (this->hidden == NULL)) {
    1.59 -        SDL_OutOfMemory ();
    1.60 +        SDL_OutOfMemory();
    1.61          if (this) {
    1.62 -            SDL_free (this);
    1.63 +            SDL_free(this);
    1.64          }
    1.65          return (0);
    1.66      }
    1.67 -    SDL_memset (this->hidden, 0, (sizeof *this->hidden));
    1.68 +    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
    1.69  
    1.70      /* Set the function pointers */
    1.71      this->OpenAudio = DUMMYAUD_OpenAudio;
    1.72 @@ -101,48 +101,48 @@
    1.73  
    1.74  /* This function waits until it is possible to write a full sound buffer */
    1.75  static void
    1.76 -DUMMYAUD_WaitAudio (_THIS)
    1.77 +DUMMYAUD_WaitAudio(_THIS)
    1.78  {
    1.79      /* Don't block on first calls to simulate initial fragment filling. */
    1.80      if (this->hidden->initial_calls)
    1.81          this->hidden->initial_calls--;
    1.82      else
    1.83 -        SDL_Delay (this->hidden->write_delay);
    1.84 +        SDL_Delay(this->hidden->write_delay);
    1.85  }
    1.86  
    1.87  static void
    1.88 -DUMMYAUD_PlayAudio (_THIS)
    1.89 +DUMMYAUD_PlayAudio(_THIS)
    1.90  {
    1.91      /* no-op...this is a null driver. */
    1.92  }
    1.93  
    1.94  static Uint8 *
    1.95 -DUMMYAUD_GetAudioBuf (_THIS)
    1.96 +DUMMYAUD_GetAudioBuf(_THIS)
    1.97  {
    1.98      return (this->hidden->mixbuf);
    1.99  }
   1.100  
   1.101  static void
   1.102 -DUMMYAUD_CloseAudio (_THIS)
   1.103 +DUMMYAUD_CloseAudio(_THIS)
   1.104  {
   1.105      if (this->hidden->mixbuf != NULL) {
   1.106 -        SDL_FreeAudioMem (this->hidden->mixbuf);
   1.107 +        SDL_FreeAudioMem(this->hidden->mixbuf);
   1.108          this->hidden->mixbuf = NULL;
   1.109      }
   1.110  }
   1.111  
   1.112  static int
   1.113 -DUMMYAUD_OpenAudio (_THIS, SDL_AudioSpec * spec)
   1.114 +DUMMYAUD_OpenAudio(_THIS, SDL_AudioSpec * spec)
   1.115  {
   1.116      float bytes_per_sec = 0.0f;
   1.117  
   1.118      /* Allocate mixing buffer */
   1.119      this->hidden->mixlen = spec->size;
   1.120 -    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem (this->hidden->mixlen);
   1.121 +    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
   1.122      if (this->hidden->mixbuf == NULL) {
   1.123          return (-1);
   1.124      }
   1.125 -    SDL_memset (this->hidden->mixbuf, spec->silence, spec->size);
   1.126 +    SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
   1.127  
   1.128      bytes_per_sec = (float) (((spec->format & 0xFF) / 8) *
   1.129                               spec->channels * spec->freq);