diff options
author | 2016-01-10 16:36:18 -0500 | |
---|---|---|
committer | 2016-01-10 16:36:18 -0500 | |
commit | 115db95642ad6d861aad63775b92350e0491f2dd (patch) | |
tree | 8e7538ca804610335bff1927dc3b4d974b4c06da /src/emu/ui/ui.cpp | |
parent | 2a2a4a3c6e255c479d5072d02c2a40949f611ea6 (diff) |
Return std::string objects by value rather than pass by reference
- strprintf is unaltered, but strformat now takes one fewer argument
- state_string_export still fills a buffer, but has been made const
- get_default_card_software now takes no arguments but returns a string
Diffstat (limited to 'src/emu/ui/ui.cpp')
-rw-r--r-- | src/emu/ui/ui.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp index 39eeb6e5edb..db0f6f6d424 100644 --- a/src/emu/ui/ui.cpp +++ b/src/emu/ui/ui.cpp @@ -1153,8 +1153,7 @@ std::string &ui_manager::warnings_string(std::string &str) std::string &ui_manager::game_info_astring(std::string &str) { // print description, manufacturer, and CPU: - std::string tempstr; - strprintf(str, "%s\n%s %s\nDriver: %s\n\nCPU:\n", machine().system().description, machine().system().year, machine().system().manufacturer, core_filename_extract_base(tempstr, machine().system().source_file).c_str()); + strprintf(str, "%s\n%s %s\nDriver: %s\n\nCPU:\n", machine().system().description, machine().system().year, machine().system().manufacturer, core_filename_extract_base(machine().system().source_file).c_str()); // loop over all CPUs execute_interface_iterator execiter(machine().root_device()); @@ -1489,7 +1488,7 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co if (machine.ui().show_fps_counter()) { std::string tempstring; - machine.ui().draw_text_full(container, machine.video().speed_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f, + machine.ui().draw_text_full(container, machine.video().speed_text().c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, nullptr, nullptr); } @@ -1767,17 +1766,13 @@ void ui_manager::request_quit() UINT32 ui_manager::handler_confirm_quit(running_machine &machine, render_container *container, UINT32 state) { // get the text for 'UI Select' - std::string ui_select_text; - machine.input().seq_name(ui_select_text, machine.ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD)); + std::string ui_select_text = machine.input().seq_name(machine.ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD)); // get the text for 'UI Cancel' - std::string ui_cancel_text; - machine.input().seq_name(ui_cancel_text, machine.ioport().type_seq(IPT_UI_CANCEL, 0, SEQ_TYPE_STANDARD)); + std::string ui_cancel_text = machine.input().seq_name(machine.ioport().type_seq(IPT_UI_CANCEL, 0, SEQ_TYPE_STANDARD)); // assemble the quit message - std::string quit_message; - strprintf(quit_message, - "Are you sure you want to quit?\n\n" + std::string quit_message = strformat("Are you sure you want to quit?\n\n" "Press ''%s'' to quit,\n" "Press ''%s'' to return to emulation.", ui_select_text.c_str(), |