diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-10-25 03:38:09 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-10-25 03:54:09 +0200 |
commit | 25b7bf6a9750f92bd75850740002d32dcf08470e (patch) | |
tree | 314e994452a3b56af7b9a9d7465e9f8c92cad791 /tracker-wii/wii_camera.cpp | |
parent | 0a1a0e9df00f37a210b67a11cf8f99550cafeeaf (diff) |
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.
Diffstat (limited to 'tracker-wii/wii_camera.cpp')
-rw-r--r-- | tracker-wii/wii_camera.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
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 <opencv2/imgproc.hpp> +#include <bthsdpdef.h> #include <bluetoothapis.h> 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); |