src/cdrom/macosx/SDLOSXCAGuard.c
changeset 1487 dc6b59e925a2
parent 1402 d910939febfa
child 1662 782fd950bd46
child 1895 c121d94672cb
child 4159 a1b03ba2fcd0
     1.1 --- a/src/cdrom/macosx/SDLOSXCAGuard.c	Wed Mar 08 18:30:12 2006 +0000
     1.2 +++ b/src/cdrom/macosx/SDLOSXCAGuard.c	Thu Mar 09 06:33:21 2006 +0000
     1.3 @@ -66,9 +66,9 @@
     1.4  
     1.5  =============================================================================*/
     1.6  
     1.7 -//=============================================================================
     1.8 -//  Includes
     1.9 -//=============================================================================
    1.10 +/*=============================================================================
    1.11 +    Includes
    1.12 +  =============================================================================*/
    1.13  
    1.14  /*
    1.15  #include <stdio.h>
    1.16 @@ -77,7 +77,7 @@
    1.17  */
    1.18  #include "SDL_stdinc.h"
    1.19  
    1.20 -//#define NDEBUG 1
    1.21 +/*#define NDEBUG 1*/
    1.22  /*
    1.23  #include <assert.h>
    1.24  */
    1.25 @@ -86,10 +86,10 @@
    1.26  
    1.27  #include "SDLOSXCAGuard.h"
    1.28  
    1.29 -//#warning      Need a try-based Locker too
    1.30 -//=============================================================================
    1.31 -//  SDLOSXCAGuard
    1.32 -//=============================================================================
    1.33 +/*#warning      Need a try-based Locker too*/
    1.34 +/*=============================================================================
    1.35 +    SDLOSXCAGuard
    1.36 +  =============================================================================*/
    1.37  
    1.38  static int SDLOSXCAGuard_Lock(SDLOSXCAGuard *cag)
    1.39  {
    1.40 @@ -98,6 +98,7 @@
    1.41      if(pthread_self() != cag->mOwner)
    1.42      {
    1.43          OSStatus theError = pthread_mutex_lock(&cag->mMutex);
    1.44 +        (void)theError;
    1.45          assert(theError == 0);
    1.46          cag->mOwner = pthread_self();
    1.47          theAnswer = 1;
    1.48 @@ -108,10 +109,12 @@
    1.49  
    1.50  static void    SDLOSXCAGuard_Unlock(SDLOSXCAGuard *cag)
    1.51  {
    1.52 +    OSStatus theError;
    1.53      assert(pthread_self() == cag->mOwner);
    1.54  
    1.55      cag->mOwner = 0;
    1.56 -    OSStatus theError = pthread_mutex_unlock(&cag->mMutex);
    1.57 +    theError = pthread_mutex_unlock(&cag->mMutex);
    1.58 +    (void)theError;
    1.59      assert(theError == 0);
    1.60  }
    1.61  
    1.62 @@ -137,11 +140,13 @@
    1.63  
    1.64  static void    SDLOSXCAGuard_Wait(SDLOSXCAGuard *cag)
    1.65  {
    1.66 +    OSStatus theError;
    1.67      assert(pthread_self() == cag->mOwner);
    1.68  
    1.69      cag->mOwner = 0;
    1.70  
    1.71 -    OSStatus theError = pthread_cond_wait(&cag->mCondVar, &cag->mMutex);
    1.72 +    theError = pthread_cond_wait(&cag->mCondVar, &cag->mMutex);
    1.73 +    (void)theError;
    1.74      assert(theError == 0);
    1.75      cag->mOwner = pthread_self();
    1.76  }
    1.77 @@ -149,12 +154,14 @@
    1.78  static void    SDLOSXCAGuard_Notify(SDLOSXCAGuard *cag)
    1.79  {
    1.80      OSStatus theError = pthread_cond_signal(&cag->mCondVar);
    1.81 +    (void)theError;
    1.82      assert(theError == 0);
    1.83  }
    1.84  
    1.85  
    1.86  SDLOSXCAGuard *new_SDLOSXCAGuard(void)
    1.87  {
    1.88 +    OSStatus theError;
    1.89      SDLOSXCAGuard *cag = (SDLOSXCAGuard *) SDL_malloc(sizeof (SDLOSXCAGuard));
    1.90      if (cag == NULL)
    1.91          return NULL;
    1.92 @@ -168,10 +175,12 @@
    1.93      SET_SDLOSXCAGUARD_METHOD(Notify);
    1.94      #undef SET_SDLOSXCAGUARD_METHOD
    1.95  
    1.96 -    OSStatus theError = pthread_mutex_init(&cag->mMutex, NULL);
    1.97 +    theError = pthread_mutex_init(&cag->mMutex, NULL);
    1.98 +    (void)theError;
    1.99      assert(theError == 0);
   1.100      
   1.101      theError = pthread_cond_init(&cag->mCondVar, NULL);
   1.102 +    (void)theError;
   1.103      assert(theError == 0);
   1.104      
   1.105      cag->mOwner = 0;