summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ioport.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-09-26 20:53:06 +1000
committer Vas Crabb <vas@vastheman.com>2019-09-26 20:53:06 +1000
commit9a12ab37afb3e43d9d3c296b34348b835bafb2ea (patch)
tree6af7ce1fc5f52b1518100a1be926514cd2f34feb /src/emu/ioport.cpp
parent9d4b7b02acdb79fac05606f57c3fddd08593cba8 (diff)
Make osd_printf_* use util/strformat semantics.
(nw) This has been a long time coming but it's here at last. It should be easier now that logerror, popmessage and osd_printf_* behave like string_format and stream_format. Remember the differences from printf: * Any object with a stream out operator works with %s * %d, %i, %o, %x, %X, etc. work out the size by magic * No sign extending promotion to int for short/char * No widening/narrowing conversions for characters/strings * Same rules on all platforms, insulated from C runtime library * No format warnings from compiler * Assert in debug builds if number of arguments doesn't match format (nw) Also removed a pile of redundant c_str and string_format, and some workarounds for not being able to portably format 64-bit integers or long long.
Diffstat (limited to 'src/emu/ioport.cpp')
-rw-r--r--src/emu/ioport.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp
index e74502439fe..58161b78a83 100644
--- a/src/emu/ioport.cpp
+++ b/src/emu/ioport.cpp
@@ -1706,7 +1706,7 @@ time_t ioport_manager::initialize()
std::string errors;
m_portlist.append(device, errors);
if (!errors.empty())
- osd_printf_error("Input port errors:\n%s", errors.c_str());
+ osd_printf_error("Input port errors:\n%s", errors);
}
// renumber player numbers for controller ports
@@ -2558,12 +2558,12 @@ time_t ioport_manager::playback_init()
osd_printf_info("INP version %u.%u\n", header.get_majversion(), header.get_minversion());
time_t basetime = header.get_basetime();
osd_printf_info("Created %s\n", ctime(&basetime));
- osd_printf_info("Recorded using %s\n", header.get_appdesc().c_str());
+ osd_printf_info("Recorded using %s\n", header.get_appdesc());
// verify the header against the current game
std::string const sysname = header.get_sysname();
if (sysname != machine().system().name)
- osd_printf_info("Input file is for machine '%s', not for current machine '%s'\n", sysname.c_str(), machine().system().name);
+ osd_printf_info("Input file is for machine '%s', not for current machine '%s'\n", sysname, machine().system().name);
// enable compression
m_playback_file.compress(FCOMPRESS_MEDIUM);
@@ -2907,15 +2907,15 @@ void ioport_manager::record_frame(const attotime &curtime)
timecode_key = string_format("EXTRA_STOP_%03d", (m_timecode_count-4)/2);
}
- osd_printf_info("%s \n", message.c_str());
- machine().popmessage("%s \n", message.c_str());
+ osd_printf_info("%s \n", message);
+ machine().popmessage("%s \n", message);
m_timecode_file.printf(
"%-19s %s %s %s %s %s %s\n",
- timecode_key.c_str(),
- current_time_str.c_str(), elapsed_time_str.c_str(),
- mseconds_start_str.c_str(), mseconds_elapsed_str.c_str(),
- frame_start_str.c_str(), frame_elapsed_str.c_str());
+ timecode_key,
+ current_time_str, elapsed_time_str,
+ mseconds_start_str, mseconds_elapsed_str,
+ frame_start_str, frame_elapsed_str);
machine().video().set_timecode_write(false);
machine().video().set_timecode_text(timecode_text);