mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
loop cleanup patch from ashridah
This commit is contained in:
parent
6342a9bdd7
commit
85cd891d8c
1 changed files with 1 additions and 17 deletions
|
@ -275,7 +275,6 @@ I_OGGMus_Info (void)
|
||||||
plitem_t *currenttrack = NULL;
|
plitem_t *currenttrack = NULL;
|
||||||
int count = 0, iter = 0, highesttrack = 0;
|
int count = 0, iter = 0, highesttrack = 0;
|
||||||
const char *trackstring;
|
const char *trackstring;
|
||||||
char **mapoutput = NULL;
|
|
||||||
|
|
||||||
if (!tracklist) {
|
if (!tracklist) {
|
||||||
Sys_Printf ("\n" "No Tracklist\n" "------------\n");
|
Sys_Printf ("\n" "No Tracklist\n" "------------\n");
|
||||||
|
@ -307,11 +306,6 @@ I_OGGMus_Info (void)
|
||||||
highesttrack = strtol ((char *) currentmap->data, NULL, 10);
|
highesttrack = strtol ((char *) currentmap->data, NULL, 10);
|
||||||
}
|
}
|
||||||
Sys_DPrintf ("Highest Track number = %i.\n", highesttrack);
|
Sys_DPrintf ("Highest Track number = %i.\n", highesttrack);
|
||||||
|
|
||||||
/* allocate a null terminated array of char *'s */
|
|
||||||
mapoutput = calloc (highesttrack + 1, sizeof (char *));
|
|
||||||
if (!mapoutput)
|
|
||||||
Sys_Error ("couldn't allocate mapoutput array!\n");
|
|
||||||
|
|
||||||
/* loop until we've extracted 'numval' trackmaps, or hit the highest track
|
/* loop until we've extracted 'numval' trackmaps, or hit the highest track
|
||||||
* number */
|
* number */
|
||||||
|
@ -323,20 +317,10 @@ I_OGGMus_Info (void)
|
||||||
Sys_DPrintf ("Skipping trackstring: %s.\n", trackstring);
|
Sys_DPrintf ("Skipping trackstring: %s.\n", trackstring);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mapoutput[iter] = nva (" %s - %s", trackstring,
|
Sys_Printf (" %s - %s\n", trackstring, (char *) currenttrack->data);
|
||||||
(char *) currenttrack->data);
|
|
||||||
if (!mapoutput[iter])
|
|
||||||
Sys_Error ("I_OGGMus: couldn't allocate mapstring!\n");
|
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* output the map, and delete the allocated strings */
|
|
||||||
for (iter = 0; (iter < ((plarray_t *) (keylist->data))->numvals); iter++) {
|
|
||||||
Sys_Printf ("%s\n", mapoutput[iter]);
|
|
||||||
free (mapoutput[iter]);
|
|
||||||
}
|
|
||||||
|
|
||||||
free (mapoutput);
|
|
||||||
PL_Free (keylist);
|
PL_Free (keylist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue