Drop useless casts from g_malloc() & friends to pointer

These memory allocation functions return void *, and casting to
another pointer type is useless clutter.  Drop these casts.

If you really want another pointer type, consider g_new().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220923120025.448759-3-armbru@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Markus Armbruster 2022-09-23 14:00:24 +02:00 committed by Laurent Vivier
parent 4bb5923605
commit 0a553c12c7
10 changed files with 15 additions and 17 deletions

View file

@ -50,8 +50,8 @@ int vnc_hextile_send_framebuffer_update(VncState *vs, int x,
int has_fg, has_bg;
uint8_t *last_fg, *last_bg;
last_fg = (uint8_t *) g_malloc(VNC_SERVER_FB_BYTES);
last_bg = (uint8_t *) g_malloc(VNC_SERVER_FB_BYTES);
last_fg = g_malloc(VNC_SERVER_FB_BYTES);
last_bg = g_malloc(VNC_SERVER_FB_BYTES);
has_fg = has_bg = 0;
for (j = y; j < (y + h); j += 16) {
for (i = x; i < (x + w); i += 16) {