Misc. cleanups.

This commit is contained in:
Jeff Teunissen 2004-02-07 04:47:38 +00:00
parent 432ae86cca
commit 8811dd520e

View file

@ -64,6 +64,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "QF/dstring.h" #include "QF/dstring.h"
#include "QF/qfplist.h" #include "QF/qfplist.h"
#include "QF/sound.h" #include "QF/sound.h"
#include "QF/va.h"
#include "snd_render.h" #include "snd_render.h"
#include "compat.h" #include "compat.h"
@ -160,9 +161,9 @@ I_OGGMus_Shutdown (void)
static int static int
Load_Tracklist (void) Load_Tracklist (void)
{ {
static QFile *oggfile = NULL; QFile *oggfile = NULL;
char *buffile = NULL; char *buffile = NULL;
int size = -1; int size = -1;
Sys_DPrintf ("Entering Load_Tracklist\n"); Sys_DPrintf ("Entering Load_Tracklist\n");
@ -234,8 +235,8 @@ static void
I_OGGMus_Play (int track, qboolean looping) I_OGGMus_Play (int track, qboolean looping)
{ {
plitem_t *trackmap = NULL; plitem_t *trackmap = NULL;
dstring_t *trackstring = dstring_new ();
wavinfo_t *info = 0; wavinfo_t *info = 0;
const char *trackstring;
Sys_DPrintf ("Entering I_OGGMus_Play\n"); Sys_DPrintf ("Entering I_OGGMus_Play\n");
/* alrighty. grab the list, map track to filename. grab filename from data /* alrighty. grab the list, map track to filename. grab filename from data
@ -247,16 +248,13 @@ I_OGGMus_Play (int track, qboolean looping)
} }
if (!tracklist || !mus_enabled) { if (!tracklist || !mus_enabled) {
free (trackstring);
return; return;
} }
dsprintf (trackstring, "%i", track); trackstring = va ("%i", track);
trackmap = PL_ObjectForKey (tracklist, trackstring->str); trackmap = PL_ObjectForKey (tracklist, trackstring);
free (trackstring);
if (!trackmap || trackmap->type != QFString) { if (!trackmap || trackmap->type != QFString) {
Sys_Printf ("No Track entry for track #%s.\n", trackstring->str); Sys_Printf ("No Track entry for track #%s.\n", trackstring);
return; return;
} }