diff options
-rw-r--r-- | BUILD.gn | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | build-qnx/common.mk | 2 | ||||
-rw-r--r-- | loader/cJSON.c | 18 |
4 files changed, 6 insertions, 20 deletions
@@ -43,7 +43,6 @@ config("vulkan_internal_config") { cflags = [ "-Wno-conversion", "-Wno-extra-semi", - "-Wno-implicit-fallthrough", "-Wno-sign-compare", "-Wno-unreachable-code", "-Wno-unused-function", diff --git a/CMakeLists.txt b/CMakeLists.txt index 102851849..088ed209b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -295,13 +295,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang target_compile_options(loader_common_options INTERFACE -fno-strict-aliasing -fno-builtin-memcmp) endif() - # For GCC version 7.1 or greater, we need to disable the implicit fallthrough warning since there's no consistent way to satisfy - # all compilers until they all accept the C++17 standard if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_options(loader_common_options INTERFACE -Wno-stringop-truncation -Wno-stringop-overflow) - if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 7.1) - target_compile_options(loader_common_options INTERFACE -Wimplicit-fallthrough=0) - endif() endif() if(UNIX) diff --git a/build-qnx/common.mk b/build-qnx/common.mk index d851f7f5e..a0d2a7352 100644 --- a/build-qnx/common.mk +++ b/build-qnx/common.mk @@ -31,7 +31,7 @@ include $(MKFILES_ROOT)/qtargets.mk CCFLAGS += -DVK_USE_PLATFORM_SCREEN_QNX=1 -Dvulkan_EXPORTS CCFLAGS += -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers CCFLAGS += -fno-strict-aliasing -fno-builtin-memcmp -Wno-stringop-truncation -CCFLAGS += -Wno-stringop-overflow -Wimplicit-fallthrough=0 -fvisibility=hidden +CCFLAGS += -Wno-stringop-overflow -fvisibility=hidden CCFLAGS += -Wpointer-arith -fPIC # Enable this if required diff --git a/loader/cJSON.c b/loader/cJSON.c index 40adcb464..be6f2655e 100644 --- a/loader/cJSON.c +++ b/loader/cJSON.c @@ -304,21 +304,13 @@ const char *parse_string(cJSON *item, const char *str) { len = 3; ptr2 += len; - switch (len) { - case 4: - *--ptr2 = ((uc | 0x80) & 0xBF); - uc >>= 6; - // fall through - case 3: - *--ptr2 = ((uc | 0x80) & 0xBF); - uc >>= 6; - // fall through - case 2: + for (size_t i = len; i > 0; i--) { + if (i == 1) { + *--ptr2 = ((unsigned char)uc | firstByteMark[len]); + } else if (i >= 2) { *--ptr2 = ((uc | 0x80) & 0xBF); uc >>= 6; - // fall through - case 1: - *--ptr2 = ((unsigned char)uc | firstByteMark[len]); + } } ptr2 += len; break; |