From e84a9b5327e866458de0d73ae7bad1f031f6693d Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Wed, 7 Aug 2024 21:45:49 -0500 Subject: [PATCH] Fix wstring to string conversion warning in MSIMysticLight64Controller.cpp --- .../MSIMysticLight64Controller.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Controllers/MSIMysticLightController/MSIMysticLight64Controller/MSIMysticLight64Controller.cpp b/Controllers/MSIMysticLightController/MSIMysticLight64Controller/MSIMysticLight64Controller.cpp index c62b8887..b3ace58a 100644 --- a/Controllers/MSIMysticLightController/MSIMysticLight64Controller/MSIMysticLight64Controller.cpp +++ b/Controllers/MSIMysticLightController/MSIMysticLight64Controller/MSIMysticLight64Controller.cpp @@ -70,10 +70,9 @@ std::string MSIMysticLight64Controller::GetDeviceName() 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); - std::string name = std::string(wname.begin(), wname.end()); + std::string name = StringUtils::wstring_to_string(tname); /*-----------------------------------------------------*\ | Get the product string from HID | @@ -83,9 +82,9 @@ std::string MSIMysticLight64Controller::GetDeviceName() /*-----------------------------------------------------*\ | Append the product string to the manufacturer string | \*-----------------------------------------------------*/ - wname = std::wstring(tname); - name.append(" ").append(std::string(wname.begin(), wname.end())); - return name; + name.append(" ").append(StringUtils::wstring_to_string(tname)); + + return(name); } std::string MSIMysticLight64Controller::GetFWVersion()