diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-03-23 23:00:04 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-03-23 23:00:04 +0100 |
commit | 57323fa71effad75d78b36a45d5457b1bd782963 (patch) | |
tree | 50d7a5bacacebcdf59d5bf38dff84c83bf557d31 /src/gui/curses | |
parent | 14feea7ab84df3e367bc3732e8ba1470e1a3f5a7 (diff) | |
download | weechat-57323fa71effad75d78b36a45d5457b1bd782963.zip |
Removed sizeof(char) and useless type casts from void* to another pointer type (patch from Leonid Evdokimov)
Diffstat (limited to 'src/gui/curses')
-rw-r--r-- | src/gui/curses/gui-curses-bar.c | 2 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-color.c | 8 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-window.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/curses/gui-curses-bar.c b/src/gui/curses/gui-curses-bar.c index bf167b092..eddfb3704 100644 --- a/src/gui/curses/gui-curses-bar.c +++ b/src/gui/curses/gui-curses-bar.c @@ -158,7 +158,7 @@ gui_bar_window_new (struct t_gui_bar *bar, struct t_gui_window *window) if (!gui_init_ok) return 0; - new_bar_window = (struct t_gui_bar_window *) malloc (sizeof (struct t_gui_bar_window)); + new_bar_window = malloc (sizeof (*new_bar_window)); if (new_bar_window) { new_bar_window->bar = bar; diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index 1adb758ee..6d0fa729f 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -159,7 +159,7 @@ gui_color_assign (t_gui_color **color, char *fg_and_bg) if (!(*color)) { - *color = (t_gui_color *)malloc (sizeof (t_gui_color)); + *color = malloc (sizeof (**color)); if (!(*color)) return; *color->foreground = 0; @@ -228,7 +228,7 @@ gui_color_assign (t_gui_color **color, char *fg_and_bg) if (*color->string) free (*color->string); - *color->string = (char *)malloc (4 * sizeof (char)); + *color->string = malloc (4); if (*color->string) snprintf (*color->string, 4, "%s%02d", @@ -271,14 +271,14 @@ gui_color_build (int number, int foreground, int background) { struct t_gui_color *new_color; - new_color = (struct t_gui_color *)malloc (sizeof (struct t_gui_color)); + new_color = malloc (sizeof (*new_color)); if (!new_color) return NULL; new_color->foreground = gui_weechat_colors[foreground].foreground; new_color->background = gui_weechat_colors[background].foreground; new_color->attributes = gui_weechat_colors[foreground].attributes; - new_color->string = (char *)malloc (4 * sizeof (char)); + new_color->string = malloc (4); if (new_color->string) snprintf (new_color->string, 4, "%s%02d", diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index 550d2a909..f760ba769 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -75,7 +75,7 @@ gui_window_objects_init (struct t_gui_window *window) { struct t_gui_curses_objects *new_objects; - if ((new_objects = (struct t_gui_curses_objects *)malloc (sizeof (struct t_gui_curses_objects)))) + if ((new_objects = malloc (sizeof (*new_objects)))) { window->gui_objects = new_objects; GUI_CURSES(window)->win_title = NULL; |