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
9 changed files with 11 additions and 11 deletions
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)
|
byte* I_ZoneBase (int* size)
|
||||||
{
|
{
|
||||||
*size = mb_used*1024*1024;
|
*size = mb_used*1024*1024;
|
||||||
return (byte *) gfxAlloc (*size);
|
return gfxAlloc (*size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ byte* I_Malloc(int length)
|
||||||
{
|
{
|
||||||
byte* mem;
|
byte* mem;
|
||||||
|
|
||||||
mem = (byte *)gfxAlloc (length);
|
mem = gfxAlloc (length);
|
||||||
memset (mem,0,length);
|
memset (mem,0,length);
|
||||||
return mem;
|
return mem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,9 +70,9 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint
|
||||||
return 0;
|
return 0;
|
||||||
gfxSemInit(&gs->bsem, 0, 1);
|
gfxSemInit(&gs->bsem, 0, 1);
|
||||||
gs->nextx = 0;
|
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;
|
return 0;
|
||||||
if (!(gs->audiobuf = (adcsample_t *)gfxAlloc(AUDIOBUFSZ * sizeof(adcsample_t))))
|
if (!(gs->audiobuf = gfxAlloc(AUDIOBUFSZ * sizeof(adcsample_t))))
|
||||||
return 0;
|
return 0;
|
||||||
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
#if TRIGGER_METHOD == TRIGGER_POSITIVERAMP
|
||||||
gs->lasty = gs->g.height/2;
|
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 */
|
/* We need to allocate a wave header for each buffer */
|
||||||
nBuffers = (paud->bufcount + paud->samplesPerEvent - 1) / paud->samplesPerEvent;
|
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");
|
fprintf(stderr, "GAUDIN: Buffer header allocation failed\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,7 +458,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Create a private area for this window
|
// Create a private area for this window
|
||||||
priv = (winPriv *)gfxAlloc(sizeof(winPriv));
|
priv = gfxAlloc(sizeof(winPriv));
|
||||||
assert(priv != 0);
|
assert(priv != 0);
|
||||||
memset(priv, 0, sizeof(winPriv));
|
memset(priv, 0, sizeof(winPriv));
|
||||||
g->priv = priv;
|
g->priv = priv;
|
||||||
|
|
|
@ -433,7 +433,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Create a private area for this window
|
// Create a private area for this window
|
||||||
if (!(priv = (netPriv *)gfxAlloc(sizeof(netPriv))))
|
if (!(priv = gfxAlloc(sizeof(netPriv))))
|
||||||
gfxHalt("GDISP: uGFXnet - Memory allocation failed");
|
gfxHalt("GDISP: uGFXnet - Memory allocation failed");
|
||||||
memset(priv, 0, sizeof(netPriv));
|
memset(priv, 0, sizeof(netPriv));
|
||||||
g->priv = priv;
|
g->priv = priv;
|
||||||
|
|
|
@ -542,7 +542,7 @@ static void _gosThreadsInit(void) {
|
||||||
char * framebase;
|
char * framebase;
|
||||||
|
|
||||||
// Allocate a buffer to store our test data
|
// 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 details of the stack frame from within a function
|
||||||
get_stack_state_in_fn();
|
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);
|
gcw->bufsize *= gh->height / gdispGetFontMetric(gh->font, fontHeight);
|
||||||
|
|
||||||
// Allocate the buffer
|
// Allocate the buffer
|
||||||
if (!(gcw->buffer = (char*)gfxAlloc(gcw->bufsize)))
|
if (!(gcw->buffer = gfxAlloc(gcw->bufsize)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// All good!
|
// All good!
|
||||||
|
|
|
@ -338,7 +338,7 @@ void gwinSetText(GHandle gh, const char *text, bool_t useAlloc) {
|
||||||
else if (useAlloc) {
|
else if (useAlloc) {
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
if ((str = (char *)gfxAlloc(strlen(text)+1))) {
|
if ((str = gfxAlloc(strlen(text)+1))) {
|
||||||
gh->flags |= GWIN_FLG_ALLOCTXT;
|
gh->flags |= GWIN_FLG_ALLOCTXT;
|
||||||
strcpy(str, text);
|
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) {
|
GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint16_t flags) {
|
||||||
// Allocate the structure if necessary
|
// Allocate the structure if necessary
|
||||||
if (!pgw) {
|
if (!pgw) {
|
||||||
if (!(pgw = (GWindowObject *)gfxAlloc(vmt->size)))
|
if (!(pgw = gfxAlloc(vmt->size)))
|
||||||
return 0;
|
return 0;
|
||||||
pgw->flags = flags|GWIN_FLG_DYNAMIC;
|
pgw->flags = flags|GWIN_FLG_DYNAMIC;
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Add table
Reference in a new issue