summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-01-20 21:31:09 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2016-01-20 21:31:09 +0100
commit2cc5e240f49a2ac0434c8b26d2ad2d34f3fd5bb1 (patch)
tree2c79f875a7073ee734ec7bf391323e9d8b3b07b0
parenta3a9fd0bdf8521b23f6a0dfca410a97abc0893df (diff)
Revert "can't store pointer to temp object in const char * (nw)"
This reverts commit ff5bde34bb543ec536b58426d00a31bd5a5fd73a.
-rw-r--r--src/emu/audit.cpp15
-rw-r--r--src/emu/audit.h4
2 files changed, 10 insertions, 9 deletions
diff --git a/src/emu/audit.cpp b/src/emu/audit.cpp
index 5f1aebe4573..640ab2ca48f 100644
--- a/src/emu/audit.cpp
+++ b/src/emu/audit.cpp
@@ -25,7 +25,8 @@
media_auditor::media_auditor(const driver_enumerator &enumerator)
: m_enumerator(enumerator),
- m_validation(AUDIT_VALIDATE_FULL)
+ m_validation(AUDIT_VALIDATE_FULL),
+ m_searchpath(nullptr)
{
}
@@ -57,7 +58,7 @@ const char *driverpath = m_enumerator.config().root_device().searchpath().c_str(
for (device_t *device = deviter.first(); device != nullptr; device = deviter.next())
{
// determine the search path for this source and iterate through the regions
- m_searchpath = device->searchpath();
+ m_searchpath = device->searchpath().c_str();
// now iterate over regions and ROMs within
for (const rom_entry *region = rom_first_region(*device); region != nullptr; region = rom_next_region(region))
@@ -66,7 +67,7 @@ const char *driverpath = m_enumerator.config().root_device().searchpath().c_str(
std::string combinedpath = std::string(device->searchpath()).append(";").append(driverpath);
if (!device->shortname().empty())
combinedpath.append(";").append(device->shortname());
-m_searchpath = combinedpath;
+m_searchpath = combinedpath.c_str();
for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
{
@@ -130,7 +131,7 @@ media_auditor::summary media_auditor::audit_device(device_t *device, const char
// store validation for later
m_validation = validation;
- m_searchpath = device->shortname();
+ m_searchpath = device->shortname().c_str();
int found = 0;
int required = 0;
@@ -201,7 +202,7 @@ media_auditor::summary media_auditor::audit_software(const char *list_name, soft
locationtag.append(swinfo->parentname());
combinedpath.append(";").append(swinfo->parentname()).append(";").append(list_name).append(PATH_SEPARATOR).append(swinfo->parentname());
}
- m_searchpath = combinedpath;
+ m_searchpath = combinedpath.c_str();
int found = 0;
int required = 0;
@@ -427,7 +428,7 @@ audit_record *media_auditor::audit_one_rom(const rom_entry *rom)
// find the file and checksum it, getting the file length along the way
emu_file file(m_enumerator.options().media_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD);
file.set_restrict_to_mediapath(true);
- path_iterator path(m_searchpath.c_str());
+ path_iterator path(m_searchpath);
std::string curpath;
while (path.next(curpath, record.name()))
{
@@ -441,7 +442,7 @@ audit_record *media_auditor::audit_one_rom(const rom_entry *rom)
// if it worked, get the actual length and hashes, then stop
if (filerr == FILERR_NONE)
{
- record.set_actual(file.hashes(m_validation.c_str()), file.size());
+ record.set_actual(file.hashes(m_validation), file.size());
break;
}
}
diff --git a/src/emu/audit.h b/src/emu/audit.h
index 7721f2c2acc..d39ecbb3a91 100644
--- a/src/emu/audit.h
+++ b/src/emu/audit.h
@@ -161,8 +161,8 @@ private:
// internal state
simple_list<audit_record> m_record_list;
const driver_enumerator & m_enumerator;
- std::string m_validation;
- std::string m_searchpath;
+ const char * m_validation;
+ const char * m_searchpath;
};