summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/m68000/m68kcpu.cpp
diff options
context:
space:
mode:
author Miodrag Milanović <mmicko@gmail.com>2016-01-11 09:18:43 +0100
committer Miodrag Milanović <mmicko@gmail.com>2016-01-11 09:18:43 +0100
commit36195292e370de0fb6b32085c105a236995ce36e (patch)
tree1fb147c3e21824272b60e4989f606bc9c206030c /src/devices/cpu/m68000/m68kcpu.cpp
parent7c944fa3b02cd26dec3c27f1e6a4c0d33f462c4e (diff)
parent115db95642ad6d861aad63775b92350e0491f2dd (diff)
Merge pull request #561 from ajrhacker/strings
Return std::string objects by value rather than pass by reference [ajrhacker]
Diffstat (limited to 'src/devices/cpu/m68000/m68kcpu.cpp')
-rw-r--r--src/devices/cpu/m68000/m68kcpu.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp
index 5b6d2a602bf..dc7e0b14a6f 100644
--- a/src/devices/cpu/m68000/m68kcpu.cpp
+++ b/src/devices/cpu/m68000/m68kcpu.cpp
@@ -1166,7 +1166,7 @@ void m68000_base_device::state_export(const device_state_entry &entry)
}
}
-void m68000_base_device::state_string_export(const device_state_entry &entry, std::string &str)
+void m68000_base_device::state_string_export(const device_state_entry &entry, std::string &str) const
{
UINT16 sr;
@@ -1734,14 +1734,11 @@ void m68000_base_device::define_state(void)
if (cpu_type & MASK_020_OR_LATER)
state_add(M68K_MSP, "MSP", iotemp).callimport().callexport();
- std::string tempstr;
for (int regnum = 0; regnum < 8; regnum++) {
- strprintf(tempstr,"D%d", regnum);
- state_add(M68K_D0 + regnum, tempstr.c_str(), dar[regnum]);
+ state_add(M68K_D0 + regnum, strformat("D%d", regnum).c_str(), dar[regnum]);
}
for (int regnum = 0; regnum < 8; regnum++) {
- strprintf(tempstr,"A%d", regnum);
- state_add(M68K_A0 + regnum, tempstr.c_str(), dar[8 + regnum]);
+ state_add(M68K_A0 + regnum, strformat("A%d", regnum).c_str(), dar[8 + regnum]);
}
state_add(M68K_PREF_ADDR, "PREF_ADDR", pref_addr).mask(addrmask);
@@ -1763,8 +1760,7 @@ void m68000_base_device::define_state(void)
if (cpu_type & MASK_030_OR_LATER)
{
for (int regnum = 0; regnum < 8; regnum++) {
- strprintf(tempstr,"FP%d", regnum);
- state_add(M68K_FP0 + regnum, tempstr.c_str(), iotemp).callimport().callexport().formatstr("%10s");
+ state_add(M68K_FP0 + regnum, strformat("FP%d", regnum).c_str(), iotemp).callimport().callexport().formatstr("%10s");
}
state_add(M68K_FPSR, "FPSR", fpsr);
state_add(M68K_FPCR, "FPCR", fpcr);