summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-01-20 17:46:03 -0500
committer AJR <ajrhacker@users.noreply.github.com>2021-01-20 18:06:15 -0500
commit91921618c2e06bd0ed073b8efccd31a127c9012d (patch)
treed3958b32d8db82540cd31083766b22991eb8e8ae /src/osd/sdl
parentc691b79cce315acdfabe1901cb2b5a1e39957bc1 (diff)
Much more core std::string_view modernization
- Remove corestr.h from emu.h; update a few source files to not use it at all - Change strtrimspace, strtrimrightspace and core_filename_extract_* to be pure functions taking a std::string_view by value and returning the same type - Change strmakeupper and strmakelower to be pure functions taking a std::string_view and constructing a std::string - Remove the string-modifying version of zippath_parent - Change tag-based lookup functions in device_t to take std::string_view instead of const std::string & or const char * - Remove the subdevice tag cache from device_t (since device finders are now recommended) and replace it with a map covering directly owned subdevices only - Move the working directory setup method out of device_image_interface (only the UI seems to actually use the full version of this) - Change output_manager to use std::string_view for output name arguments - Change core_options to accept std::string_view for most name and value arguments (return values are still C strings for now) - Change miscellaneous other functions to accept std::string_view arguments - Remove a few string accessor macros from romload.h - Remove many unnecessary c_str() calls from logging/error messages
Diffstat (limited to 'src/osd/sdl')
-rw-r--r--src/osd/sdl/osdsdl.h6
-rw-r--r--src/osd/sdl/sdlmain.cpp3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h
index 4cbec2d9d14..126b007d331 100644
--- a/src/osd/sdl/osdsdl.h
+++ b/src/osd/sdl/osdsdl.h
@@ -96,11 +96,11 @@ public:
const char *keymap_file() const { return value(SDLOPTION_KEYMAP_FILE); }
// joystick mapping
- const char *joy_index(int index) const { return value(string_format("%s%d", SDLOPTION_JOYINDEX, index).c_str()); }
+ const char *joy_index(int index) const { return value(string_format("%s%d", SDLOPTION_JOYINDEX, index)); }
bool sixaxis() const { return bool_value(SDLOPTION_SIXAXIS); }
- const char *mouse_index(int index) const { return value(string_format("%s%d", SDLOPTION_MOUSEINDEX, index).c_str()); }
- const char *keyboard_index(int index) const { return value(string_format("%s%d", SDLOPTION_KEYBINDEX, index).c_str()); }
+ const char *mouse_index(int index) const { return value(string_format("%s%d", SDLOPTION_MOUSEINDEX, index)); }
+ const char *keyboard_index(int index) const { return value(string_format("%s%d", SDLOPTION_KEYBINDEX, index)); }
const char *video_driver() const { return value(SDLOPTION_VIDEODRIVER); }
const char *render_driver() const { return value(SDLOPTION_RENDERDRIVER); }
diff --git a/src/osd/sdl/sdlmain.cpp b/src/osd/sdl/sdlmain.cpp
index 5e0b12cef3b..f12e2fcb786 100644
--- a/src/osd/sdl/sdlmain.cpp
+++ b/src/osd/sdl/sdlmain.cpp
@@ -36,6 +36,7 @@
#include <SDL2/SDL.h>
// MAME headers
+#include "corestr.h"
#include "osdepend.h"
#include "emu.h"
#include "emuopts.h"
@@ -170,7 +171,7 @@ sdl_options::sdl_options()
std::string ini_path(INI_PATH);
add_entries(sdl_options::s_option_entries);
strreplace(ini_path,"APP_NAME", emulator_info::get_appname_lower());
- set_default_value(SDLOPTION_INIPATH, ini_path.c_str());
+ set_default_value(SDLOPTION_INIPATH, std::move(ini_path));
}
//============================================================