src/thread/win32/SDL_sysmutex.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/src/thread/win32/SDL_sysmutex.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/thread/win32/SDL_sysmutex.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -36,49 +36,49 @@
     1.4  
     1.5  /* Create a mutex */
     1.6  SDL_mutex *
     1.7 -SDL_CreateMutex (void)
     1.8 +SDL_CreateMutex(void)
     1.9  {
    1.10      SDL_mutex *mutex;
    1.11  
    1.12      /* Allocate mutex memory */
    1.13 -    mutex = (SDL_mutex *) SDL_malloc (sizeof (*mutex));
    1.14 +    mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex));
    1.15      if (mutex) {
    1.16          /* Create the mutex, with initial value signaled */
    1.17 -        mutex->id = CreateMutex (NULL, FALSE, NULL);
    1.18 +        mutex->id = CreateMutex(NULL, FALSE, NULL);
    1.19          if (!mutex->id) {
    1.20 -            SDL_SetError ("Couldn't create mutex");
    1.21 -            SDL_free (mutex);
    1.22 +            SDL_SetError("Couldn't create mutex");
    1.23 +            SDL_free(mutex);
    1.24              mutex = NULL;
    1.25          }
    1.26      } else {
    1.27 -        SDL_OutOfMemory ();
    1.28 +        SDL_OutOfMemory();
    1.29      }
    1.30      return (mutex);
    1.31  }
    1.32  
    1.33  /* Free the mutex */
    1.34  void
    1.35 -SDL_DestroyMutex (SDL_mutex * mutex)
    1.36 +SDL_DestroyMutex(SDL_mutex * mutex)
    1.37  {
    1.38      if (mutex) {
    1.39          if (mutex->id) {
    1.40 -            CloseHandle (mutex->id);
    1.41 +            CloseHandle(mutex->id);
    1.42              mutex->id = 0;
    1.43          }
    1.44 -        SDL_free (mutex);
    1.45 +        SDL_free(mutex);
    1.46      }
    1.47  }
    1.48  
    1.49  /* Lock the mutex */
    1.50  int
    1.51 -SDL_mutexP (SDL_mutex * mutex)
    1.52 +SDL_mutexP(SDL_mutex * mutex)
    1.53  {
    1.54      if (mutex == NULL) {
    1.55 -        SDL_SetError ("Passed a NULL mutex");
    1.56 +        SDL_SetError("Passed a NULL mutex");
    1.57          return -1;
    1.58      }
    1.59 -    if (WaitForSingleObject (mutex->id, INFINITE) == WAIT_FAILED) {
    1.60 -        SDL_SetError ("Couldn't wait on mutex");
    1.61 +    if (WaitForSingleObject(mutex->id, INFINITE) == WAIT_FAILED) {
    1.62 +        SDL_SetError("Couldn't wait on mutex");
    1.63          return -1;
    1.64      }
    1.65      return (0);
    1.66 @@ -86,14 +86,14 @@
    1.67  
    1.68  /* Unlock the mutex */
    1.69  int
    1.70 -SDL_mutexV (SDL_mutex * mutex)
    1.71 +SDL_mutexV(SDL_mutex * mutex)
    1.72  {
    1.73      if (mutex == NULL) {
    1.74 -        SDL_SetError ("Passed a NULL mutex");
    1.75 +        SDL_SetError("Passed a NULL mutex");
    1.76          return -1;
    1.77      }
    1.78 -    if (ReleaseMutex (mutex->id) == FALSE) {
    1.79 -        SDL_SetError ("Couldn't release mutex");
    1.80 +    if (ReleaseMutex(mutex->id) == FALSE) {
    1.81 +        SDL_SetError("Couldn't release mutex");
    1.82          return -1;
    1.83      }
    1.84      return (0);