diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-12-28 03:02:57 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 07:48:18 +0100 |
commit | 6f04e4ca46e6f2dcd3eda63529a1bbd915f7676b (patch) | |
tree | 9aeb1332980c4285396457ad9f278495064549b5 /tracker-wii | |
parent | 3be3bb256f3e9362f8889f0532f875c5ad3b41fb (diff) |
clang-tidy fixes only
Maybe global `-Wcomma' is too harsh.
There should be no functional changes whatsoever.
Diffstat (limited to 'tracker-wii')
-rw-r--r-- | tracker-wii/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tracker-wii/wii_camera.cpp | 11 | ||||
-rw-r--r-- | tracker-wii/wii_camera.h | 2 | ||||
-rw-r--r-- | tracker-wii/wiiyourself/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tracker-wii/wiiyourself/warns-begin.hpp | 8 | ||||
-rw-r--r-- | tracker-wii/wiiyourself/warns-end.hpp | 4 | ||||
-rw-r--r-- | tracker-wii/wiiyourself/wiimote.cpp | 2 |
7 files changed, 31 insertions, 4 deletions
diff --git a/tracker-wii/CMakeLists.txt b/tracker-wii/CMakeLists.txt index e40692ba..f43dca55 100644 --- a/tracker-wii/CMakeLists.txt +++ b/tracker-wii/CMakeLists.txt @@ -3,7 +3,8 @@ if(WIN32) if(OpenCV_FOUND) add_subdirectory(wiiyourself) otr_module(tracker-wii) - target_link_libraries(opentrack-tracker-wii opentrack-tracker-pt-base opentrack-wiiyourself bthprops) - target_include_directories(opentrack-tracker-wii PRIVATE "${CMAKE_SOURCE_DIR}/tracker-pt") + target_link_libraries(${self} opentrack-tracker-pt-base opentrack-wiiyourself bthprops) + target_include_directories(${self} PRIVATE SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/wiiyourself") + target_include_directories(${self} PRIVATE "${CMAKE_SOURCE_DIR}/tracker-pt") endif() endif() diff --git a/tracker-wii/wii_camera.cpp b/tracker-wii/wii_camera.cpp index ab216215..da998ecf 100644 --- a/tracker-wii/wii_camera.cpp +++ b/tracker-wii/wii_camera.cpp @@ -7,8 +7,19 @@ */ // silence #pragma deprecated in bluetoothapis.h + +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif + #undef _WIN32_WINNT #define _WIN32_WINNT _WIN32_WINNT_VISTA + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif + #undef NTDDI_VERSION #define NTDDI_VERSION NTDDI_VISTASP1 diff --git a/tracker-wii/wii_camera.h b/tracker-wii/wii_camera.h index 11af8846..c8a1d106 100644 --- a/tracker-wii/wii_camera.h +++ b/tracker-wii/wii_camera.h @@ -21,7 +21,7 @@ #include <QString> -#include <wiiyourself/wiimote.h> +#include <wiimote.h> #include "wii_frame.hpp" namespace pt_module { 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; |