Fixes bug #2074 - Thanks Sylvain!
authorGabriel Jacobo <gabomdq@gmail.com>
Thu, 29 Aug 2013 14:03:44 -0300
changeset 7722ea5565d856a8
parent 7721 bdf8c2c84e14
child 7723 aea98cc3e696
Fixes bug #2074 - Thanks Sylvain!

SDL_syssem.c:159 comparison of unsigned expression >= 0 is always true
Solved by comparing unsigneds directly

SDL_systimer.c:164: warning: control may reach end of Compile
Solved by returning the default value if all else fails.

SDL_androidgl.c:41:1: warning: type specifier missing, defaults to 'int'
SDL_androidgl.c:47:1: warning: control reaches end of non-void function
Solved by adding void return type to the function implementation
src/thread/pthread/SDL_syssem.c
src/timer/unix/SDL_systimer.c
src/video/android/SDL_androidgl.c
     1.1 --- a/src/thread/pthread/SDL_syssem.c	Thu Aug 29 08:30:21 2013 -0700
     1.2 +++ b/src/thread/pthread/SDL_syssem.c	Thu Aug 29 14:03:44 2013 -0300
     1.3 @@ -156,7 +156,7 @@
     1.4  #else
     1.5      end = SDL_GetTicks() + timeout;
     1.6      while ((retval = SDL_SemTryWait(sem)) == SDL_MUTEX_TIMEDOUT) {
     1.7 -        if ((SDL_GetTicks() - end) >= 0) {
     1.8 +        if (SDL_GetTicks() >= end) {
     1.9              break;
    1.10          }
    1.11          SDL_Delay(0);
     2.1 --- a/src/timer/unix/SDL_systimer.c	Thu Aug 29 08:30:21 2013 -0700
     2.2 +++ b/src/timer/unix/SDL_systimer.c	Thu Aug 29 14:03:44 2013 -0300
     2.3 @@ -158,9 +158,9 @@
     2.4          freq /= mach_base_info.numer;
     2.5          return freq;
     2.6  #endif
     2.7 -    } else {
     2.8 -        return 1000000;
     2.9 -    }
    2.10 +    } 
    2.11 +        
    2.12 +    return 1000000;
    2.13  }
    2.14  
    2.15  void
     3.1 --- a/src/video/android/SDL_androidgl.c	Thu Aug 29 08:30:21 2013 -0700
     3.2 +++ b/src/video/android/SDL_androidgl.c	Thu Aug 29 14:03:44 2013 -0300
     3.3 @@ -38,6 +38,7 @@
     3.4  SDL_EGL_CreateContext_impl(Android)
     3.5  SDL_EGL_MakeCurrent_impl(Android)
     3.6  
     3.7 +void
     3.8  Android_GLES_SwapWindow(_THIS, SDL_Window * window)
     3.9  {
    3.10      /* FIXME: These two functions were in the Java code, do we really need them? */