diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d46e37..5278717 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,10 @@ project(swe1r-tools) set(CMAKE_C_STANDARD 11) +if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wextra -Wno-unused-parameter -Werror") +endif() + add_definitions(-D__cdecl=) add_executable(decompress decompress.c) diff --git a/decompress.c b/decompress.c index 5d146b2..b79423b 100644 --- a/decompress.c +++ b/decompress.c @@ -7,7 +7,7 @@ #define MAGIC(a1, a2, a3, a4) (((a1) << 24) | ((a2) << 16) | ((a3) << 8) | (a4)) static inline uint32_t swap32(uint32_t v) { - return ((v & 0xFF0000 | (v >> 16)) >> 8) | (((v << 16) | v & 0xFF00) << 8); + return (((v & 0xFF0000) | (v >> 16)) >> 8) | (((v << 16) | (v & 0xFF00)) << 8); } //----- (0042D520) --------------------------------------------------------