summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input
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/osd/modules/input
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/osd/modules/input')
-rw-r--r--src/osd/modules/input/input_sdlcommon.h2
-rw-r--r--src/osd/modules/input/input_x11.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/osd/modules/input/input_sdlcommon.h b/src/osd/modules/input/input_sdlcommon.h
index 377b04d71c9..ee13ce307dd 100644
--- a/src/osd/modules/input/input_sdlcommon.h
+++ b/src/osd/modules/input/input_sdlcommon.h
@@ -195,7 +195,7 @@ static inline void devmap_init(running_machine &machine, device_map_t *devmap, c
{
// remove the spaces from the name store it in the index
devmap->map[dev].name = remove_spaces(dev_name);
- osd_printf_verbose("%s: Logical id %d: %s\n", label, dev + 1, devmap->map[dev].name.c_str());
+ osd_printf_verbose("%s: Logical id %d: %s\n", label, dev + 1, devmap->map[dev].name);
devmap->initialized = 1;
}
}
diff --git a/src/osd/modules/input/input_x11.cpp b/src/osd/modules/input/input_x11.cpp
index 40df3d528b6..07ade15c764 100644
--- a/src/osd/modules/input/input_x11.cpp
+++ b/src/osd/modules/input/input_x11.cpp
@@ -469,7 +469,7 @@ public:
// Register and add the device
devinfo = create_lightgun_device(machine, index);
- osd_printf_verbose("%i: %s\n", index, name.c_str());
+ osd_printf_verbose("%i: %s\n", index, name);
// Find the device info associated with the name
info = find_device_info(m_display, name.c_str(), 0);
@@ -477,7 +477,7 @@ public:
// If we couldn't find the device, skip
if (info == nullptr)
{
- osd_printf_verbose("Can't find device %s!\n", name.c_str());
+ osd_printf_verbose("Can't find device %s!\n", name);
continue;
}