diff options
| author | 2016-07-24 22:55:00 -0400 | |
|---|---|---|
| committer | 2016-07-24 22:55:00 -0400 | |
| commit | ab73291e479be171d6f89798ed706b5ea58aa09f (patch) | |
| tree | 456ca9bc290187a50909bdf33b610f09e55be70e /src/osd/modules/input/input_rawinput.cpp | |
| parent | 59dafc2261ff1bbe553d64b4aca7b9806b663490 (diff) | |
Changed strconv.[cpp|h] functions to return their results as std::string and std::wstring
Diffstat (limited to 'src/osd/modules/input/input_rawinput.cpp')
| -rw-r--r-- | src/osd/modules/input/input_rawinput.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/osd/modules/input/input_rawinput.cpp b/src/osd/modules/input/input_rawinput.cpp index f16d79cbe7a..3c617ef191a 100644 --- a/src/osd/modules/input/input_rawinput.cpp +++ b/src/osd/modules/input/input_rawinput.cpp @@ -507,10 +507,9 @@ protected: std::wstring name = rawinput_device_improve_name(tname.get()); // convert name to utf8 - auto osd_deleter = [](void *ptr) { osd_free(ptr); }; - auto utf8_name = std::unique_ptr<char, decltype(osd_deleter)>(utf8_from_wstring(name.c_str()), osd_deleter); + std::string utf8_name = utf8_from_wstring(name.c_str()); - devinfo = devicelist()->create_device<TDevice>(machine, utf8_name.get(), *this); + devinfo = devicelist()->create_device<TDevice>(machine, utf8_name.c_str(), *this); // Add the handle devinfo->set_handle(rawinputdevice->hDevice); @@ -609,16 +608,14 @@ protected: { input_item_id itemid = table.map_di_scancode_to_itemid(keynum); TCHAR keyname[100]; - char *name; // generate the name if (GetKeyNameText(((keynum & 0x7f) << 16) | ((keynum & 0x80) << 17), keyname, ARRAY_LENGTH(keyname)) == 0) _sntprintf(keyname, ARRAY_LENGTH(keyname), TEXT("Scan%03d"), keynum); - name = utf8_from_tstring(keyname); + std::string name = utf8_from_tstring(keyname); // add the item to the device - devinfo->device()->add_item(name, itemid, generic_button_get_state<std::uint8_t>, &devinfo->keyboard.state[keynum]); - osd_free(name); + devinfo->device()->add_item(name.c_str(), itemid, generic_button_get_state<std::uint8_t>, &devinfo->keyboard.state[keynum]); } } }; |
