Fix wstring to string conversion warnings in AlienwareAW510KController.cpp
This commit is contained in:
parent
9f09c7b503
commit
32d9211e7d
1 changed files with 7 additions and 4 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue