From fd0ad07a9614d1dd924361ed7e898989c8cb65a6 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Mon, 29 Jul 2024 22:53:18 -0500 Subject: [PATCH] Fix wstring to string conversion warnings in LightSaltController.cpp --- .../LightSaltController/LightSaltController.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Controllers/LightSaltController/LightSaltController.cpp b/Controllers/LightSaltController/LightSaltController.cpp index b12918c5..d21be8fd 100644 --- a/Controllers/LightSaltController/LightSaltController.cpp +++ b/Controllers/LightSaltController/LightSaltController.cpp @@ -44,8 +44,7 @@ LightSaltController::LightSaltController(hid_device* dev_handle, const hid_devic if(hid_get_manufacturer_string(dev, usb_string, 128) == 0) { - std::wstring tmp_wstring = usb_string; - manufacturer = std::string(tmp_wstring.begin(), tmp_wstring.end()); + manufacturer = StringUtils::wstring_to_string(usb_string); } else { @@ -54,8 +53,7 @@ LightSaltController::LightSaltController(hid_device* dev_handle, const hid_devic if(hid_get_product_string(dev, usb_string, 128) == 0) { - std::wstring tmp_wstring = usb_string; - product = std::string(tmp_wstring.begin(), tmp_wstring.end()); + product = StringUtils::wstring_to_string(usb_string); } else { @@ -70,10 +68,10 @@ LightSaltController::LightSaltController(hid_device* dev_handle, const hid_devic } else { - device_model = ""; - device_class = ""; + device_model = ""; + device_class = ""; firmware_version = ""; - device_type = LIGHTSALT_TYPE_MAXIMUM; + device_type = LIGHTSALT_TYPE_MAXIMUM; } }