@@ -196,7 +196,7 @@ void *audio_calloc (const char *funcname, int nmemb, size_t size)
196
196
return NULL ;
197
197
}
198
198
199
- return qemu_mallocz (len );
199
+ return g_malloc0 (len );
200
200
}
201
201
202
202
static char * audio_alloc_prefix (const char * s )
@@ -210,7 +210,7 @@ static char *audio_alloc_prefix (const char *s)
210
210
}
211
211
212
212
len = strlen (s );
213
- r = qemu_malloc (len + sizeof (qemu_prefix ));
213
+ r = g_malloc (len + sizeof (qemu_prefix ));
214
214
215
215
u = r + sizeof (qemu_prefix ) - 1 ;
216
216
@@ -425,7 +425,7 @@ static void audio_print_options (const char *prefix,
425
425
printf (" %s\n" , opt -> descr );
426
426
}
427
427
428
- qemu_free (uprefix );
428
+ g_free (uprefix );
429
429
}
430
430
431
431
static void audio_process_options (const char * prefix ,
@@ -462,7 +462,7 @@ static void audio_process_options (const char *prefix,
462
462
* (includes trailing zero) + zero + underscore (on behalf of
463
463
* sizeof) */
464
464
optlen = len + preflen + sizeof (qemu_prefix ) + 1 ;
465
- optname = qemu_malloc (optlen );
465
+ optname = g_malloc (optlen );
466
466
467
467
pstrcpy (optname , optlen , qemu_prefix );
468
468
@@ -507,7 +507,7 @@ static void audio_process_options (const char *prefix,
507
507
opt -> overriddenp = & opt -> overridden ;
508
508
}
509
509
* opt -> overriddenp = !def ;
510
- qemu_free (optname );
510
+ g_free (optname );
511
511
}
512
512
}
513
513
@@ -778,7 +778,7 @@ static void audio_detach_capture (HWVoiceOut *hw)
778
778
779
779
QLIST_REMOVE (sw , entries );
780
780
QLIST_REMOVE (sc , entries );
781
- qemu_free (sc );
781
+ g_free (sc );
782
782
if (was_active ) {
783
783
/* We have removed soft voice from the capture:
784
784
this might have changed the overall status of the capture
@@ -818,7 +818,7 @@ static int audio_attach_capture (HWVoiceOut *hw)
818
818
sw -> rate = st_rate_start (sw -> info .freq , hw_cap -> info .freq );
819
819
if (!sw -> rate ) {
820
820
dolog ("Could not start rate conversion for `%s'\n" , SW_NAME (sw ));
821
- qemu_free (sw );
821
+ g_free (sw );
822
822
return -1 ;
823
823
}
824
824
QLIST_INSERT_HEAD (& hw_cap -> sw_head , sw , entries );
@@ -1907,15 +1907,15 @@ static void audio_init (void)
1907
1907
void AUD_register_card (const char * name , QEMUSoundCard * card )
1908
1908
{
1909
1909
audio_init ();
1910
- card -> name = qemu_strdup (name );
1910
+ card -> name = g_strdup (name );
1911
1911
memset (& card -> entries , 0 , sizeof (card -> entries ));
1912
1912
QLIST_INSERT_HEAD (& glob_audio_state .card_head , card , entries );
1913
1913
}
1914
1914
1915
1915
void AUD_remove_card (QEMUSoundCard * card )
1916
1916
{
1917
1917
QLIST_REMOVE (card , entries );
1918
- qemu_free (card -> name );
1918
+ g_free (card -> name );
1919
1919
}
1920
1920
1921
1921
@@ -2000,11 +2000,11 @@ CaptureVoiceOut *AUD_add_capture (
2000
2000
return cap ;
2001
2001
2002
2002
err3 :
2003
- qemu_free (cap -> hw .mix_buf );
2003
+ g_free (cap -> hw .mix_buf );
2004
2004
err2 :
2005
- qemu_free (cap );
2005
+ g_free (cap );
2006
2006
err1 :
2007
- qemu_free (cb );
2007
+ g_free (cb );
2008
2008
err0 :
2009
2009
return NULL ;
2010
2010
}
@@ -2018,7 +2018,7 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque)
2018
2018
if (cb -> opaque == cb_opaque ) {
2019
2019
cb -> ops .destroy (cb_opaque );
2020
2020
QLIST_REMOVE (cb , entries );
2021
- qemu_free (cb );
2021
+ g_free (cb );
2022
2022
2023
2023
if (!cap -> cb_head .lh_first ) {
2024
2024
SWVoiceOut * sw = cap -> hw .sw_head .lh_first , * sw1 ;
@@ -2036,11 +2036,11 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque)
2036
2036
}
2037
2037
QLIST_REMOVE (sw , entries );
2038
2038
QLIST_REMOVE (sc , entries );
2039
- qemu_free (sc );
2039
+ g_free (sc );
2040
2040
sw = sw1 ;
2041
2041
}
2042
2042
QLIST_REMOVE (cap , entries );
2043
- qemu_free (cap );
2043
+ g_free (cap );
2044
2044
}
2045
2045
return ;
2046
2046
}
0 commit comments