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/menus.c | |
parent | 58f3c3b8d518786764f45ac2be1f1f0850129125 (diff) |
Stop casting return values from malloc & calloc
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/menus.c')
-rw-r--r-- | src/menus.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/menus.c b/src/menus.c index 4acfe85..e311454 100644 --- a/src/menus.c +++ b/src/menus.c @@ -204,7 +204,7 @@ Bool AddFuncKey (char *name, int cont, int mods, int func, char *win_name, if (tmp == NULL) { - tmp = (FuncKey *) malloc(sizeof(FuncKey)); + tmp = malloc(sizeof(FuncKey)); tmp->next = Scr->FuncKeyRoot.next; Scr->FuncKeyRoot.next = tmp; } @@ -226,7 +226,7 @@ Bool AddFuncKey (char *name, int cont, int mods, int func, char *win_name, int CreateTitleButton (const char *name, int func, const char *action, MenuRoot *menuroot, Bool rightside, Bool append) { - TitleButton *tb = (TitleButton *) malloc (sizeof(TitleButton)); + TitleButton *tb = malloc (sizeof(TitleButton)); if (!tb) { fprintf (stderr, @@ -633,7 +633,7 @@ NewMenuRoot(const char *name) #define UNUSED_PIXEL ((unsigned long) (~0)) /* more than 24 bits */ - tmp = (MenuRoot *) malloc(sizeof(MenuRoot)); + tmp = malloc(sizeof(MenuRoot)); tmp->hi_fore = UNUSED_PIXEL; tmp->hi_back = UNUSED_PIXEL; tmp->name = name; @@ -697,7 +697,7 @@ AddToMenu(MenuRoot *menu, const char *item, const char *action, item, action, sub, func); #endif - tmp = (MenuItem *) malloc(sizeof(MenuItem)); + tmp = malloc(sizeof(MenuItem)); tmp->root = menu; if (menu->first == NULL) @@ -999,8 +999,7 @@ PopUpMenu (MenuRoot *menu, int x, int y, Bool center) WindowNameCount++; if (WindowNameCount != 0) { - WindowNames = - (TwmWindow **)malloc(sizeof(TwmWindow *)*WindowNameCount); + WindowNames = malloc(sizeof(TwmWindow *) * WindowNameCount); WindowNames[0] = Scr->TwmRoot.next; for(tmp_win = Scr->TwmRoot.next->next , WindowNameCount=1; tmp_win != NULL; @@ -2758,8 +2757,7 @@ BumpWindowColormap (TwmWindow *tmp, int inc) if (!tmp) return; if (inc && tmp->cmaps.number_cwins > 0) { - cwins = (ColormapWindow **) malloc(sizeof(ColormapWindow *)* - tmp->cmaps.number_cwins); + cwins = malloc(sizeof(ColormapWindow *) * tmp->cmaps.number_cwins); if (cwins) { if ((previously_installed = /* SUPPRESS 560 */(Scr->cmapInfo.cmaps == &tmp->cmaps && |