diff --git a/coding/hex.hpp b/coding/hex.hpp index 41f7cbe174..1fe22e29ca 100644 --- a/coding/hex.hpp +++ b/coding/hex.hpp @@ -34,6 +34,8 @@ inline string ToHex(ContainerT const & container) return ToHex(&*container.begin(), container.end() - container.begin()); } +/// Conversion with specializations to avoid warnings +/// @{ template inline string NumToHex(IntT n) { @@ -44,21 +46,30 @@ inline string NumToHex(IntT n) for (size_t i = 0; i < sizeof(n); ++i) { buf[i] = (n >> ((sizeof(n) - 1) * 8)); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wshift-count-overflow" n <<= 8; -#pragma GCC diagnostic pop } return ToHex(buf, sizeof(buf)); } -/// Specialization to avoid warnings +template <> +inline string NumToHex(int8_t c) +{ + return ToHex(&c, sizeof(c)); +} + +template <> +inline string NumToHex(uint8_t c) +{ + return ToHex(&c, sizeof(c)); +} + template <> inline string NumToHex(char c) { return ToHex(&c, sizeof(c)); } +/// @} inline string FromHex(void const * ptr, size_t size) { string result; diff --git a/graphics/color.cpp b/graphics/color.cpp index 1bd4f583e0..44558e15c0 100644 --- a/graphics/color.cpp +++ b/graphics/color.cpp @@ -3,7 +3,7 @@ namespace graphics { - Color::Color(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char a1) + Color::Color(uint8_t r1, uint8_t g1, uint8_t b1, uint8_t a1) : r(r1), g(g1), b(b1), a(a1) {} @@ -30,7 +30,7 @@ namespace graphics return *this; } - Color const Color::fromXRGB(uint32_t _c, unsigned char _a) + Color const Color::fromXRGB(uint32_t _c, uint8_t _a) { return Color( redFromARGB(_c), diff --git a/graphics/color.hpp b/graphics/color.hpp index 7fefc2a8ae..3077d21cfe 100644 --- a/graphics/color.hpp +++ b/graphics/color.hpp @@ -8,18 +8,18 @@ namespace graphics { struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t a; - Color(unsigned char r1, unsigned char g1, unsigned char b1, unsigned char a1); + Color(uint8_t r1, uint8_t g1, uint8_t b1, uint8_t a1); Color(); Color(Color const & p); Color const & operator=(Color const & p); static Color const fromARGB(uint32_t _c); - static Color const fromXRGB(uint32_t _c, unsigned char _a = 0); + static Color const fromXRGB(uint32_t _c, uint8_t _a = 0); Color const & operator /= (unsigned k); diff --git a/tools/mkspecs/android-g++/qmake.conf b/tools/mkspecs/android-g++/qmake.conf index 01108ed167..c57d7bd33e 100644 --- a/tools/mkspecs/android-g++/qmake.conf +++ b/tools/mkspecs/android-g++/qmake.conf @@ -79,7 +79,7 @@ contains(ANDROID_TARGET_ARCH, arm) { } } -QMAKE_CFLAGS_WARN_ON = -Wall -W -Wno-unused-local-typedefs +QMAKE_CFLAGS_WARN_ON = -Wall -W QMAKE_CFLAGS_WARN_OFF = QMAKE_CFLAGS_SHLIB = -fPIC QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses