From 8a272c07b7994cc0fc2e367d32e6f2a43506f265 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Wed, 7 Aug 2024 21:40:46 -0500 Subject: [PATCH] Fix wstring to string conversion warning in MSIMysticLight112Controller.cpp --- .../MSIMysticLight112Controller.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Controllers/MSIMysticLightController/MSIMysticLight112Controller/MSIMysticLight112Controller.cpp b/Controllers/MSIMysticLightController/MSIMysticLight112Controller/MSIMysticLight112Controller.cpp index f9d75bcf..a80b5169 100644 --- a/Controllers/MSIMysticLightController/MSIMysticLight112Controller/MSIMysticLight112Controller.cpp +++ b/Controllers/MSIMysticLightController/MSIMysticLight112Controller/MSIMysticLight112Controller.cpp @@ -395,10 +395,9 @@ void MSIMysticLight112Controller::ReadName() hid_get_manufacturer_string(dev, tname, 256); /*-----------------------------------------------------*\ - | Convert wchar_t into std::wstring into std::string | + | Convert to std::string | \*-----------------------------------------------------*/ - std::wstring wname = std::wstring(tname); - name = std::string(wname.begin(), wname.end()); + name = StringUtils::wstring_to_string(tname); /*-----------------------------------------------------*\ | Get the product string from HID | @@ -408,8 +407,7 @@ void MSIMysticLight112Controller::ReadName() /*-----------------------------------------------------*\ | Append the product string to the manufacturer string | \*-----------------------------------------------------*/ - wname = std::wstring(tname); - name.append(" ").append(std::string(wname.begin(), wname.end())); + name.append(" ").append(StringUtils::wstring_to_string(tname)); } MSI_MODE MSIMysticLight112Controller::GetMode()