removing casts of gfxAlloc() return value as that is the whole idea behind having a void pointer
This commit is contained in:
parent
bf8ceb278f
commit
6515373b2a
4
demos/3rdparty/doom/i_system.c
vendored
4
demos/3rdparty/doom/i_system.c
vendored
@ -66,7 +66,7 @@ int I_GetHeapSize (void)
|
||||
byte* I_ZoneBase (int* size)
|
||||
{
|
||||
*size = mb_used*1024*1024;
|
||||
return (byte *) gfxAlloc (*size);
|
||||
return gfxAlloc (*size);
|
||||
}
|
||||
|
||||
|
||||
@ -124,7 +124,7 @@ byte* I_Malloc(int length)
|
||||
{
|
||||
byte* mem;
|
||||
|
||||
mem = (byte *)gfxAlloc (length);
|
||||
mem = gfxAlloc (length);
|
||||
memset (mem,0,length);
|
||||
return mem;
|
||||
}
|
||||
|
@ -70,9 +70,9 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint
|
||||
return 0;
|
||||
gfxSemInit(&gs->bsem, 0, 1);
|
||||
gs->nextx = 0;
|
||||
if (!(gs->lastscopetrace = (coord_t *)gfxAlloc(gs->g.width * sizeof(coord_t))))
|
||||
if (!(gs->lastscopetrace = gfxAlloc(gs->g.width * sizeof(coord_t))))
|
||||
return 0;
|
||||
if (!(gs->audiobuf = (adcsample_t *)gfxAlloc(AUDIOBUFSZ * sizeof(adcsample_t))))
|
||||
if (!(gs->audiobuf = gfxAlloc(AUDIOBUFSZ * sizeof(adcsample_t))))
|
||||
return 0;
|
||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||
gs->lasty = gs->g.height/2;
|
||||
|
@ -139,7 +139,7 @@ void gaudin_lld_init(const gaudin_params *paud) {
|
||||
|
||||
/* We need to allocate a wave header for each buffer */
|
||||
nBuffers = (paud->bufcount + paud->samplesPerEvent - 1) / paud->samplesPerEvent;
|
||||
if (!(pWaveHdrs = (WAVEHDR *)gfxAlloc(nBuffers * sizeof(WAVEHDR)))) {
|
||||
if (!(pWaveHdrs = gfxAlloc(nBuffers * sizeof(WAVEHDR)))) {
|
||||
fprintf(stderr, "GAUDIN: Buffer header allocation failed\n");
|
||||
return;
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
// Create a private area for this window
|
||||
priv = (winPriv *)gfxAlloc(sizeof(winPriv));
|
||||
priv = gfxAlloc(sizeof(winPriv));
|
||||
assert(priv != 0);
|
||||
memset(priv, 0, sizeof(winPriv));
|
||||
g->priv = priv;
|
||||
|
@ -433,7 +433,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
||||
#endif
|
||||
|
||||
// Create a private area for this window
|
||||
if (!(priv = (netPriv *)gfxAlloc(sizeof(netPriv))))
|
||||
if (!(priv = gfxAlloc(sizeof(netPriv))))
|
||||
gfxHalt("GDISP: uGFXnet - Memory allocation failed");
|
||||
memset(priv, 0, sizeof(netPriv));
|
||||
g->priv = priv;
|
||||
|
@ -542,7 +542,7 @@ static void _gosThreadsInit(void) {
|
||||
char * framebase;
|
||||
|
||||
// Allocate a buffer to store our test data
|
||||
pframeinfo = (saveloc *)gfxAlloc(sizeof(saveloc)*2);
|
||||
pframeinfo = gfxAlloc(sizeof(saveloc)*2);
|
||||
|
||||
// Get details of the stack frame from within a function
|
||||
get_stack_state_in_fn();
|
||||
|
@ -285,7 +285,7 @@ GHandle gwinGConsoleCreate(GDisplay *g, GConsoleObject *gc, const GWindowInit *p
|
||||
gcw->bufsize *= gh->height / gdispGetFontMetric(gh->font, fontHeight);
|
||||
|
||||
// Allocate the buffer
|
||||
if (!(gcw->buffer = (char*)gfxAlloc(gcw->bufsize)))
|
||||
if (!(gcw->buffer = gfxAlloc(gcw->bufsize)))
|
||||
return FALSE;
|
||||
|
||||
// All good!
|
||||
|
@ -338,7 +338,7 @@ void gwinSetText(GHandle gh, const char *text, bool_t useAlloc) {
|
||||
else if (useAlloc) {
|
||||
char *str;
|
||||
|
||||
if ((str = (char *)gfxAlloc(strlen(text)+1))) {
|
||||
if ((str = gfxAlloc(strlen(text)+1))) {
|
||||
gh->flags |= GWIN_FLG_ALLOCTXT;
|
||||
strcpy(str, text);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ void _gwinInit(void) {
|
||||
GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint16_t flags) {
|
||||
// Allocate the structure if necessary
|
||||
if (!pgw) {
|
||||
if (!(pgw = (GWindowObject *)gfxAlloc(vmt->size)))
|
||||
if (!(pgw = gfxAlloc(vmt->size)))
|
||||
return 0;
|
||||
pgw->flags = flags|GWIN_FLG_DYNAMIC;
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user