From 25b7bf6a9750f92bd75850740002d32dcf08470e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 25 Oct 2018 03:38:09 +0200 Subject: tracker/wii: fix for mingw-w64 The module loses auto-pairing functionality, but it's at least useful to see GCC warnings. I don't intend to use GCC for actually running the module. Fix some warnings emitted by GCC, such as - memset(3) of non-POD struct - depending on "new T[0]" to return a null pointer - dependence on MSVC-specific pragmas for external libraries - lack of header guards - unintended usage of trigraph syntax Disable some GCC warnings for the "wiiyourself" library. It's not possible to patch it up, the code quality is that awful. Disable the builtin debug functionality since it depends on non-standard __VA_OPT__ (due in C++20). It's not possible to disable the warning emitted on the __VA_ARGS__ usage in GCC. --- tracker-wii/wii_camera.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tracker-wii/wii_camera.cpp') diff --git a/tracker-wii/wii_camera.cpp b/tracker-wii/wii_camera.cpp index 93dfe4ff..38cbf26a 100644 --- a/tracker-wii/wii_camera.cpp +++ b/tracker-wii/wii_camera.cpp @@ -21,6 +21,7 @@ #include +#include #include using namespace pt_module; @@ -79,6 +80,8 @@ WIICamera::result WIICamera::get_frame(pt_frame& frame_) break; case wii_cam_data_no_change: return { false, cam_info }; + default: + break; } return { true, cam_info }; @@ -109,9 +112,12 @@ void WIICamera::stop() cam_desired = pt_camera_info(); } - wii_camera_status WIICamera::_pair() { +#if defined __MINGW32__ + // missing prototypes and implib entries + return wii_cam_wait_for_connect; +#else wii_camera_status ret = wii_cam_wait_for_sync; HBLUETOOTH_RADIO_FIND hbt; BLUETOOTH_FIND_RADIO_PARAMS bt_param; @@ -195,21 +201,25 @@ wii_camera_status WIICamera::_pair() } if (wiifound) { ret = wii_cam_wait_for_connect; } return ret; +#endif } wii_camera_status WIICamera::_get_frame(cv::Mat& frame) { + (void)frame; wii_camera_status ret = wii_cam_wait_for_connect; if (!m_pDev->IsConnected()) { qDebug() << "wii wait"; ret = _pair(); - switch(ret){ + switch (ret) { case wii_cam_wait_for_sync: m_pDev->Disconnect(); goto goodbye; case wii_cam_wait_for_connect: break; + default: + break; } if (!m_pDev->Connect(wiimote::FIRST_AVAILABLE)) { Beep(500, 30); Sleep(1000); -- cgit v1.2.3