Fix wstring to string conversion warning in RoccatKoneAimoController.cpp

This commit is contained in:
Adam Honse 2024-08-07 21:57:03 -05:00
parent c38e011924
commit 91e8fade99
2 changed files with 9 additions and 8 deletions

View file

@ -18,16 +18,16 @@ RoccatKoneAimoController::RoccatKoneAimoController(hid_device* dev_handle, char
dev = dev_handle;
location = _path;
const int szTemp = 256;
wchar_t tmpName[szTemp];
/*---------------------------------------------------------*\
| Get device name from HID manufacturer and product strings |
\*---------------------------------------------------------*/
wchar_t name_string[HID_MAX_STR];
hid_get_manufacturer_string(dev, tmpName, szTemp);
std::wstring wName = std::wstring(tmpName);
device_name = std::string(wName.begin(), wName.end());
hid_get_manufacturer_string(dev, name_string, HID_MAX_STR);
device_name = StringUtils::wstring_to_string(name_string);
hid_get_product_string(dev, tmpName, szTemp);
wName = std::wstring(tmpName);
device_name.append(" ").append(std::string(wName.begin(), wName.end()));
hid_get_product_string(dev, name_string, HID_MAX_STR);
device_name.append(" ").append(StringUtils::wstring_to_string(name_string));
/*-----------------------------------------------------*\
| Init usb buffer to 0 and add first two bytes |

View file

@ -18,6 +18,7 @@
#include <hidapi.h>
#include "RGBController.h"
#define HID_MAX_STR 255
#define NUM_LEDS 11
#define R_OFFSET 0