diff options
author | 2008-02-18 05:58:18 +0000 | |
---|---|---|
committer | 2008-02-18 05:58:18 +0000 | |
commit | 3e34860ccc59b665eddc286ba2b5d4959ec70261 (patch) | |
tree | d1d6a5bf3dc6bb69e63a38a7d21279b37ed865ee /src/emu/audit.c | |
parent | 07290e4c0e6703014359333edcfe5bc1ba71a833 (diff) |
Removed expand_machine_driver().
Replaced with machine_config_alloc() and machine_config_free().
Updated all call sites.
Normalized info.c style and simplified some of the code.
Diffstat (limited to 'src/emu/audit.c')
-rw-r--r-- | src/emu/audit.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/emu/audit.c b/src/emu/audit.c index a9baea3fd0d..7b24dd775e6 100644 --- a/src/emu/audit.c +++ b/src/emu/audit.c @@ -120,18 +120,17 @@ int audit_images(core_options *options, const game_driver *gamedrv, UINT32 valid int audit_samples(core_options *options, const game_driver *gamedrv, audit_record **audit) { - machine_config config; + machine_config *config = machine_config_alloc(gamedrv->drv); audit_record *record; int sndnum, sampnum; int records = 0; /* count the number of sample records attached to this driver */ - expand_machine_driver(gamedrv->drv, &config); #if HAS_SAMPLES - for (sndnum = 0; sndnum < ARRAY_LENGTH(config.sound); sndnum++) - if (config.sound[sndnum].type == SOUND_SAMPLES) + for (sndnum = 0; sndnum < ARRAY_LENGTH(config->sound); sndnum++) + if (config->sound[sndnum].type == SOUND_SAMPLES) { - const struct Samplesinterface *intf = (const struct Samplesinterface *)config.sound[sndnum].config; + const struct Samplesinterface *intf = (const struct Samplesinterface *)config->sound[sndnum].config; if (intf->samplenames != NULL) { @@ -145,7 +144,7 @@ int audit_samples(core_options *options, const game_driver *gamedrv, audit_recor /* if no records, just quit now */ if (records == 0) - return records; + goto skip; /* allocate memory for the records */ *audit = malloc_or_die(sizeof(**audit) * records); @@ -153,10 +152,10 @@ int audit_samples(core_options *options, const game_driver *gamedrv, audit_recor record = *audit; /* now iterate over sample entries */ - for (sndnum = 0; sndnum < ARRAY_LENGTH(config.sound); sndnum++) - if (config.sound[sndnum].type == SOUND_SAMPLES) + for (sndnum = 0; sndnum < ARRAY_LENGTH(config->sound); sndnum++) + if (config->sound[sndnum].type == SOUND_SAMPLES) { - const struct Samplesinterface *intf = (const struct Samplesinterface *)config.sound[sndnum].config; + const struct Samplesinterface *intf = (const struct Samplesinterface *)config->sound[sndnum].config; const char *sharedname = NULL; if (intf->samplenames != NULL) @@ -197,6 +196,8 @@ int audit_samples(core_options *options, const game_driver *gamedrv, audit_recor } } +skip: + machine_config_free(config); return records; } |