summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input/input_dinput.cpp
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2016-07-24 22:55:00 -0400
committer Nathan Woods <npwoods@mess.org>2016-07-24 22:55:00 -0400
commitab73291e479be171d6f89798ed706b5ea58aa09f (patch)
tree456ca9bc290187a50909bdf33b610f09e55be70e /src/osd/modules/input/input_dinput.cpp
parent59dafc2261ff1bbe553d64b4aca7b9806b663490 (diff)
Changed strconv.[cpp|h] functions to return their results as std::string and std::wstring
Diffstat (limited to 'src/osd/modules/input/input_dinput.cpp')
-rw-r--r--src/osd/modules/input/input_dinput.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/osd/modules/input/input_dinput.cpp b/src/osd/modules/input/input_dinput.cpp
index 061eab446e8..0db6695565d 100644
--- a/src/osd/modules/input/input_dinput.cpp
+++ b/src/osd/modules/input/input_dinput.cpp
@@ -260,29 +260,18 @@ public:
return std::string(defstring);
}
- auto osd_free_deleter = [](char *p) { osd_free(p); };
-
// convert the name to utf8
- auto namestring = std::unique_ptr<char, decltype(osd_free_deleter)>(utf8_from_tstring(instance.tszName), osd_free_deleter);
+ std::string namestring = utf8_from_tstring(instance.tszName);
// if no suffix, return as-is
if (suffix == nullptr)
- {
- return std::string(namestring.get());
- }
-
- // otherwise, allocate space to add the suffix
- auto combined = std::make_unique<char[]>(strlen(namestring.get()) + 1 + _tcslen(suffix) + 1);
+ return namestring;
// convert the suffix to utf8
- auto suffix_utf8 = std::unique_ptr<char, decltype(osd_free_deleter)>(utf8_from_tstring(suffix), osd_free_deleter);
+ std::string suffix_utf8 = utf8_from_tstring(suffix);
// Concat the name and suffix
- strcpy(combined.get(), namestring.get());
- strcat(combined.get(), " ");
- strcat(combined.get(), suffix_utf8.get());
-
- return std::string(combined.get());
+ return namestring + " " + suffix_utf8;
}
protected: