diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-08-18 10:28:21 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-08-18 10:28:21 -0700 |
commit | c2e232e6915356eba3edf2efea99720746694c52 (patch) | |
tree | 405691284d85ae87a5261b43c950d26af102d17a /src/twm.c | |
parent | 58f3c3b8d518786764f45ac2be1f1f0850129125 (diff) |
Stop casting return values from malloc & calloc
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/twm.c')
-rw-r--r-- | src/twm.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -375,7 +375,7 @@ main(int argc, char *argv[]) InfoLines = 0; /* for simplicity, always allocate NumScreens ScreenInfo struct pointers */ - ScreenList = (ScreenInfo **) calloc (NumScreens, sizeof (ScreenInfo *)); + ScreenList = calloc (NumScreens, sizeof (ScreenInfo *)); if (ScreenList == NULL) { fprintf (stderr, "%s: Unable to allocate memory for screen list, exiting.\n", @@ -424,8 +424,7 @@ main(int argc, char *argv[]) numManaged ++; /* Note: ScreenInfo struct is calloc'ed to initialize to zero. */ - Scr = ScreenList[scrnum] = - (ScreenInfo *) calloc(1, sizeof(ScreenInfo)); + Scr = ScreenList[scrnum] = calloc(1, sizeof(ScreenInfo)); if (Scr == NULL) { fprintf (stderr, "%s: unable to allocate memory for ScreenInfo structure for screen %d.\n", @@ -473,8 +472,7 @@ main(int argc, char *argv[]) XSaveContext (dpy, Scr->Root, ScreenContext, (caddr_t) Scr); Scr->TwmRoot.cmaps.number_cwins = 1; - Scr->TwmRoot.cmaps.cwins = - (ColormapWindow **) malloc(sizeof(ColormapWindow *)); + Scr->TwmRoot.cmaps.cwins = malloc(sizeof(ColormapWindow *)); Scr->TwmRoot.cmaps.cwins[0] = CreateColormapWindow(Scr->Root, True, False); Scr->TwmRoot.cmaps.cwins[0]->visibility = VisibilityPartiallyObscured; |