diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index 148facf5cc4..0a71dd3afe5 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -582,7 +582,7 @@ const char *emu_options::sub_value(std::string &buffer, const char *name, const { std::string tmp = std::string(",").append(subname).append("="); buffer = value(name); - int pos = buffer.find(tmp.c_str()); + int pos = buffer.find(tmp); if (pos != -1) { int endpos = buffer.find_first_of(',', pos + 1); diff --git a/src/emu/info.c b/src/emu/info.c index 25ea424130f..8cdf12f1ded 100644 --- a/src/emu/info.c +++ b/src/emu/info.c @@ -645,7 +645,7 @@ void info_xml_creator::output_chips(device_t &device, const char *root_tag) if (strcmp(exec->device().tag(), device.tag())) { std::string newtag(exec->device().tag()), oldtag(":"); - newtag = newtag.substr(newtag.find(oldtag.append(root_tag).c_str()) + oldtag.length()); + newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length()); fprintf(m_output, "\t\tdevice().tag(), device.tag())) { std::string newtag(sound->device().tag()), oldtag(":"); - newtag = newtag.substr(newtag.find(oldtag.append(root_tag).c_str()) + oldtag.length()); + newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length()); fprintf(m_output, "\t\ttag(), device.tag())) { std::string newtag(screendev->tag()), oldtag(":"); - newtag = newtag.substr(newtag.find(oldtag.append(root_tag).c_str()) + oldtag.length()); + newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length()); fprintf(m_output, "\t\ttag()), oldtag(":"); - newtag = newtag.substr(newtag.find(oldtag.append(root_tag).c_str()) + oldtag.length()); + newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length()); // output the switch name information std::string normalized_field_name(xml_normalize_string(field->name())); @@ -1228,7 +1228,7 @@ void info_xml_creator::output_images(device_t &device, const char *root_tag) if (strcmp(imagedev->device().tag(), device.tag())) { std::string newtag(imagedev->device().tag()), oldtag(":"); - newtag = newtag.substr(newtag.find(oldtag.append(root_tag).c_str()) + oldtag.length()); + newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length()); // print m_output device type fprintf(m_output, "\t\timage_type_name())); @@ -1286,7 +1286,7 @@ void info_xml_creator::output_slots(device_t &device, const char *root_tag) if (strcmp(slot->device().tag(), device.tag())) { std::string newtag(slot->device().tag()), oldtag(":"); - newtag = newtag.substr(newtag.find(oldtag.append(root_tag).c_str()) + oldtag.length()); + newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length()); // print m_output device type fprintf(m_output, "\t\t\n", xml_normalize_string(newtag.c_str())); diff --git a/src/emu/machine.c b/src/emu/machine.c index ae85784ed46..16f038e6eb9 100644 --- a/src/emu/machine.c +++ b/src/emu/machine.c @@ -206,7 +206,7 @@ TIMER_CALLBACK_MEMBER(running_machine::autoboot_callback) else if (strlen(options().autoboot_command())!=0) { std::string cmd = std::string(options().autoboot_command()); strreplace(cmd, "'", "\\'"); - std::string val = std::string("emu.keypost('").append(cmd.c_str()).append("')").c_str(); + std::string val = std::string("emu.keypost('").append(cmd).append("')"); manager().lua()->load_string(val.c_str()); } } @@ -563,7 +563,7 @@ std::string running_machine::get_statename(const char *option) // handle %d in the template (for image devices) std::string statename_dev("%d_"); - int pos = statename_str.find(statename_dev.c_str()); + int pos = statename_str.find(statename_dev); if (pos != -1) { diff --git a/src/emu/romload.c b/src/emu/romload.c index fe3104d7f8a..2e64fe20c58 100644 --- a/src/emu/romload.c +++ b/src/emu/romload.c @@ -675,7 +675,7 @@ static int open_rom_file(romload_private *romdata, const char *regiontag, const } // prepare locations where we have to load from: list/parentname & list/clonename - std::string swlist(tag1.c_str()); + std::string swlist(tag1); tag2.assign(swlist.append(tag4)); if (has_parent) { @@ -1076,7 +1076,7 @@ int open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_ } // prepare locations where we have to load from: list/parentname (if any) & list/clonename - std::string swlist(tag1.c_str()); + std::string swlist(tag1); tag2.assign(swlist.append(tag4)); if (has_parent) { diff --git a/src/emu/softlist.c b/src/emu/softlist.c index c2e8dba671a..c90bb6cccdc 100644 --- a/src/emu/softlist.c +++ b/src/emu/softlist.c @@ -158,7 +158,7 @@ bool software_part::is_compatible(const software_list_device &swlistdev) const for (int start = 0, end = filt.find_first_of(',',start); end != -1; start = end + 1, end = filt.find_first_of(',', start)) { std::string token(filt, start, end - start + 1); - if (comp.find(token.c_str()) != -1) + if (comp.find(token) != -1) return true; } return false; @@ -181,7 +181,7 @@ bool software_part::matches_interface(const char *interface_list) const // then add a comma to the end of our interface and return true if we find it in the list string std::string our_interface = std::string(m_interface).append(","); - return (interfaces.find(our_interface.c_str()) != -1); + return (interfaces.find(our_interface) != -1); } diff --git a/src/emu/video.c b/src/emu/video.c index adc2888b2e7..bdeb0d33faf 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -1126,7 +1126,7 @@ file_error video_manager::open_next(emu_file &file, const char *extension) // handle %d in the template (for image devices) std::string snapdev("%d_"); - int pos = snapstr.find(snapdev.c_str()); + int pos = snapstr.find(snapdev); if (pos != -1) { diff --git a/src/mame/machine/315-5881_crypt.c b/src/mame/machine/315-5881_crypt.c index 7997000400d..ec07d1c8380 100644 --- a/src/mame/machine/315-5881_crypt.c +++ b/src/mame/machine/315-5881_crypt.c @@ -47,7 +47,7 @@ void sega_315_5881_crypt_device::device_start() save_item(NAME(line_buffer_pos)); save_item(NAME(line_buffer_size)); - std::string skey = parameter("key").c_str(); + std::string skey = parameter("key"); if(!skey.empty()) key = strtoll(skey.c_str(), 0, 16); else diff --git a/src/mame/machine/naomim1.c b/src/mame/machine/naomim1.c index 86f0119f578..84d2db5ecef 100644 --- a/src/mame/machine/naomim1.c +++ b/src/mame/machine/naomim1.c @@ -32,7 +32,7 @@ void naomi_m1_board::device_start() { naomi_board::device_start(); - std::string skey = parameter("key").c_str(); + std::string skey = parameter("key"); if(!skey.empty()) key = strtoll(skey.c_str(), 0, 16); else