summaryrefslogtreecommitdiffstatshomepage
path: root/src/ldplayer
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-01-08 17:18:54 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-01-08 17:18:54 +0000
commita92de5930cef847ffdafd1e6c8e9f2bf03375c39 (patch)
treee8e5887dfcf861cc77ed1675015267450fc6fc8a /src/ldplayer
parenta0a40f8815e5c16bd2ab8ee333d19bcfe1e6ee55 (diff)
Extended the astring class wrapper into something useful, and
useable as a stack object. Also designed the interfaces to allow for chaining operations. And added a casting operator to const char * for seamless use in most functions that take plain old C strings. Changed all uses of astring to use the object directly on the stack or embedded in objects instead of explicitly allocating and deallocating it. Removed a lot of annoying memory management code as a result. Changed interfaces that accepted/returned an astring * to use an astring & instead. Removed auto_alloc_astring(machine). Use auto_alloc(machine, astring) instead.
Diffstat (limited to 'src/ldplayer')
-rw-r--r--src/ldplayer/ldplayer.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c
index 4ce6d6998bc..258addf33f1 100644
--- a/src/ldplayer/ldplayer.c
+++ b/src/ldplayer/ldplayer.c
@@ -62,7 +62,7 @@ enum
*
*************************************/
-static astring *filename;
+static astring filename;
static input_port_value last_controls;
static UINT8 playing;
@@ -83,7 +83,6 @@ static void (*execute_command)(const device_config *laserdisc, int command);
static void free_string(running_machine *machine)
{
- astring_free(filename);
}
@@ -123,7 +122,7 @@ static chd_file *get_disc(const device_config *device)
if (chderr == CHDERR_NONE)
{
set_disk_handle(device->machine, "laserdisc", image_file, image_chd);
- filename = astring_dupc(dir->name);
+ filename.cpy(dir->name);
add_exit_callback(device->machine, free_string);
break;
}
@@ -264,7 +263,7 @@ static MACHINE_RESET( ldplayer )
timer_set(machine, attotime_zero, NULL, 0, autoplay);
/* indicate the name of the file we opened */
- popmessage("Opened %s\n", astring_c(filename));
+ popmessage("Opened %s\n", filename.cstr());
}