mirror of
https://github.com/libretro/libretro-prboom.git
synced 2025-02-17 05:27:37 +00:00
Cleanups
This commit is contained in:
parent
d17fc6b2d8
commit
b1c13e4671
@ -139,7 +139,7 @@ extern rng_t rng; // The rng's state
|
||||
extern unsigned long rngseed; // The starting seed (not part of state)
|
||||
|
||||
// As M_Random, but used by the play simulation.
|
||||
int P_Random(pr_class_t DA(const char *, int));
|
||||
int P_Random(pr_class_t);
|
||||
|
||||
// Returns a number from 0 to 255,
|
||||
#define M_Random() P_Random(pr_misc)
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
@ -648,10 +647,8 @@ midi_track_iter_t *MIDI_IterateTrack(const midi_file_t *file, unsigned int track
|
||||
{
|
||||
midi_track_iter_t *iter;
|
||||
|
||||
assert(track < file->num_tracks);
|
||||
|
||||
iter = malloc(sizeof(*iter));
|
||||
iter->track = &file->tracks[track];
|
||||
iter = malloc(sizeof(*iter));
|
||||
iter->track = &file->tracks[track];
|
||||
iter->position = 0;
|
||||
|
||||
return iter;
|
||||
|
@ -248,9 +248,6 @@ static void FillBuffer(int16_t *buffer, unsigned int nsamples)
|
||||
unsigned int i;
|
||||
int sampval;
|
||||
|
||||
// FIXME???
|
||||
//assert(nsamples < opl_sample_rate);
|
||||
|
||||
Chip__GenerateBlock2(&opl_chip, nsamples, mix_buffer);
|
||||
|
||||
// Mix into the destination buffer, doubling up into stereo.
|
||||
|
@ -587,7 +587,6 @@ void P_DeathThink (player_t* player)
|
||||
newtorch = 0;
|
||||
newtorchdelta = 0;
|
||||
}
|
||||
//printf("deaththink: %d\n", player-players);
|
||||
#endif
|
||||
|
||||
player->playerstate = PST_REBORN;
|
||||
@ -760,10 +759,7 @@ void P_PlayerThink (player_t* player)
|
||||
player->prev_viewpitch = player->mo->pitch + viewpitchoffset;
|
||||
}
|
||||
if (player->mo == 0)
|
||||
{
|
||||
//printf("player->mo == 0\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// killough 2/8/98, 3/21/98:
|
||||
if (player->cheats & CF_NOCLIP)
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "r_draw.h"
|
||||
#include "lprintf.h"
|
||||
#include "r_patch.h"
|
||||
#include <assert.h>
|
||||
|
||||
// posts are runs of non masked source pixels
|
||||
typedef struct
|
||||
@ -244,9 +243,6 @@ static void createPatch(int id) {
|
||||
patch->columns = (rcolumn_t*)((unsigned char*)patch->pixels + pixelDataSize);
|
||||
patch->posts = (rpost_t*)((unsigned char*)patch->columns + columnsDataSize);
|
||||
|
||||
// sanity check that we've got all the memory allocated we need
|
||||
assert((((uint8_t*)patch->posts + numPostsTotal*sizeof(rpost_t)) - (uint8_t*)patch->data) == dataSize);
|
||||
|
||||
memset(patch->pixels, 0xff, (patch->width*patch->height));
|
||||
|
||||
// fill in the pixels, posts, and columns
|
||||
@ -473,9 +469,6 @@ static void createTextureCompositePatch(int id) {
|
||||
composite_patch->columns = (rcolumn_t*)((unsigned char*)composite_patch->pixels + pixelDataSize);
|
||||
composite_patch->posts = (rpost_t*)((unsigned char*)composite_patch->columns + columnsDataSize);
|
||||
|
||||
// sanity check that we've got all the memory allocated we need
|
||||
assert((((uint8_t*)composite_patch->posts + numPostsTotal*sizeof(rpost_t)) - (uint8_t*)composite_patch->data) == dataSize);
|
||||
|
||||
memset(composite_patch->pixels, 0xff, (composite_patch->width*composite_patch->height));
|
||||
|
||||
numPostsUsedSoFar = 0;
|
||||
@ -594,7 +587,6 @@ static void createTextureCompositePatch(int id) {
|
||||
|
||||
oldColumn = (const column_t *)((const uint8_t *)oldColumn + oldColumn->length + 4);
|
||||
countsInColumn[tx].posts_used++;
|
||||
assert(countsInColumn[tx].posts_used <= countsInColumn[tx].posts);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "info.h"
|
||||
|
@ -292,7 +292,7 @@ void Z_ChangeTag(void *ptr, int tag)
|
||||
|
||||
void *Z_Realloc(void *ptr, size_t n, int tag, void **user)
|
||||
{
|
||||
void *p = (Z_Malloc)(n, tag, user DA(file, line));
|
||||
void *p = (Z_Malloc)(n, tag, user);
|
||||
if (ptr)
|
||||
{
|
||||
memblock_t *block = (memblock_t *)((uint8_t*) ptr - HEADER_SIZE);
|
||||
@ -305,7 +305,7 @@ void *Z_Realloc(void *ptr, size_t n, int tag, void **user)
|
||||
memset((char*)p+block->size, 0, n - block->size);
|
||||
}
|
||||
|
||||
(Z_Free)(ptr DA(file, line));
|
||||
(Z_Free)(ptr);
|
||||
if (user) // in case Z_Free nullified same user
|
||||
*user=p;
|
||||
}
|
||||
@ -315,13 +315,13 @@ void *Z_Realloc(void *ptr, size_t n, int tag, void **user)
|
||||
void *Z_Calloc(size_t n1, size_t n2, int tag, void **user)
|
||||
{
|
||||
if (n1 *= n2)
|
||||
return memset((Z_Malloc)(n1, tag, user DA(file, line)), 0, n1);
|
||||
return memset((Z_Malloc)(n1, tag, user), 0, n1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *Z_Strdup(const char *s, int tag, void **user)
|
||||
{
|
||||
return strcpy((Z_Malloc)(strlen(s)+1, tag, user DA(file, line)), s);
|
||||
return strcpy((Z_Malloc)(strlen(s)+1, tag, user), s);
|
||||
}
|
||||
|
||||
void Z_SetPurgeLimit(int size)
|
||||
|
18
src/z_zone.h
18
src/z_zone.h
@ -49,7 +49,6 @@
|
||||
#include "config.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
@ -61,18 +60,15 @@ enum {PU_FREE, PU_STATIC, PU_SOUND, PU_MUSIC, PU_LEVEL, PU_LEVSPEC, PU_CACHE,
|
||||
|
||||
#define PU_PURGELEVEL PU_CACHE /* First purgable tag's level */
|
||||
|
||||
#define DA(x,y)
|
||||
#define DAC(x,y)
|
||||
|
||||
void *(Z_Malloc)(size_t size, int tag, void **ptr DA(const char *, int));
|
||||
void (Z_Free)(void *ptr DA(const char *, int));
|
||||
void (Z_FreeTags)(int lowtag, int hightag DA(const char *, int));
|
||||
void (Z_ChangeTag)(void *ptr, int tag DA(const char *, int));
|
||||
void *(Z_Malloc)(size_t size, int tag, void **ptr);
|
||||
void (Z_Free)(void *ptr);
|
||||
void (Z_FreeTags)(int lowtag, int hightag);
|
||||
void (Z_ChangeTag)(void *ptr, int tag);
|
||||
bool (Z_Init)(void);
|
||||
void Z_Close(void);
|
||||
void *(Z_Calloc)(size_t n, size_t n2, int tag, void **user DA(const char *, int));
|
||||
void *(Z_Realloc)(void *p, size_t n, int tag, void **user DA(const char *, int));
|
||||
char *(Z_Strdup)(const char *s, int tag, void **user DA(const char *, int));
|
||||
void *(Z_Calloc)(size_t n, size_t n2, int tag, void **user);
|
||||
void *(Z_Realloc)(void *p, size_t n, int tag, void **user);
|
||||
char *(Z_Strdup)(const char *s, int tag, void **user);
|
||||
void Z_SetPurgeLimit(int size);
|
||||
|
||||
// Remove all definitions before including system definitions
|
||||
|
Loading…
x
Reference in New Issue
Block a user