From 6f04e4ca46e6f2dcd3eda63529a1bbd915f7676b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 28 Dec 2018 03:02:57 +0100 Subject: clang-tidy fixes only Maybe global `-Wcomma' is too harsh. There should be no functional changes whatsoever. --- tracker-wii/wiiyourself/CMakeLists.txt | 3 +++ tracker-wii/wiiyourself/warns-begin.hpp | 8 ++++++++ tracker-wii/wiiyourself/warns-end.hpp | 4 ++++ tracker-wii/wiiyourself/wiimote.cpp | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) (limited to 'tracker-wii/wiiyourself') diff --git a/tracker-wii/wiiyourself/CMakeLists.txt b/tracker-wii/wiiyourself/CMakeLists.txt index fe6d62e8..91fa245a 100644 --- a/tracker-wii/wiiyourself/CMakeLists.txt +++ b/tracker-wii/wiiyourself/CMakeLists.txt @@ -1,4 +1,7 @@ if(WIN32) otr_module(wiiyourself STATIC NO-COMPAT NO-QT) target_link_libraries(${self} setupapi hid winmm) + if(CMAKE_COMPILER_IS_CLANGXX OR CMAKE_COMPILER_IS_GNUCXX) + target_compile_options(${self} PRIVATE -Wno-error) + endif() endif() diff --git a/tracker-wii/wiiyourself/warns-begin.hpp b/tracker-wii/wiiyourself/warns-begin.hpp index e4b148ef..dab250f7 100644 --- a/tracker-wii/wiiyourself/warns-begin.hpp +++ b/tracker-wii/wiiyourself/warns-begin.hpp @@ -10,3 +10,11 @@ # pragma GCC diagnostic ignored "-Wcast-function-type" # endif #endif + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" +# pragma clang diagnostic ignored "-Wextra-semi" +# pragma clang diagnostic ignored "-Wshadow-field" +# pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif diff --git a/tracker-wii/wiiyourself/warns-end.hpp b/tracker-wii/wiiyourself/warns-end.hpp index beaf245d..3de03ca5 100644 --- a/tracker-wii/wiiyourself/warns-end.hpp +++ b/tracker-wii/wiiyourself/warns-end.hpp @@ -1,3 +1,7 @@ #ifdef __GNUG__ # pragma GCC diagnostic pop #endif + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif diff --git a/tracker-wii/wiiyourself/wiimote.cpp b/tracker-wii/wiiyourself/wiimote.cpp index f6946fad..90788495 100644 --- a/tracker-wii/wiiyourself/wiimote.cpp +++ b/tracker-wii/wiiyourself/wiimote.cpp @@ -1432,7 +1432,7 @@ int wiimote::ParseExtension(BYTE *buff, unsigned offset) float raw_x = buff[offset + 0]; float raw_y = buff[offset + 1]; - if ((raw_x != joy.RawX) || (raw_y != joy.RawY)) + if (std::fabs(raw_x - joy.RawX) < 1e-6f || std::fabs(raw_y - joy.RawY) < 1e-6f) changed |= NUNCHUK_JOYSTICK_CHANGED; joy.RawX = raw_x; -- cgit v1.2.3