diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-20 01:02:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-20 01:02:22 +0300 |
commit | 132ee3146d10b6e6a860bfd7e03b5a8667f2a44b (patch) | |
tree | 0ef5bab643e4571ca77f4b4fa53276410edc0af2 /src/resources | |
parent | 5d8285ae8d16b40cf842f2bafd41978e316ac9b8 (diff) | |
download | mv-132ee3146d10b6e6a860bfd7e03b5a8667f2a44b.tar.gz mv-132ee3146d10b6e6a860bfd7e03b5a8667f2a44b.tar.bz2 mv-132ee3146d10b6e6a860bfd7e03b5a8667f2a44b.tar.xz mv-132ee3146d10b6e6a860bfd7e03b5a8667f2a44b.zip |
Prevent Wshadow varnings in SDL code.
Diffstat (limited to 'src/resources')
33 files changed, 106 insertions, 0 deletions
diff --git a/src/resources/atlas/atlasmanager.cpp b/src/resources/atlas/atlasmanager.cpp index 10bc6136f..ea5126590 100644 --- a/src/resources/atlas/atlasmanager.cpp +++ b/src/resources/atlas/atlasmanager.cpp @@ -42,9 +42,12 @@ #include "resources/resourcemanager/resourcemanager.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef SDL_BIG_ENDIAN #include <SDL_endian.h> #endif // SDL_BYTEORDER +#pragma GCC diagnostic pop #include "utils/checkutils.h" diff --git a/src/resources/dye/dye.cpp b/src/resources/dye/dye.cpp index 70d2a21b1..cc597f9d5 100644 --- a/src/resources/dye/dye.cpp +++ b/src/resources/dye/dye.cpp @@ -30,9 +30,12 @@ #include <sstream> +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef SDL_BIG_ENDIAN #include <SDL_endian.h> #endif // SDL_BYTEORDER +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/dye/dye_unittest.cc b/src/resources/dye/dye_unittest.cc index 09b207371..8f6e75614 100644 --- a/src/resources/dye/dye_unittest.cc +++ b/src/resources/dye/dye_unittest.cc @@ -47,9 +47,12 @@ #include "utils/delete2.h" #include "utils/env.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef USE_SDL2 #include <SDL.h> #endif // USE_SDL2 +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/dye/dyepalette.cpp b/src/resources/dye/dyepalette.cpp index cf1d7c205..cf563d4e4 100644 --- a/src/resources/dye/dyepalette.cpp +++ b/src/resources/dye/dyepalette.cpp @@ -34,9 +34,12 @@ #include <cmath> #endif // USE_SDL2 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef SDL_BIG_ENDIAN #include <SDL_endian.h> #endif // SDL_BYTEORDER +#pragma GCC diagnostic pop #ifdef SIMD_SUPPORTED #include "utils/cpu.h" diff --git a/src/resources/dye/dyepalette_replaceacolor.cpp b/src/resources/dye/dyepalette_replaceacolor.cpp index 21cd0b0c5..259bc6a71 100644 --- a/src/resources/dye/dyepalette_replaceacolor.cpp +++ b/src/resources/dye/dyepalette_replaceacolor.cpp @@ -22,9 +22,12 @@ #include "resources/dye/dyepalette.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef SDL_BIG_ENDIAN #include <SDL_endian.h> #endif // SDL_BYTEORDER +#pragma GCC diagnostic pop #ifdef SIMD_SUPPORTED // avx2 diff --git a/src/resources/dye/dyepalette_replaceaoglcolor.cpp b/src/resources/dye/dyepalette_replaceaoglcolor.cpp index c0225df65..b0b2f5943 100644 --- a/src/resources/dye/dyepalette_replaceaoglcolor.cpp +++ b/src/resources/dye/dyepalette_replaceaoglcolor.cpp @@ -24,9 +24,12 @@ #include "resources/dye/dyepalette.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef SDL_BIG_ENDIAN #include <SDL_endian.h> #endif // SDL_BYTEORDER +#pragma GCC diagnostic pop #ifdef SIMD_SUPPORTED // avx2 diff --git a/src/resources/dye/dyepalette_replacescolor.cpp b/src/resources/dye/dyepalette_replacescolor.cpp index 0a4206e83..4a8acdb5b 100644 --- a/src/resources/dye/dyepalette_replacescolor.cpp +++ b/src/resources/dye/dyepalette_replacescolor.cpp @@ -22,9 +22,12 @@ #include "resources/dye/dyepalette.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef SDL_BIG_ENDIAN #include <SDL_endian.h> #endif // SDL_BYTEORDER +#pragma GCC diagnostic pop #ifdef SIMD_SUPPORTED // avx2 diff --git a/src/resources/dye/dyepalette_replacesoglcolor.cpp b/src/resources/dye/dyepalette_replacesoglcolor.cpp index cde7fac8e..7aec79cdb 100644 --- a/src/resources/dye/dyepalette_replacesoglcolor.cpp +++ b/src/resources/dye/dyepalette_replacesoglcolor.cpp @@ -24,9 +24,12 @@ #include "resources/dye/dyepalette.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef SDL_BIG_ENDIAN #include <SDL_endian.h> #endif // SDL_BYTEORDER +#pragma GCC diagnostic pop #ifdef SIMD_SUPPORTED // avx2 diff --git a/src/resources/dye/dyepalette_unittest.cc b/src/resources/dye/dyepalette_unittest.cc index 351a74a2d..db82c4297 100644 --- a/src/resources/dye/dyepalette_unittest.cc +++ b/src/resources/dye/dyepalette_unittest.cc @@ -46,9 +46,12 @@ #include "utils/delete2.h" #include "utils/env.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef USE_SDL2 #include <SDL.h> #endif // USE_SDL2 +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/fboinfo.h b/src/resources/fboinfo.h index e92659156..452ea73ce 100644 --- a/src/resources/fboinfo.h +++ b/src/resources/fboinfo.h @@ -27,7 +27,10 @@ #include <GLES/gl.h> #include <GLES/glext.h> #else // ANDROID +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_opengl.h> +#pragma GCC diagnostic pop #if defined(__APPLE__) #include <OpenGL/glext.h> #elif !defined(__native_client__) diff --git a/src/resources/image/image.cpp b/src/resources/image/image.cpp index b1b23ce13..747609095 100644 --- a/src/resources/image/image.cpp +++ b/src/resources/image/image.cpp @@ -37,11 +37,14 @@ #include "utils/sdlcheckutils.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifdef USE_SDL2 #include <SDL2_rotozoom.h> #else // USE_SDL2 #include <SDL_rotozoom.h> #endif // USE_SDL2 +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/image/image.h b/src/resources/image/image.h index 762f82fab..8657eee2c 100644 --- a/src/resources/image/image.h +++ b/src/resources/image/image.h @@ -37,15 +37,21 @@ #ifndef USE_SDL2 #define GL_GLEXT_PROTOTYPES 1 #endif // USE_SDL2 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_opengl.h> +#pragma GCC diagnostic pop #endif // ANDROID #endif // USE_OPENGL +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifdef USE_SDL2 #include <SDL_render.h> #else // USE_SDL2 #include <SDL_video.h> #endif // USE_SDL2 +#pragma GCC diagnostic pop #include <map> diff --git a/src/resources/imagehelper.cpp b/src/resources/imagehelper.cpp index 1879e9a6a..bc5c36849 100644 --- a/src/resources/imagehelper.cpp +++ b/src/resources/imagehelper.cpp @@ -29,7 +29,10 @@ #include "utils/sdlcheckutils.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_image.h> +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/imagehelper.h b/src/resources/imagehelper.h index 9020e61b8..2af418704 100644 --- a/src/resources/imagehelper.h +++ b/src/resources/imagehelper.h @@ -27,7 +27,10 @@ #include "enums/render/rendertype.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_video.h> +#pragma GCC diagnostic pop class Dye; class Image; diff --git a/src/resources/imagewriter.cpp b/src/resources/imagewriter.cpp index a797e2496..7347b98bf 100644 --- a/src/resources/imagewriter.cpp +++ b/src/resources/imagewriter.cpp @@ -25,7 +25,10 @@ #include "utils/checkutils.h" #include <png.h> +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_video.h> +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/memorymanager.cpp b/src/resources/memorymanager.cpp index 1e4b8b378..85f76df20 100644 --- a/src/resources/memorymanager.cpp +++ b/src/resources/memorymanager.cpp @@ -27,7 +27,10 @@ #include "utils/gettext.h" #include "utils/stringutils.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_video.h> +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp index 66c60e039..468dbdfd8 100644 --- a/src/resources/openglimagehelper.cpp +++ b/src/resources/openglimagehelper.cpp @@ -46,7 +46,10 @@ #include "utils/checkutils.h" #include "utils/sdlcheckutils.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_image.h> +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/openglimagehelper.h b/src/resources/openglimagehelper.h index 316ecb168..013c29866 100644 --- a/src/resources/openglimagehelper.h +++ b/src/resources/openglimagehelper.h @@ -41,7 +41,10 @@ #ifndef USE_SDL2 #define GL_GLEXT_PROTOTYPES 1 #endif // USE_SDL2 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_opengl.h> +#pragma GCC diagnostic pop #endif // ANDROID class Dye; diff --git a/src/resources/rect/doublerect.h b/src/resources/rect/doublerect.h index 3919cc8e4..d3baafa61 100644 --- a/src/resources/rect/doublerect.h +++ b/src/resources/rect/doublerect.h @@ -23,7 +23,10 @@ #include "localconsts.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_video.h> +#pragma GCC diagnostic pop struct DoubleRect final { diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index a60fea2a4..1343f3619 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -40,9 +40,13 @@ #include "resources/resourcetypes.h" #endif // defined(DEBUG_DUMP_LEAKS) || defined(UNITTESTS) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef USE_OPENGL #include <SDL_image.h> #endif // USE_OPENGL +#pragma GCC diagnostic pop + #include <sstream> #include <sys/time.h> diff --git a/src/resources/resourcemanager/resourcemanager_unittest.cc b/src/resources/resourcemanager/resourcemanager_unittest.cc index fe3e2e995..eaa7c3797 100644 --- a/src/resources/resourcemanager/resourcemanager_unittest.cc +++ b/src/resources/resourcemanager/resourcemanager_unittest.cc @@ -40,9 +40,12 @@ #include <unistd.h> +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef USE_SDL2 #include <SDL.h> #endif // USE_SDL2 +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/safeopenglimagehelper.cpp b/src/resources/safeopenglimagehelper.cpp index c1acea2f0..513b94427 100644 --- a/src/resources/safeopenglimagehelper.cpp +++ b/src/resources/safeopenglimagehelper.cpp @@ -42,7 +42,10 @@ #include "utils/sdlcheckutils.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_image.h> +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/safeopenglimagehelper.h b/src/resources/safeopenglimagehelper.h index 25e9509a3..426279dcf 100644 --- a/src/resources/safeopenglimagehelper.h +++ b/src/resources/safeopenglimagehelper.h @@ -41,7 +41,10 @@ #ifndef USE_SDL2 #define GL_GLEXT_PROTOTYPES 1 #endif // USE_SDL2 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_opengl.h> +#pragma GCC diagnostic pop #endif // ANDROID class Dye; diff --git a/src/resources/screenshothelper.h b/src/resources/screenshothelper.h index cb4180147..51c881dd8 100644 --- a/src/resources/screenshothelper.h +++ b/src/resources/screenshothelper.h @@ -25,7 +25,10 @@ #include "localconsts.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_video.h> +#pragma GCC diagnostic pop class ScreenshotHelper notfinal { diff --git a/src/resources/sdl2imagehelper.h b/src/resources/sdl2imagehelper.h index e1a9fce8b..fd25151a0 100644 --- a/src/resources/sdl2imagehelper.h +++ b/src/resources/sdl2imagehelper.h @@ -29,7 +29,10 @@ #include "resources/imagehelper.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL.h> +#pragma GCC diagnostic pop class Dye; class Image; diff --git a/src/resources/sdl2softwarescreenshothelper.cpp b/src/resources/sdl2softwarescreenshothelper.cpp index 5bb3c3434..e510fa70e 100644 --- a/src/resources/sdl2softwarescreenshothelper.cpp +++ b/src/resources/sdl2softwarescreenshothelper.cpp @@ -28,9 +28,12 @@ #include "utils/sdlcheckutils.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef SDL_BIG_ENDIAN #include <SDL_endian.h> #endif // SDL_BYTEORDER +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/sdlgfxblitfunc.cpp b/src/resources/sdlgfxblitfunc.cpp index e635c20d5..8b0500ec6 100644 --- a/src/resources/sdlgfxblitfunc.cpp +++ b/src/resources/sdlgfxblitfunc.cpp @@ -31,7 +31,10 @@ LGPL (c) A. Schiffler #include "utils/checkutils.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_video.h> +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp index 72afe3045..ca7b5b838 100644 --- a/src/resources/sdlimagehelper.cpp +++ b/src/resources/sdlimagehelper.cpp @@ -32,14 +32,20 @@ #include "utils/checkutils.h" #include "utils/sdlcheckutils.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_image.h> +#pragma GCC diagnostic pop #include "localconsts.h" #if SDL_BYTEORDER == SDL_LIL_ENDIAN #include "resources/sdlgfxblitfunc.h" #else // SDL_BYTEORDER == SDL_LIL_ENDIAN +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_gfxBlitFunc.h> +#pragma GCC diagnostic pop #endif // SDL_BYTEORDER == SDL_LIL_ENDIAN #ifndef SDL_BIG_ENDIAN diff --git a/src/resources/sdlimagehelper_unittest.cc b/src/resources/sdlimagehelper_unittest.cc index 2d4c52e73..ae796e90a 100644 --- a/src/resources/sdlimagehelper_unittest.cc +++ b/src/resources/sdlimagehelper_unittest.cc @@ -19,7 +19,10 @@ */ #ifndef USE_SDL2 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_endian.h> +#pragma GCC diagnostic pop #if SDL_BYTEORDER == SDL_LIL_ENDIAN #include "test/unittests.h" diff --git a/src/resources/sdlmusic.h b/src/resources/sdlmusic.h index 8db3fa74a..b90773d56 100644 --- a/src/resources/sdlmusic.h +++ b/src/resources/sdlmusic.h @@ -25,7 +25,10 @@ #include "resources/resource.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_mixer.h> +#pragma GCC diagnostic pop #include "localconsts.h" diff --git a/src/resources/sdlscreenshothelper.cpp b/src/resources/sdlscreenshothelper.cpp index 2fa9f3e2d..6cdb28878 100644 --- a/src/resources/sdlscreenshothelper.cpp +++ b/src/resources/sdlscreenshothelper.cpp @@ -26,9 +26,12 @@ #include "utils/sdlcheckutils.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef SDL_BIG_ENDIAN #include <SDL_endian.h> #endif // SDL_BYTEORDER +#pragma GCC diagnostic pop #include "debug.h" diff --git a/src/resources/soundeffect.h b/src/resources/soundeffect.h index 429afc977..5623959a9 100644 --- a/src/resources/soundeffect.h +++ b/src/resources/soundeffect.h @@ -25,7 +25,10 @@ #include "resources/resource.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #include <SDL_mixer.h> +#pragma GCC diagnostic pop #include "localconsts.h" diff --git a/src/resources/sprite/animatedsprite_unittest.cc b/src/resources/sprite/animatedsprite_unittest.cc index ee36ed7d7..43e3e0614 100644 --- a/src/resources/sprite/animatedsprite_unittest.cc +++ b/src/resources/sprite/animatedsprite_unittest.cc @@ -49,9 +49,12 @@ #include "utils/delete2.h" #include "utils/mrand.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow") #ifndef USE_SDL2 #include <SDL.h> #endif // USE_SDL2 +#pragma GCC diagnostic pop #include "debug.h" |