From 6515373b2a63a24b77ff20a26e9b18468f29a6f9 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Sun, 2 Feb 2014 12:59:36 +0100 Subject: removing casts of gfxAlloc() return value as that is the whole idea behind having a void pointer --- src/gos/raw32.c | 2 +- src/gwin/console.c | 2 +- src/gwin/gwidget.c | 2 +- src/gwin/gwin.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gos/raw32.c b/src/gos/raw32.c index 5a65ea86..5e11064c 100644 --- a/src/gos/raw32.c +++ b/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(); diff --git a/src/gwin/console.c b/src/gwin/console.c index ef374220..623404be 100644 --- a/src/gwin/console.c +++ b/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! diff --git a/src/gwin/gwidget.c b/src/gwin/gwidget.c index db9dc9fa..484b8c37 100644 --- a/src/gwin/gwidget.c +++ b/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); } diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 6b9cb81e..11dcdaf1 100644 --- a/src/gwin/gwin.c +++ b/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 -- cgit v1.2.3