From 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Sat, 20 Aug 2011 22:09:37 -0500 Subject: Use glib memory allocation and free functions qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori --- audio/audio.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'audio/audio.c') diff --git a/audio/audio.c b/audio/audio.c index 50d2b64..5649075 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -196,7 +196,7 @@ void *audio_calloc (const char *funcname, int nmemb, size_t size) return NULL; } - return qemu_mallocz (len); + return g_malloc0 (len); } static char *audio_alloc_prefix (const char *s) @@ -210,7 +210,7 @@ static char *audio_alloc_prefix (const char *s) } len = strlen (s); - r = qemu_malloc (len + sizeof (qemu_prefix)); + r = g_malloc (len + sizeof (qemu_prefix)); u = r + sizeof (qemu_prefix) - 1; @@ -425,7 +425,7 @@ static void audio_print_options (const char *prefix, printf (" %s\n", opt->descr); } - qemu_free (uprefix); + g_free (uprefix); } static void audio_process_options (const char *prefix, @@ -462,7 +462,7 @@ static void audio_process_options (const char *prefix, * (includes trailing zero) + zero + underscore (on behalf of * sizeof) */ optlen = len + preflen + sizeof (qemu_prefix) + 1; - optname = qemu_malloc (optlen); + optname = g_malloc (optlen); pstrcpy (optname, optlen, qemu_prefix); @@ -507,7 +507,7 @@ static void audio_process_options (const char *prefix, opt->overriddenp = &opt->overridden; } *opt->overriddenp = !def; - qemu_free (optname); + g_free (optname); } } @@ -778,7 +778,7 @@ static void audio_detach_capture (HWVoiceOut *hw) QLIST_REMOVE (sw, entries); QLIST_REMOVE (sc, entries); - qemu_free (sc); + g_free (sc); if (was_active) { /* We have removed soft voice from the capture: this might have changed the overall status of the capture @@ -818,7 +818,7 @@ static int audio_attach_capture (HWVoiceOut *hw) sw->rate = st_rate_start (sw->info.freq, hw_cap->info.freq); if (!sw->rate) { dolog ("Could not start rate conversion for `%s'\n", SW_NAME (sw)); - qemu_free (sw); + g_free (sw); return -1; } QLIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries); @@ -1907,7 +1907,7 @@ static void audio_init (void) void AUD_register_card (const char *name, QEMUSoundCard *card) { audio_init (); - card->name = qemu_strdup (name); + card->name = g_strdup (name); memset (&card->entries, 0, sizeof (card->entries)); QLIST_INSERT_HEAD (&glob_audio_state.card_head, card, entries); } @@ -1915,7 +1915,7 @@ void AUD_register_card (const char *name, QEMUSoundCard *card) void AUD_remove_card (QEMUSoundCard *card) { QLIST_REMOVE (card, entries); - qemu_free (card->name); + g_free (card->name); } @@ -2000,11 +2000,11 @@ CaptureVoiceOut *AUD_add_capture ( return cap; err3: - qemu_free (cap->hw.mix_buf); + g_free (cap->hw.mix_buf); err2: - qemu_free (cap); + g_free (cap); err1: - qemu_free (cb); + g_free (cb); err0: return NULL; } @@ -2018,7 +2018,7 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque) if (cb->opaque == cb_opaque) { cb->ops.destroy (cb_opaque); QLIST_REMOVE (cb, entries); - qemu_free (cb); + g_free (cb); if (!cap->cb_head.lh_first) { SWVoiceOut *sw = cap->hw.sw_head.lh_first, *sw1; @@ -2036,11 +2036,11 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque) } QLIST_REMOVE (sw, entries); QLIST_REMOVE (sc, entries); - qemu_free (sc); + g_free (sc); sw = sw1; } QLIST_REMOVE (cap, entries); - qemu_free (cap); + g_free (cap); } return; } -- cgit v1.1