Still more compiler warning fixes for various platforms.
authorRyan C. Gordon
Wed, 23 Nov 2016 17:20:28 -0500
changeset 10644594c17c446f6
parent 10643 930938c7ca82
child 10645 b3475b7afcbc
Still more compiler warning fixes for various platforms.
src/SDL_error.c
src/stdlib/SDL_iconv.c
src/test/SDL_test_common.c
src/video/emscripten/SDL_emscriptenopengles.c
     1.1 --- a/src/SDL_error.c	Wed Nov 23 11:49:26 2016 -0500
     1.2 +++ b/src/SDL_error.c	Wed Nov 23 17:20:28 2016 -0500
     1.3 @@ -177,9 +177,11 @@
     1.4  /* keep this at the end of the file so it works with GCC builds that don't
     1.5     support "#pragma GCC diagnostic push" ... we'll just leave the warning
     1.6     disabled after this. */
     1.7 -#ifdef __GNUC__
     1.8 +/* this pragma arrived in GCC 4.2 and causes a warning on older GCCs! Sigh. */
     1.9 +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 2))))
    1.10  #pragma GCC diagnostic ignored "-Wformat-nonliteral"
    1.11  #endif
    1.12 +
    1.13  /* This function has a bit more overhead than most error functions
    1.14     so that it supports internationalization and thread-safe errors.
    1.15  */
     2.1 --- a/src/stdlib/SDL_iconv.c	Wed Nov 23 11:49:26 2016 -0500
     2.2 +++ b/src/stdlib/SDL_iconv.c	Wed Nov 23 17:20:28 2016 -0500
     2.3 @@ -38,6 +38,7 @@
     2.4     If we get this wrong, it's just a warning, so no big deal.
     2.5  */
     2.6  #if defined(_XGP6) || defined(__APPLE__) || \
     2.7 +    defined(__EMSCRIPTEN__) || \
     2.8      (defined(__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) || \
     2.9      (defined(_NEWLIB_VERSION)))
    2.10  #define ICONV_INBUF_NONCONST
     3.1 --- a/src/test/SDL_test_common.c	Wed Nov 23 11:49:26 2016 -0500
     3.2 +++ b/src/test/SDL_test_common.c	Wed Nov 23 17:20:28 2016 -0500
     3.3 @@ -1210,10 +1210,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: %lld", (long long) event->dgesture.gestureId);
     3.8 +        SDL_Log("SDL_EVENT: Dollar gesture detect: %ld", (long) event->dgesture.gestureId);
     3.9          break;
    3.10      case SDL_DOLLARRECORD:
    3.11 -        SDL_Log("SDL_EVENT: Dollar gesture record: %lld", (long long) event->dgesture.gestureId);
    3.12 +        SDL_Log("SDL_EVENT: Dollar gesture record: %ld", (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_emscriptenopengles.c	Wed Nov 23 11:49:26 2016 -0500
     4.2 +++ b/src/video/emscripten/SDL_emscriptenopengles.c	Wed Nov 23 17:20:28 2016 -0500
     4.3 @@ -39,11 +39,15 @@
     4.4      if (!_this->egl_data) {
     4.5          return SDL_OutOfMemory();
     4.6      }
     4.7 -    
     4.8 +
     4.9 +    /* Emscripten forces you to manually cast eglGetProcAddress to the real
    4.10 +       function type; grep for "__eglMustCastToProperFunctionPointerType" in
    4.11 +       Emscripten's egl.h for details. */
    4.12 +    _this->egl_data->eglGetProcAddress = (void *(EGLAPIENTRY *)(const char *)) eglGetProcAddress;
    4.13 +
    4.14      LOAD_FUNC(eglGetDisplay);
    4.15      LOAD_FUNC(eglInitialize);
    4.16      LOAD_FUNC(eglTerminate);
    4.17 -    LOAD_FUNC(eglGetProcAddress);
    4.18      LOAD_FUNC(eglChooseConfig);
    4.19      LOAD_FUNC(eglGetConfigAttrib);
    4.20      LOAD_FUNC(eglCreateContext);