src/audio/windx5/SDL_dx5audio.c
changeset 2060 866052b01ee5
parent 2051 c03f1446e897
child 2698 e1da92da346c
     1.1 --- a/src/audio/windx5/SDL_dx5audio.c	Sat Oct 28 16:41:54 2006 +0000
     1.2 +++ b/src/audio/windx5/SDL_dx5audio.c	Sat Oct 28 16:48:03 2006 +0000
     1.3 @@ -39,7 +39,8 @@
     1.4  
     1.5  /* DirectX function pointers for audio */
     1.6  static HINSTANCE DSoundDLL = NULL;
     1.7 -static HRESULT (WINAPI *DSoundCreate)(LPGUID,LPDIRECTSOUND*,LPUNKNOWN) = NULL;
     1.8 +static HRESULT(WINAPI * DSoundCreate) (LPGUID, LPDIRECTSOUND *, LPUNKNOWN) =
     1.9 +    NULL;
    1.10  
    1.11  static void
    1.12  DSOUND_Unload(void)
    1.13 @@ -70,7 +71,7 @@
    1.14              SDL_SetError("DirectSound: System doesn't appear to have DX5.");
    1.15          } else {
    1.16              DSoundCreate = (void *) GetProcAddress(DSoundDLL,
    1.17 -                                               TEXT("DirectSoundCreate"));
    1.18 +                                                   TEXT("DirectSoundCreate"));
    1.19          }
    1.20  
    1.21          if (!DSoundCreate) {
    1.22 @@ -271,14 +272,14 @@
    1.23      /* Lock the audio buffer */
    1.24      result = IDirectSoundBuffer_Lock(this->hidden->mixbuf, cursor,
    1.25                                       this->hidden->mixlen,
    1.26 -                                     (LPVOID *) &this->hidden->locked_buf,
    1.27 +                                     (LPVOID *) & this->hidden->locked_buf,
    1.28                                       &rawlen, NULL, &junk, 0);
    1.29      if (result == DSERR_BUFFERLOST) {
    1.30          IDirectSoundBuffer_Restore(this->hidden->mixbuf);
    1.31          result = IDirectSoundBuffer_Lock(this->hidden->mixbuf, cursor,
    1.32                                           this->hidden->mixlen,
    1.33 -                                         (LPVOID *) &this->hidden->locked_buf,
    1.34 -                                         &rawlen, NULL, &junk, 0);
    1.35 +                                         (LPVOID *) & this->hidden->
    1.36 +                                         locked_buf, &rawlen, NULL, &junk, 0);
    1.37      }
    1.38      if (result != DS_OK) {
    1.39          SetDSerror("DirectSound Lock", result);
    1.40 @@ -326,7 +327,7 @@
    1.41     number of audio chunks available in the created buffer.
    1.42  */
    1.43  static int
    1.44 -CreateSecondary(_THIS, HWND focus, WAVEFORMATEX *wavefmt)
    1.45 +CreateSecondary(_THIS, HWND focus, WAVEFORMATEX * wavefmt)
    1.46  {
    1.47      LPDIRECTSOUND sndObj = this->hidden->sound;
    1.48      LPDIRECTSOUNDBUFFER *sndbuf = &this->hidden->mixbuf;
    1.49 @@ -405,7 +406,7 @@
    1.50  
    1.51      /* Initialize all variables that we clean on shutdown */
    1.52      this->hidden = (struct SDL_PrivateAudioData *)
    1.53 -                        SDL_malloc((sizeof *this->hidden));
    1.54 +        SDL_malloc((sizeof *this->hidden));
    1.55      if (this->hidden == NULL) {
    1.56          SDL_OutOfMemory();
    1.57          return 0;
    1.58 @@ -414,12 +415,12 @@
    1.59  
    1.60      while ((!valid_format) && (test_format)) {
    1.61          switch (test_format) {
    1.62 -            case AUDIO_U8:
    1.63 -            case AUDIO_S16:
    1.64 -            case AUDIO_S32:
    1.65 -                this->spec.format = test_format;
    1.66 -                valid_format = 1;
    1.67 -                break;
    1.68 +        case AUDIO_U8:
    1.69 +        case AUDIO_S16:
    1.70 +        case AUDIO_S32:
    1.71 +            this->spec.format = test_format;
    1.72 +            valid_format = 1;
    1.73 +            break;
    1.74          }
    1.75          test_format = SDL_NextAudioFormat();
    1.76      }
    1.77 @@ -461,7 +462,7 @@
    1.78      /* The buffer will auto-start playing in DSOUND_WaitDevice() */
    1.79      this->hidden->mixlen = this->spec.size;
    1.80  
    1.81 -    return 1;  /* good to go. */
    1.82 +    return 1;                   /* good to go. */
    1.83  }
    1.84  
    1.85  
    1.86 @@ -473,7 +474,7 @@
    1.87  
    1.88  
    1.89  static int
    1.90 -DSOUND_Init(SDL_AudioDriverImpl *impl)
    1.91 +DSOUND_Init(SDL_AudioDriverImpl * impl)
    1.92  {
    1.93      OSVERSIONINFO ver;
    1.94  
    1.95 @@ -482,12 +483,12 @@
    1.96       *  audio buffers used by many SDL applications, so there are gaps in the
    1.97       *  audio - it sounds terrible.  Punt for now.
    1.98       */
    1.99 -    SDL_memset(&ver, '\0', sizeof (OSVERSIONINFO));
   1.100 +    SDL_memset(&ver, '\0', sizeof(OSVERSIONINFO));
   1.101      ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
   1.102      GetVersionEx(&ver);
   1.103      if (ver.dwPlatformId == VER_PLATFORM_WIN32_NT) {
   1.104          if (ver.dwMajorVersion <= 4) {
   1.105 -            return 0;  /* NT4.0 or earlier. Disable dsound support. */
   1.106 +            return 0;           /* NT4.0 or earlier. Disable dsound support. */
   1.107          }
   1.108      }
   1.109  
   1.110 @@ -504,7 +505,7 @@
   1.111      impl->GetDeviceBuf = DSOUND_GetDeviceBuf;
   1.112      impl->CloseDevice = DSOUND_CloseDevice;
   1.113      impl->Deinitialize = DSOUND_Deinitialize;
   1.114 -    impl->OnlyHasDefaultOutputDevice = 1;  /* !!! FIXME */
   1.115 +    impl->OnlyHasDefaultOutputDevice = 1;       /* !!! FIXME */
   1.116  
   1.117      return 1;
   1.118  }