diff options
author | 2016-01-11 09:18:43 +0100 | |
---|---|---|
committer | 2016-01-11 09:18:43 +0100 | |
commit | 36195292e370de0fb6b32085c105a236995ce36e (patch) | |
tree | 1fb147c3e21824272b60e4989f606bc9c206030c /src/devices/cpu/drcuml.cpp | |
parent | 7c944fa3b02cd26dec3c27f1e6a4c0d33f462c4e (diff) | |
parent | 115db95642ad6d861aad63775b92350e0491f2dd (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/drcuml.cpp')
-rw-r--r-- | src/devices/cpu/drcuml.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/devices/cpu/drcuml.cpp b/src/devices/cpu/drcuml.cpp index 4cf2fc981c0..3bbd610cfa9 100644 --- a/src/devices/cpu/drcuml.cpp +++ b/src/devices/cpu/drcuml.cpp @@ -456,7 +456,6 @@ void drcuml_block::optimize() void drcuml_block::disassemble() { std::string comment; - std::string dasm; // iterate over instructions and output int firstcomment = -1; @@ -483,7 +482,7 @@ void drcuml_block::disassemble() // indent everything else with a tab else { - m_inst[instnum].disasm(dasm, &m_drcuml); + std::string dasm = m_inst[instnum].disasm(&m_drcuml); // include the first accumulated comment with this line if (firstcomment != -1) @@ -1119,16 +1118,14 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st // output the error if we have one if (errend != errorbuf) { - char disasm[256]; - // disassemble the test instruction - testinst->disasm(disasm, drcuml); + std::string disasm = testinst->disasm(drcuml); // output a description of what went wrong printf("\n"); printf("----------------------------------------------\n"); printf("Backend validation error:\n"); - printf(" %s\n", disasm); + printf(" %s\n", disasm.c_str()); printf("\n"); printf("Errors:\n"); printf("%s\n", errorbuf); |