Cleaned up some compiler warnings.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 26 Dec 2014 23:16:54 -0500
changeset 93000293f45e4814
parent 9299 1d3bee66d518
child 9301 7377a9a3aed6
Cleaned up some compiler warnings.
src/cpuinfo/SDL_cpuinfo.c
src/joystick/emscripten/SDL_sysjoystick.c
src/test/SDL_test_common.c
src/video/emscripten/SDL_emscriptenframebuffer.c
src/video/emscripten/SDL_emscriptenvideo.c
     1.1 --- a/src/cpuinfo/SDL_cpuinfo.c	Fri Dec 26 22:30:19 2014 -0500
     1.2 +++ b/src/cpuinfo/SDL_cpuinfo.c	Fri Dec 26 23:16:54 2014 -0500
     1.3 @@ -458,10 +458,11 @@
     1.4  
     1.5      if (!SDL_CPUType[0]) {
     1.6          int i = 0;
     1.7 -        int a, b, c, d;
     1.8  
     1.9          if (CPU_haveCPUID()) {
    1.10 +            int a, b, c, d;
    1.11              cpuid(0x00000000, a, b, c, d);
    1.12 +            (void) a;
    1.13              SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
    1.14              SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
    1.15              SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
    1.16 @@ -563,15 +564,12 @@
    1.17  SDL_GetCPUCacheLineSize(void)
    1.18  {
    1.19      const char *cpuType = SDL_GetCPUType();
    1.20 -
    1.21 +    int a, b, c, d;
    1.22 +    (void) a; (void) b; (void) c; (void) d;
    1.23      if (SDL_strcmp(cpuType, "GenuineIntel") == 0) {
    1.24 -        int a, b, c, d;
    1.25 -
    1.26          cpuid(0x00000001, a, b, c, d);
    1.27          return (((b >> 8) & 0xff) * 8);
    1.28      } else if (SDL_strcmp(cpuType, "AuthenticAMD") == 0) {
    1.29 -        int a, b, c, d;
    1.30 -
    1.31          cpuid(0x80000005, a, b, c, d);
    1.32          return (c & 0xff);
    1.33      } else {
     2.1 --- a/src/joystick/emscripten/SDL_sysjoystick.c	Fri Dec 26 22:30:19 2014 -0500
     2.2 +++ b/src/joystick/emscripten/SDL_sysjoystick.c	Fri Dec 26 23:16:54 2014 -0500
     2.3 @@ -281,7 +281,7 @@
     2.4      SDL_joylist_item *item = JoystickByIndex(index);
     2.5      if (item == NULL) {
     2.6          SDL_SetError("Joystick with index %d not found", index);
     2.7 -        return NULL;
     2.8 +        return 0;
     2.9      }
    2.10  
    2.11      return item->device_instance;
     3.1 --- a/src/test/SDL_test_common.c	Fri Dec 26 22:30:19 2014 -0500
     3.2 +++ b/src/test/SDL_test_common.c	Fri Dec 26 23:16:54 2014 -0500
     3.3 @@ -1204,10 +1204,10 @@
     3.4                  event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure);
     3.5          break;
     3.6      case SDL_DOLLARGESTURE:
     3.7 -        SDL_Log("SDL_EVENT: Dollar gesture detect: %"SDL_PRIs64, event->dgesture.gestureId);
     3.8 +        SDL_Log("SDL_EVENT: Dollar gesture detect: %"SDL_PRIs64, (long long) event->dgesture.gestureId);
     3.9          break;
    3.10      case SDL_DOLLARRECORD:
    3.11 -        SDL_Log("SDL_EVENT: Dollar gesture record: %"SDL_PRIs64, event->dgesture.gestureId);
    3.12 +        SDL_Log("SDL_EVENT: Dollar gesture record: %"SDL_PRIs64, (long long) event->dgesture.gestureId);
    3.13          break;
    3.14      case SDL_MULTIGESTURE:
    3.15          SDL_Log("SDL_EVENT: Multi gesture fingers: %d", event->mgesture.numFingers);
     4.1 --- a/src/video/emscripten/SDL_emscriptenframebuffer.c	Fri Dec 26 22:30:19 2014 -0500
     4.2 +++ b/src/video/emscripten/SDL_emscriptenframebuffer.c	Fri Dec 26 23:16:54 2014 -0500
     4.3 @@ -58,7 +58,6 @@
     4.4  
     4.5  int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects)
     4.6  {
     4.7 -    static int frame_number;
     4.8      SDL_Surface *surface;
     4.9  
    4.10      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    4.11 @@ -115,6 +114,7 @@
    4.12      }, surface->w, surface->h, surface->pixels);
    4.13  
    4.14      /*if (SDL_getenv("SDL_VIDEO_Emscripten_SAVE_FRAMES")) {
    4.15 +        static int frame_number = 0;
    4.16          char file[128];
    4.17          SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp",
    4.18                       SDL_GetWindowID(window), ++frame_number);
     5.1 --- a/src/video/emscripten/SDL_emscriptenvideo.c	Fri Dec 26 22:30:19 2014 -0500
     5.2 +++ b/src/video/emscripten/SDL_emscriptenvideo.c	Fri Dec 26 23:16:54 2014 -0500
     5.3 @@ -227,7 +227,7 @@
     5.4                  return -1;
     5.5              }
     5.6          }
     5.7 -        wdata->egl_surface = SDL_EGL_CreateSurface(_this, NULL);
     5.8 +        wdata->egl_surface = SDL_EGL_CreateSurface(_this, 0);
     5.9  
    5.10          if (wdata->egl_surface == EGL_NO_SURFACE) {
    5.11              return SDL_SetError("Could not create GLES window surface");