diff options
author | 2010-01-08 17:18:54 +0000 | |
---|---|---|
committer | 2010-01-08 17:18:54 +0000 | |
commit | a92de5930cef847ffdafd1e6c8e9f2bf03375c39 (patch) | |
tree | e8e5887dfcf861cc77ed1675015267450fc6fc8a /src/emu/cpu/x86log.c | |
parent | a0a40f8815e5c16bd2ab8ee333d19bcfe1e6ee55 (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/emu/cpu/x86log.c')
-rw-r--r-- | src/emu/cpu/x86log.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/emu/cpu/x86log.c b/src/emu/cpu/x86log.c index 5af2b8dad0e..e4727b132d2 100644 --- a/src/emu/cpu/x86log.c +++ b/src/emu/cpu/x86log.c @@ -54,7 +54,7 @@ struct _data_range_t /* the code logging context */ struct _x86log_context { - astring * filename; /* name of the file */ + astring filename; /* name of the file */ FILE * file; /* file we are logging to */ data_range_t data_range[MAX_DATA_RANGES]; /* list of data ranges */ @@ -94,7 +94,7 @@ x86log_context *x86log_create_context(const char *filename) log = global_alloc_clear(x86log_context); /* allocate the filename */ - log->filename = astring_dupc(filename); + log->filename.cpy(filename); /* reset things */ reset_log(log); @@ -113,7 +113,6 @@ void x86log_free_context(x86log_context *log) fclose(log->file); /* free the structure */ - astring_free(log->filename); global_free(log); } @@ -276,7 +275,7 @@ void x86log_printf(x86log_context *log, const char *format, ...) /* open the file, creating it if necessary */ if (log->file == NULL) - log->file = fopen(astring_c(log->filename), "w"); + log->file = fopen(log->filename, "w"); if (log->file == NULL) return; |