summaryrefslogtreecommitdiff
path: root/ui/sdl.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-20 22:09:37 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-20 23:01:08 -0500
commit7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch)
tree9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /ui/sdl.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'ui/sdl.c')
-rw-r--r--ui/sdl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ui/sdl.c b/ui/sdl.c
index 30cde8662e..385cc91279 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -166,7 +166,7 @@ static PixelFormat sdl_to_qemu_pixelformat(SDL_PixelFormat *sdl_pf)
static DisplaySurface* sdl_create_displaysurface(int width, int height)
{
- DisplaySurface *surface = (DisplaySurface*) qemu_mallocz(sizeof(DisplaySurface));
+ DisplaySurface *surface = (DisplaySurface*) g_malloc0(sizeof(DisplaySurface));
if (surface == NULL) {
fprintf(stderr, "sdl_create_displaysurface: malloc failed\n");
exit(1);
@@ -215,8 +215,8 @@ static void sdl_free_displaysurface(DisplaySurface *surface)
return;
if (surface->flags & QEMU_ALLOCATED_FLAG)
- qemu_free(surface->data);
- qemu_free(surface);
+ g_free(surface->data);
+ g_free(surface);
}
static DisplaySurface* sdl_resize_displaysurface(DisplaySurface *surface, int width, int height)
@@ -928,14 +928,14 @@ static void sdl_mouse_define(QEMUCursor *c)
SDL_FreeCursor(guest_sprite);
bpl = cursor_get_mono_bpl(c);
- image = qemu_mallocz(bpl * c->height);
- mask = qemu_mallocz(bpl * c->height);
+ image = g_malloc0(bpl * c->height);
+ mask = g_malloc0(bpl * c->height);
cursor_get_mono_image(c, 0x000000, image);
cursor_get_mono_mask(c, 0, mask);
guest_sprite = SDL_CreateCursor(image, mask, c->width, c->height,
c->hot_x, c->hot_y);
- qemu_free(image);
- qemu_free(mask);
+ g_free(image);
+ g_free(mask);
if (guest_cursor &&
(gui_grab || kbd_mouse_is_absolute() || absolute_enabled))
@@ -1009,7 +1009,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
SDL_SetColorKey(image, SDL_SRCCOLORKEY, colorkey);
SDL_WM_SetIcon(image, NULL);
}
- qemu_free(filename);
+ g_free(filename);
}
if (full_screen) {
@@ -1017,7 +1017,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
sdl_grab_start();
}
- dcl = qemu_mallocz(sizeof(DisplayChangeListener));
+ dcl = g_malloc0(sizeof(DisplayChangeListener));
dcl->dpy_update = sdl_update;
dcl->dpy_resize = sdl_resize;
dcl->dpy_refresh = sdl_refresh;
@@ -1027,7 +1027,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
ds->cursor_define = sdl_mouse_define;
register_displaychangelistener(ds, dcl);
- da = qemu_mallocz(sizeof(DisplayAllocator));
+ da = g_malloc0(sizeof(DisplayAllocator));
da->create_displaysurface = sdl_create_displaysurface;
da->resize_displaysurface = sdl_resize_displaysurface;
da->free_displaysurface = sdl_free_displaysurface;