aboutsummaryrefslogtreecommitdiff
path: root/input.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 /input.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 'input.c')
-rw-r--r--input.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/input.c b/input.c
index 310bad58fd..e2f7c92a71 100644
--- a/input.c
+++ b/input.c
@@ -73,12 +73,12 @@ QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
QEMUPutMouseEntry *s;
static int mouse_index = 0;
- s = qemu_mallocz(sizeof(QEMUPutMouseEntry));
+ s = g_malloc0(sizeof(QEMUPutMouseEntry));
s->qemu_put_mouse_event = func;
s->qemu_put_mouse_event_opaque = opaque;
s->qemu_put_mouse_event_absolute = absolute;
- s->qemu_put_mouse_event_name = qemu_strdup(name);
+ s->qemu_put_mouse_event_name = g_strdup(name);
s->index = mouse_index++;
QTAILQ_INSERT_TAIL(&mouse_handlers, s, node);
@@ -100,8 +100,8 @@ void qemu_remove_mouse_event_handler(QEMUPutMouseEntry *entry)
{
QTAILQ_REMOVE(&mouse_handlers, entry, node);
- qemu_free(entry->qemu_put_mouse_event_name);
- qemu_free(entry);
+ g_free(entry->qemu_put_mouse_event_name);
+ g_free(entry);
check_mode_change();
}
@@ -111,7 +111,7 @@ QEMUPutLEDEntry *qemu_add_led_event_handler(QEMUPutLEDEvent *func,
{
QEMUPutLEDEntry *s;
- s = qemu_mallocz(sizeof(QEMUPutLEDEntry));
+ s = g_malloc0(sizeof(QEMUPutLEDEntry));
s->put_led = func;
s->opaque = opaque;
@@ -124,7 +124,7 @@ void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry)
if (entry == NULL)
return;
QTAILQ_REMOVE(&led_handlers, entry, next);
- qemu_free(entry);
+ g_free(entry);
}
void kbd_put_keycode(int keycode)