From 49fec646cbf3afdf5e7d55589ab359a5ebcdb897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 18 Feb 2020 14:57:11 +0100 Subject: Fix compilation warnings and re-enable werror=yes on Travis Fix -Wunused-variable, -Wunused-but-set-variable and -Wswitch warnings raised by GCC 8 and 9. Fix -Wunused-function, -Wunused-private-field and -Wtautological-constant-out-of-range-compare raised by Clang. Fix MSVC 2019 warning C4804 (unsafe use of type 'bool' in comparison operation). GCC -Wcpp warnings/Clang -W#warnings (`#warning`) are no longer raising errors and will thus not abort compilation with `werror=yes`. Treat glslang headers are system headers to avoid raising warnings. Re-enables us to build with `werror=yes` on Linux and macOS, thus catching warnings that would be introduced by new code. Fixes #36132. --- modules/basis_universal/register_types.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'modules/basis_universal') diff --git a/modules/basis_universal/register_types.cpp b/modules/basis_universal/register_types.cpp index 13f4d5fc48..062b5b59f8 100644 --- a/modules/basis_universal/register_types.cpp +++ b/modules/basis_universal/register_types.cpp @@ -52,12 +52,11 @@ enum BasisDecompressFormat { basist::etc1_global_selector_codebook *sel_codebook = nullptr; +#ifdef TOOLS_ENABLED static Vector basis_universal_packer(const Ref &p_image, Image::UsedChannels p_channels) { Vector budata; -#ifdef TOOLS_ENABLED - { Ref image = p_image->duplicate(); @@ -117,14 +116,10 @@ static Vector basis_universal_packer(const Ref &p_image, Image:: #ifdef USE_RG_AS_RGBA image->convert_rg_to_ra_rgba8(); decompress_format = BASIS_DECOMPRESS_RG_AS_RA; - #else - params.m_seperate_rg_to_color_alpha = true; decompress_format = BASIS_DECOMPRESS_RG; - #endif - } break; case Image::USED_CHANNELS_RGB: { decompress_format = BASIS_DECOMPRESS_RGB; @@ -152,9 +147,9 @@ static Vector basis_universal_packer(const Ref &p_image, Image:: } } -#endif return budata; } +#endif // TOOLS_ENABLED static Ref basis_universal_unpacker(const Vector &p_buffer) { Ref image; @@ -286,7 +281,7 @@ void unregister_basis_universal_types() { #ifdef TOOLS_ENABLED delete sel_codebook; -#endif Image::basis_universal_packer = NULL; +#endif Image::basis_universal_unpacker = NULL; } -- cgit v1.2.3