From e7d10a85822a6acd76d504be7dad63431ba17b0b Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Wed, 7 Aug 2024 21:42:36 -0500 Subject: [PATCH] Fix wstring to string conversion warning in MSIMysticLight162Controller.cpp --- .../MSIMysticLight162Controller.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Controllers/MSIMysticLightController/MSIMysticLight162Controller/MSIMysticLight162Controller.cpp b/Controllers/MSIMysticLightController/MSIMysticLight162Controller/MSIMysticLight162Controller.cpp index 3b860560..ce2cee37 100644 --- a/Controllers/MSIMysticLightController/MSIMysticLight162Controller/MSIMysticLight162Controller.cpp +++ b/Controllers/MSIMysticLightController/MSIMysticLight162Controller/MSIMysticLight162Controller.cpp @@ -418,10 +418,9 @@ void MSIMysticLight162Controller::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 | @@ -431,8 +430,7 @@ void MSIMysticLight162Controller::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 MSIMysticLight162Controller::GetMode()