summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend
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 /src/frontend
parent1ed70b0181557558aa2e685f7f7bbe81a54d0626 (diff)
Eliminate many unnecessary c_str calls
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/mame/clifront.cpp16
-rw-r--r--src/frontend/mame/infoxml.cpp2
-rw-r--r--src/frontend/mame/mame.cpp4
3 files changed, 11 insertions, 11 deletions
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;
}
}