--- /dev/null
+// Remove redundant casts from memory allocation functions.
+@@
+type T;
+@@
+-(T *)
+ \(xmalloc\|xzalloc\|xrealloc\|xpalloc\|xnrealloc\)(...)
else if (menu->allocated == menu->count)
{
int count = menu->allocated = menu->allocated + 10;
- menu->text
- = (char **) xrealloc (menu->text, count * sizeof (char *));
- menu->submenu
- = (XMenu **) xrealloc (menu->submenu, count * sizeof (XMenu *));
- menu->panenumber
- = (int *) xrealloc (menu->panenumber, count * sizeof (int));
- menu->help_text
- = (const char **) xrealloc (menu->help_text, count * sizeof (char *));
+ menu->text = xrealloc (menu->text, count * sizeof (char *));
+ menu->submenu = xrealloc (menu->submenu, count * sizeof (XMenu *));
+ menu->panenumber = xrealloc (menu->panenumber, count * sizeof (int));
+ menu->help_text = xrealloc (menu->help_text, count * sizeof (char *));
}
}
i = max_fringe_bmp;
max_fringe_bmp = which + 20;
fringe_bmp
- = (cairo_pattern_t **) xrealloc (fringe_bmp,
- max_fringe_bmp *
- sizeof (cairo_pattern_t *));
+ = xrealloc (fringe_bmp, max_fringe_bmp * sizeof (cairo_pattern_t *));
while (i < max_fringe_bmp)
fringe_bmp[i++] = 0;
}
{
clipboard_storage_size = truelen + 100;
last_clipboard_text =
- (char *) xrealloc (last_clipboard_text, clipboard_storage_size);
+ xrealloc (last_clipboard_text, clipboard_storage_size);
}
if (last_clipboard_text)
dosmemget (xbuf_addr, truelen, last_clipboard_text);
{
int i = max_fringe_bmp;
max_fringe_bmp = which + 20;
- fringe_bmp = (HBITMAP *) xrealloc (fringe_bmp, max_fringe_bmp * sizeof (HBITMAP));
+ fringe_bmp = xrealloc (fringe_bmp, max_fringe_bmp * sizeof (HBITMAP));
while (i < max_fringe_bmp)
fringe_bmp[i++] = 0;
}
{
/* If that wasn't enough, keep trying with one more run. */
max_items++;
- items = (SCRIPT_ITEM *) xrealloc (items,
- sizeof (SCRIPT_ITEM) * max_items + 1);
+ items = xrealloc (items, sizeof (SCRIPT_ITEM) * max_items + 1);
}
if (FAILED (result))