summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2020-12-21 22:47:30 -0500
committer AJR <ajrhacker@users.noreply.github.com>2020-12-21 22:47:30 -0500
commit0a5d207e667075f4ea0618339d971c0f977d9ce1 (patch)
tree9ccac3725e3ed25e4ab56fe43a4a50d821d54e0d
parent1ed70b0181557558aa2e685f7f7bbe81a54d0626 (diff)
Eliminate many unnecessary c_str calls
-rw-r--r--src/emu/addrmap.cpp6
-rw-r--r--src/emu/device.cpp2
-rw-r--r--src/emu/distate.cpp2
-rw-r--r--src/emu/emumem.cpp2
-rw-r--r--src/emu/emuopts.cpp2
-rw-r--r--src/emu/ioport.cpp4
-rw-r--r--src/emu/mconfig.cpp2
-rw-r--r--src/emu/sound.cpp2
-rw-r--r--src/emu/xtal.cpp2
-rw-r--r--src/frontend/mame/clifront.cpp16
-rw-r--r--src/frontend/mame/infoxml.cpp2
-rw-r--r--src/frontend/mame/mame.cpp4
-rw-r--r--src/osd/modules/render/bgfx/chainmanager.cpp10
-rw-r--r--src/osd/modules/render/bgfx/inputpair.cpp2
14 files changed, 29 insertions, 29 deletions
diff --git a/src/emu/addrmap.cpp b/src/emu/addrmap.cpp
index 7aeefd7baca..fab866a17d5 100644
--- a/src/emu/addrmap.cpp
+++ b/src/emu/addrmap.cpp
@@ -892,7 +892,7 @@ void address_map::import_submaps(running_machine &machine, device_t &owner, int
{
mapdevice = owner.subdevice(entry->m_read.m_tag);
if (mapdevice == nullptr)
- throw emu_fatalerror("Attempted to submap a non-existent device '%s' in space %d of device '%s'\n", owner.subtag(entry->m_read.m_tag).c_str(), m_spacenum, m_device->basetag());
+ throw emu_fatalerror("Attempted to submap a non-existent device '%s' in space %d of device '%s'\n", owner.subtag(entry->m_read.m_tag), m_spacenum, m_device->basetag());
}
// Grab the submap
@@ -1296,7 +1296,7 @@ void address_map::map_validity_check(validity_checker &valid, int spacenum) cons
break;
}
if (devtag.second && !devtag.first.get().subdevice(devtag.second))
- osd_printf_error("%s space memory map entry reads from nonexistent device '%s'\n", spaceconfig.m_name, devtag.first.get().subtag(devtag.second).c_str());
+ osd_printf_error("%s space memory map entry reads from nonexistent device '%s'\n", spaceconfig.m_name, devtag.first.get().subtag(devtag.second));
#ifndef MAME_DEBUG // assert will catch this earlier
(void)entry.unitmask_is_appropriate(entry.m_read.m_bits, entry.m_mask, entry.m_read.m_name);
#endif
@@ -1368,7 +1368,7 @@ void address_map::map_validity_check(validity_checker &valid, int spacenum) cons
break;
}
if (devtag.second && !devtag.first.get().subdevice(devtag.second))
- osd_printf_error("%s space memory map entry writes to nonexistent device '%s'\n", spaceconfig.m_name, devtag.first.get().subtag(devtag.second).c_str());
+ osd_printf_error("%s space memory map entry writes to nonexistent device '%s'\n", spaceconfig.m_name, devtag.first.get().subtag(devtag.second));
#ifndef MAME_DEBUG // assert will catch this earlier
(void)entry.unitmask_is_appropriate(entry.m_write.m_bits, entry.m_mask, entry.m_write.m_name);
#endif
diff --git a/src/emu/device.cpp b/src/emu/device.cpp
index 00f3645ca32..60f406342c4 100644
--- a/src/emu/device.cpp
+++ b/src/emu/device.cpp
@@ -613,7 +613,7 @@ void device_t::start()
// have the views register their state
if (!m_viewlist.empty())
- osd_printf_verbose("%s: Registering %d views\n", m_tag.c_str(), int(m_viewlist.size()));
+ osd_printf_verbose("%s: Registering %d views\n", m_tag, int(m_viewlist.size()));
for (memory_view *view : m_viewlist)
view->register_state();
diff --git a/src/emu/distate.cpp b/src/emu/distate.cpp
index e01609615d4..cd47948abd2 100644
--- a/src/emu/distate.cpp
+++ b/src/emu/distate.cpp
@@ -128,7 +128,7 @@ void device_state_entry::format_from_mask()
// make up a format based on the mask
if (m_datamask == 0)
- throw emu_fatalerror("%s state entry requires a nonzero mask\n", m_symbol.c_str());
+ throw emu_fatalerror("%s state entry requires a nonzero mask\n", m_symbol);
int width = 0;
for (u64 tempmask = m_datamask; tempmask != 0; tempmask >>= 4)
width++;
diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp
index a06423d8e2f..3f8dde789b1 100644
--- a/src/emu/emumem.cpp
+++ b/src/emu/emumem.cpp
@@ -960,7 +960,7 @@ void memory_bank::set_entry(int entrynum)
if (entrynum < 0 || entrynum >= int(m_entries.size()))
throw emu_fatalerror("memory_bank::set_entry called with out-of-range entry %d", entrynum);
if (m_entries[entrynum] == nullptr)
- throw emu_fatalerror("memory_bank::set_entry called for bank '%s' with invalid bank entry %d", m_tag.c_str(), entrynum);
+ throw emu_fatalerror("memory_bank::set_entry called for bank '%s' with invalid bank entry %d", m_tag, entrynum);
m_curentry = entrynum;
}
diff --git a/src/emu/emuopts.cpp b/src/emu/emuopts.cpp
index 690756a7011..6c4ec9d2655 100644
--- a/src/emu/emuopts.cpp
+++ b/src/emu/emuopts.cpp
@@ -885,7 +885,7 @@ emu_options::software_options emu_options::evaluate_initial_softlist_options(con
machine_config config(*m_system, *this);
software_list_device_enumerator iter(config.root_device());
if (iter.count() == 0)
- throw emu_fatalerror(EMU_ERR_FATALERROR, "Error: unknown option: %s\n", software_identifier.c_str());
+ throw emu_fatalerror(EMU_ERR_FATALERROR, "Error: unknown option: %s\n", software_identifier);
// and finally set up the stack
std::stack<std::string> software_identifier_stack;
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp
index 0ea6dd59d59..fbc3bfe7fbc 100644
--- a/src/emu/ioport.cpp
+++ b/src/emu/ioport.cpp
@@ -3060,7 +3060,7 @@ ioport_configurer& ioport_configurer::port_modify(const char *tag)
// find the existing port
m_curport = m_portlist.find(fulltag)->second.get();
if (m_curport == nullptr)
- throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag.c_str());
+ throw emu_fatalerror("Requested to modify nonexistent port '%s'", fulltag);
// bump the modification count, and reset current field/setting
m_curport->m_modcount++;
@@ -3114,7 +3114,7 @@ ioport_configurer& ioport_configurer::field_add_char(std::initializer_list<char3
util::stream_format(s, "%s%d", is_first ? "" : ",", (int)ch);
is_first = false;
}
- throw emu_fatalerror("PORT_CHAR(%s) could not be added - maximum amount exceeded\n", s.str().c_str());
+ throw emu_fatalerror("PORT_CHAR(%s) could not be added - maximum amount exceeded\n", s.str());
}
diff --git a/src/emu/mconfig.cpp b/src/emu/mconfig.cpp
index 32b82468c3a..c2a09ec8df7 100644
--- a/src/emu/mconfig.cpp
+++ b/src/emu/mconfig.cpp
@@ -272,7 +272,7 @@ std::pair<const char *, device_t *> machine_config::resolve_owner(const char *ta
part.assign(tag, next - tag);
owner = owner->subdevices().find(part);
if (!owner)
- throw emu_fatalerror("Could not find %s when looking up path for device %s\n", part.c_str(), orig_tag);
+ throw emu_fatalerror("Could not find %s when looking up path for device %s\n", part, orig_tag);
tag = next+1;
}
assert(tag[0] != '\0');
diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp
index 95bc85bc4ae..252c7fc469a 100644
--- a/src/emu/sound.cpp
+++ b/src/emu/sound.cpp
@@ -833,7 +833,7 @@ void sound_stream::apply_sample_rate_changes(u32 updatenum, u32 downstream_rate)
#if (SOUND_DEBUG)
void sound_stream::print_graph_recursive(int indent, int index)
{
- osd_printf_info("%*s%s Ch.%d @ %d\n", indent, "", name().c_str(), index + m_output_base, sample_rate());
+ osd_printf_info("%*s%s Ch.%d @ %d\n", indent, "", name(), index + m_output_base, sample_rate());
for (int index = 0; index < m_input.size(); index++)
if (m_input[index].valid())
{
diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp
index afaa452544c..191af34db68 100644
--- a/src/emu/xtal.cpp
+++ b/src/emu/xtal.cpp
@@ -543,7 +543,7 @@ void XTAL::fail(double base_clock, const std::string &message)
else
full_message += util::string_format(" Did you mean %.0f?", xtal_error_low ? xtal_error_low : xtal_error_high);
full_message += util::string_format(" Context: %s\n", message);
- fatalerror("%s\n", full_message.c_str());
+ fatalerror("%s\n", full_message);
}
/*
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp
index 1e8a59453c7..c284fc879d5 100644
--- a/src/frontend/mame/clifront.cpp
+++ b/src/frontend/mame/clifront.cpp
@@ -222,10 +222,10 @@ void cli_frontend::start_execution(mame_machine_manager *manager, const std::vec
{
// if we failed, check for no command and a system name first; in that case error on the name
if (m_options.command().empty() && mame_options::system(m_options) == nullptr && !m_options.attempted_system_name().empty())
- throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "Unknown system '%s'", m_options.attempted_system_name().c_str());
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "Unknown system '%s'", m_options.attempted_system_name());
// otherwise, error on the options
- throw emu_fatalerror(EMU_ERR_INVALID_CONFIG, "%s", ex.message().c_str());
+ throw emu_fatalerror(EMU_ERR_INVALID_CONFIG, "%s", ex.message());
}
// determine the base name of the EXE
@@ -310,7 +310,7 @@ int cli_frontend::execute(std::vector<std::string> &args)
// print them out
osd_printf_error("\n\"%s\" approximately matches the following\n"
- "supported machines (best match first):\n\n", m_options.attempted_system_name().c_str());
+ "supported machines (best match first):\n\n", m_options.attempted_system_name());
for (int match : matches)
{
if (0 <= match)
@@ -941,7 +941,7 @@ void cli_frontend::verifyroms(const std::vector<std::string> &args)
for (std::string const &pat : args)
{
if (!*it)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", pat.c_str());
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", pat);
++it;
}
@@ -950,9 +950,9 @@ void cli_frontend::verifyroms(const std::vector<std::string> &args)
{
// if we didn't get anything at all, display a generic end message
if (notfound > 0)
- throw emu_fatalerror(EMU_ERR_MISSING_FILES, "romset \"%s\" not found!\n", args[0].c_str());
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "romset \"%s\" not found!\n", args[0]);
else
- throw emu_fatalerror(EMU_ERR_MISSING_FILES, "romset \"%s\" has no roms!\n", args[0].c_str());
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "romset \"%s\" has no roms!\n", args[0]);
}
else
{
@@ -1533,7 +1533,7 @@ template <typename T, typename U> void cli_frontend::apply_action(const std::vec
for (std::string const &pat : args)
{
if (!*it)
- throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", pat.c_str());
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching systems found for '%s'", pat);
++it;
}
@@ -1717,7 +1717,7 @@ void cli_frontend::execute_commands(const char *exename)
if (!m_osd.execute_command(m_options.command().c_str()))
// if we get here, we don't know what has been requested
- throw emu_fatalerror(EMU_ERR_INVALID_CONFIG, "Unknown command '%s' specified", m_options.command().c_str());
+ throw emu_fatalerror(EMU_ERR_INVALID_CONFIG, "Unknown command '%s' specified", m_options.command());
}
diff --git a/src/frontend/mame/infoxml.cpp b/src/frontend/mame/infoxml.cpp
index 88d9e305b87..1aeee7b51d6 100644
--- a/src/frontend/mame/infoxml.cpp
+++ b/src/frontend/mame/infoxml.cpp
@@ -364,7 +364,7 @@ void info_xml_creator::output(std::ostream &out, const std::vector<std::string>
if (iter != matched.end())
{
int index = iter - matched.begin();
- throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching machines found for '%s'", patterns[index].c_str());
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_SYSTEM, "No matching machines found for '%s'", patterns[index]);
}
}
}
diff --git a/src/frontend/mame/mame.cpp b/src/frontend/mame/mame.cpp
index a2a6a02f815..a461a08b7e6 100644
--- a/src/frontend/mame/mame.cpp
+++ b/src/frontend/mame/mame.cpp
@@ -168,7 +168,7 @@ void mame_machine_manager::start_luaengine()
{
plugin *p = m_plugins->find(incl);
if (!p)
- fatalerror("Fatal error: Could not load plugin: %s\n", incl.c_str());
+ fatalerror("Fatal error: Could not load plugin: %s\n", incl);
p->m_start = true;
}
@@ -177,7 +177,7 @@ void mame_machine_manager::start_luaengine()
{
plugin *p = m_plugins->find(excl);
if (!p)
- fatalerror("Fatal error: Unknown plugin: %s\n", excl.c_str());
+ fatalerror("Fatal error: Unknown plugin: %s\n", excl);
p->m_start = false;
}
}
diff --git a/src/osd/modules/render/bgfx/chainmanager.cpp b/src/osd/modules/render/bgfx/chainmanager.cpp
index fb3c52e1fb0..b111cd7234e 100644
--- a/src/osd/modules/render/bgfx/chainmanager.cpp
+++ b/src/osd/modules/render/bgfx/chainmanager.cpp
@@ -157,7 +157,7 @@ bgfx_chain* chain_manager::load_chain(std::string name, uint32_t screen_index)
bx::FileReader reader;
if (!bx::open(&reader, path.c_str()))
{
- osd_printf_warning("Unable to open chain file %s, falling back to no post processing\n", path.c_str());
+ osd_printf_warning("Unable to open chain file %s, falling back to no post processing\n", path);
return nullptr;
}
@@ -176,8 +176,8 @@ bgfx_chain* chain_manager::load_chain(std::string name, uint32_t screen_index)
if (document.HasParseError())
{
std::string error(GetParseError_En(document.GetParseError()));
- osd_printf_warning("Unable to parse chain %s. Errors returned:\n", path.c_str());
- osd_printf_warning("%s\n", error.c_str());
+ osd_printf_warning("Unable to parse chain %s. Errors returned:\n", path);
+ osd_printf_warning("%s\n", error);
return nullptr;
}
@@ -185,7 +185,7 @@ bgfx_chain* chain_manager::load_chain(std::string name, uint32_t screen_index)
if (chain == nullptr)
{
- osd_printf_warning("Unable to load chain %s, falling back to no post processing\n", path.c_str());
+ osd_printf_warning("Unable to load chain %s, falling back to no post processing\n", path);
return nullptr;
}
@@ -392,7 +392,7 @@ int32_t chain_manager::slider_changed(running_machine &machine, void *arg, int i
if (str != nullptr)
{
- *str = string_format("%s", m_available_chains[m_current_chain[id]].m_name.c_str());
+ *str = string_format("%s", m_available_chains[m_current_chain[id]].m_name);
}
return m_current_chain[id];
diff --git a/src/osd/modules/render/bgfx/inputpair.cpp b/src/osd/modules/render/bgfx/inputpair.cpp
index 60d3c8791fe..09b77fc6891 100644
--- a/src/osd/modules/render/bgfx/inputpair.cpp
+++ b/src/osd/modules/render/bgfx/inputpair.cpp
@@ -103,7 +103,7 @@ int32_t bgfx_input_pair::texture_changed(int32_t id, std::string *str, int32_t n
file_name = file.substr(0, last_dot);
}
- *str = string_format("%s", file_name.c_str());
+ *str = file_name;
}
return m_current_texture;