Browse Source

removing casts of gfxAlloc() return value as that is the whole idea behind having a void pointer

remotes/origin_old/ugfx_release_2.6
Joel Bodenmann 9 years ago
parent
commit
6515373b2a
  1. 4
      demos/3rdparty/doom/i_system.c
  2. 4
      demos/modules/gadc/gwinosc.c
  3. 2
      drivers/gaudin/Win32/gaudin_lld.c
  4. 2
      drivers/multiple/Win32/gdisp_lld_Win32.c
  5. 2
      drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c
  6. 2
      src/gos/raw32.c
  7. 2
      src/gwin/console.c
  8. 2
      src/gwin/gwidget.c
  9. 2
      src/gwin/gwin.c

4
demos/3rdparty/doom/i_system.c

@ -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;
}

4
demos/modules/gadc/gwinosc.c

@ -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;

2
drivers/gaudin/Win32/gaudin_lld.c

@ -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;
}

2
drivers/multiple/Win32/gdisp_lld_Win32.c

@ -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;

2
drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c

@ -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;

2
src/gos/raw32.c

@ -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();

2
src/gwin/console.c

@ -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!

2
src/gwin/gwidget.c

@ -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);
}

2
src/gwin/gwin.c

@ -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…
Cancel
Save