diff options
author | 2016-01-11 09:18:43 +0100 | |
---|---|---|
committer | 2016-01-11 09:18:43 +0100 | |
commit | 36195292e370de0fb6b32085c105a236995ce36e (patch) | |
tree | 1fb147c3e21824272b60e4989f606bc9c206030c /src/emu/dislot.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/emu/dislot.cpp')
-rw-r--r-- | src/emu/dislot.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/emu/dislot.cpp b/src/emu/dislot.cpp index 697eb673a9f..051dc33bdb2 100644 --- a/src/emu/dislot.cpp +++ b/src/emu/dislot.cpp @@ -63,17 +63,15 @@ device_slot_option *device_slot_interface::static_option(device_t &device, const device_t* device_slot_interface::get_card_device() { - const char *subtag; + std::string subtag; device_t *dev = nullptr; - std::string temp; - if (!device().mconfig().options().exists(device().tag()+1)) { - subtag = m_default_option; - } else { - subtag = device().mconfig().options().main_value(temp,device().tag()+1); - } - if (subtag && *subtag != 0) { + if (device().mconfig().options().exists(device().tag()+1)) + subtag = device().mconfig().options().main_value(device().tag()+1); + else if (m_default_option != nullptr) + subtag.assign(m_default_option); + if (!subtag.empty()) { device_slot_card_interface *intf = nullptr; - dev = device().subdevice(subtag); + dev = device().subdevice(subtag.c_str()); if (dev!=nullptr && !dev->interface(intf)) throw emu_fatalerror("get_card_device called for device '%s' with no slot card interface", dev->tag()); } |