Fix wstring to string conversion warnings in AlienwareAW510KController.cpp

This commit is contained in:
Adam Honse 2024-07-30 00:24:45 -05:00
parent 9f09c7b503
commit 32d9211e7d

View file

@ -11,6 +11,7 @@
#include <cstring>
#include "AlienwareAW510KController.h"
#include "StringUtils.h"
AlienwareAW510KController::AlienwareAW510KController(hid_device* dev_handle, const char* path)
{
@ -33,12 +34,14 @@ std::string AlienwareAW510KController::GetDeviceLocation()
std::string AlienwareAW510KController::GetSerialString()
{
wchar_t serial_string[128];
hid_get_serial_number_string(dev, serial_string, 128);
int ret = hid_get_serial_number_string(dev, serial_string, 128);
std::wstring return_wstring = serial_string;
std::string return_string(return_wstring.begin(), return_wstring.end());
if(ret != 0)
{
return("");
}
return(return_string);
return(StringUtils::wstring_to_string(serial_string));
}
void AlienwareAW510KController::SendCommit()