From 840bf4189a76ba8fcf0df93a100bb8098687722c Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Mon, 29 Jul 2024 22:58:52 -0500 Subject: [PATCH] Fix wstring to string conversion warnings in SinowealthController1007.cpp --- .../SinowealthController1007.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Controllers/SinowealthController/SinowealthController1007.cpp b/Controllers/SinowealthController/SinowealthController1007.cpp index 810a2b76..32f70aa6 100644 --- a/Controllers/SinowealthController/SinowealthController1007.cpp +++ b/Controllers/SinowealthController/SinowealthController1007.cpp @@ -7,9 +7,10 @@ | Moon_darker (Vaker) 02.02.2022 | \*-----------------------------------------*/ -#include "SinowealthController1007.h" #include -#include +#include "LogManager.h" +#include "SinowealthController1007.h" +#include "StringUtils.h" SinowealthController1007::SinowealthController1007(hid_device* dev, char *_path) { @@ -44,15 +45,12 @@ std::string SinowealthController1007::GetSerialString() wchar_t serial_string[128]; int ret = hid_get_serial_number_string(dev, serial_string, 128); - if (ret != 0) + if(ret != 0) { return(""); } - std::wstring return_wstring = serial_string; - std::string return_string(return_wstring.begin(), return_wstring.end()); - - return(return_string); + return(StringUtils::wstring_to_string(serial_string)); } void SinowealthController1007::SetLEDColors(const std::vector& colors)