[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/88] ui/vnc: use g_new() family of functions
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 14/88] ui/vnc: use g_new() family of functions |
Date: |
Fri, 6 Oct 2017 20:49:09 -0300 |
From: Marc-André Lureau <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
[PMD: renamed 'Graphics' -> ui/vnc, added ui/vnc.c and ui/vnc-palette.c]
---
ui/vnc-enc-tight.c | 2 +-
ui/vnc-palette.c | 2 +-
ui/vnc.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index f38aceb4da..48ec584098 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -1475,7 +1475,7 @@ static int send_sub_rect(VncState *vs, int x, int y, int
w, int h)
#endif
if (!color_count_palette) {
- color_count_palette = g_malloc(sizeof(VncPalette));
+ color_count_palette = g_new(VncPalette, 1);
vnc_tight_cleanup_notifier.notify = vnc_tight_cleanup;
qemu_thread_atexit_add(&vnc_tight_cleanup_notifier);
}
diff --git a/ui/vnc-palette.c b/ui/vnc-palette.c
index dc7c0ba997..284e118715 100644
--- a/ui/vnc-palette.c
+++ b/ui/vnc-palette.c
@@ -56,7 +56,7 @@ VncPalette *palette_new(size_t max, int bpp)
{
VncPalette *palette;
- palette = g_malloc0(sizeof(*palette));
+ palette = g_new0(VncPalette, 1);
palette_init(palette, max, bpp);
return palette;
}
diff --git a/ui/vnc.c b/ui/vnc.c
index 9f8d5a1b1f..b021fb398b 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -231,7 +231,7 @@ static VncServerInfo *vnc_server_info_get(VncDisplay *vd)
return NULL;
}
- info = g_malloc0(sizeof(*info));
+ info = g_new0(VncServerInfo, 1);
vnc_init_basic_info_from_server_addr(vd->lsock[0],
qapi_VncServerInfo_base(info), &err);
info->has_auth = true;
@@ -316,7 +316,7 @@ static VncClientInfo *qmp_query_vnc_client(const VncState
*client)
VncClientInfo *info;
Error *err = NULL;
- info = g_malloc0(sizeof(*info));
+ info = g_new0(VncClientInfo, 1);
vnc_init_basic_info_from_remote_addr(client->sioc,
qapi_VncClientInfo_base(info),
@@ -3047,7 +3047,7 @@ void vnc_display_init(const char *id)
if (vnc_display_find(id) != NULL) {
return;
}
- vd = g_malloc0(sizeof(*vd));
+ vd = g_new0(VncDisplay, 1);
vd->id = strdup(id);
QTAILQ_INSERT_TAIL(&vnc_displays, vd, next);
--
2.14.2
- [Qemu-devel] [PATCH 05/88] cocci: use g_strfreev(), (continued)
- [Qemu-devel] [PATCH 05/88] cocci: use g_strfreev(), Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 06/88] ARM: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 07/88] Audio: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 08/88] BT: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 09/88] Bootdevice: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 10/88] Character devices: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 11/88] Cryptodev Backends: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 12/88] backends/hostmem: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 13/88] Dirty Bitmaps: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 14/88] ui/vnc: use g_new() family of functions,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 15/88] ui/spice: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 16/88] Main loop: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 17/88] Memory API: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 18/88] memory: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 19/88] exec: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 20/88] Migration: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 21/88] NBD: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 22/88] LM32: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06