summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/emu/debug/debugcmd.cpp15
-rw-r--r--src/frontend/mame/ui/icorender.cpp6
-rw-r--r--src/osd/modules/debugger/debuggdbstub.cpp12
3 files changed, 12 insertions, 21 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index 064f102299c..7ef0110031e 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -1707,7 +1707,7 @@ void debugger_commands::execute_comment_add(const std::vector<std::string_view>
}
// Now try adding the comment
- std::string text(params[1]);
+ std::string const text(params[1]);
cpu->debug()->comment_add(address, text.c_str(), 0x00ff0000);
cpu->machine().debug_view().update_all(DVT_DISASSEMBLY);
}
@@ -2318,7 +2318,7 @@ void debugger_commands::execute_save(int spacenum, const std::vector<std::string
endoffset++;
// open the file
- std::string filename(params[0]);
+ std::string const filename(params[0]);
FILE *const f = fopen(filename.c_str(), "wb");
if (!f)
{
@@ -2411,7 +2411,7 @@ void debugger_commands::execute_saveregion(const std::vector<std::string_view> &
length = region->bytes() - offset;
/* open the file */
- std::string filename(params[0]);
+ std::string const filename(params[0]);
FILE *f = fopen(filename.c_str(), "wb");
if (!f)
{
@@ -2442,8 +2442,8 @@ void debugger_commands::execute_load(int spacenum, const std::vector<std::string
// open the file
std::ifstream f;
- std::string fname(params[0]);
- f.open(fname.c_str(), std::ifstream::in | std::ifstream::binary);
+ std::string const fname(params[0]);
+ f.open(fname, std::ifstream::in | std::ifstream::binary);
if (f.fail())
{
m_console.printf("Error opening file '%s'\n", params[0]);
@@ -3770,8 +3770,7 @@ void debugger_commands::execute_trace(const std::vector<std::string_view> &param
if (params.size() > 2)
{
std::stringstream stream;
- std::string flagparam(params[2]);
- stream.str(flagparam);
+ stream.str(std::string(params[2]));
std::string flag;
while (std::getline(stream, flag, '|'))
@@ -3812,7 +3811,7 @@ void debugger_commands::execute_trace(const std::vector<std::string_view> &param
}
// do it
- cpu->debug()->trace(f, trace_over, detect_loops, logerror, action.c_str());
+ cpu->debug()->trace(f, trace_over, detect_loops, logerror, action.c_str());
if (f)
m_console.printf("Tracing CPU '%s' to file %s\n", cpu->tag(), filename);
else
diff --git a/src/frontend/mame/ui/icorender.cpp b/src/frontend/mame/ui/icorender.cpp
index 63d3bb4b72a..363e64bad8b 100644
--- a/src/frontend/mame/ui/icorender.cpp
+++ b/src/frontend/mame/ui/icorender.cpp
@@ -179,7 +179,7 @@ bool load_ico_image(util::core_file &fp, unsigned count, unsigned index, bitmap_
{
// read the directory entry
std::error_condition err;
- size_t actual = 0;
+ size_t actual;
icon_dir_entry_t dir;
err = fp.seek(sizeof(icon_dir_t) + (sizeof(icon_dir_entry_t) * index), SEEK_SET);
if (!err)
@@ -212,8 +212,8 @@ int images_in_ico(util::core_file &fp)
{
// read and check the icon file header
std::error_condition err;
- size_t actual = 0;
- icon_dir_t header = { };
+ size_t actual;
+ icon_dir_t header;
err = fp.seek(0, SEEK_SET);
if (!err)
err = fp.read(&header, sizeof(header), actual);
diff --git a/src/osd/modules/debugger/debuggdbstub.cpp b/src/osd/modules/debugger/debuggdbstub.cpp
index cd21a4c5b1b..eaeb1df4cca 100644
--- a/src/osd/modules/debugger/debuggdbstub.cpp
+++ b/src/osd/modules/debugger/debuggdbstub.cpp
@@ -643,16 +643,8 @@ void debug_gdbstub::wait_for_debugger(device_t &device, bool firststop)
if ( firststop && !m_initialized )
{
- // find the "main" CPU, which is the first CPU (gdbstub doesn't seem to have any notion of switching CPUs)
- for (device_t &device : device_enumerator(m_machine->root_device()))
- {
- auto *cpu = dynamic_cast<cpu_device *>(&device);
- if (cpu)
- {
- m_maincpu = cpu;
- break;
- }
- }
+ // find the "main" CPU, which is the first CPU (gdbstub doesn't have any notion of switching CPUs)
+ m_maincpu = device_type_enumerator<cpu_device>(m_machine->root_device()).first();
if (!m_maincpu)
fatalerror("gdbstub: cannot find any CPUs\n");