Mercurial > mplayer.hg
diff libao2/ao_coreaudio.c @ 30702:9fc9d1e788aa
Do not cast the results of malloc/calloc/realloc.
These functions return void*, which is compatible with any pointer,
so there is no need for casts.
author | diego |
---|---|
date | Fri, 26 Feb 2010 15:01:37 +0000 |
parents | 13b7aa964af6 |
children | b0da003fadf2 |
line wrap: on
line diff
--- a/libao2/ao_coreaudio.c Fri Feb 26 12:49:49 2010 +0000 +++ b/libao2/ao_coreaudio.c Fri Feb 26 15:01:37 2010 +0000 @@ -291,7 +291,7 @@ } /* Retrieve the name of the device. */ - psz_name = (char *)malloc(i_param_size); + psz_name = malloc(i_param_size); err = AudioDeviceGetProperty(devid_def, 0, 0, kAudioDevicePropertyDeviceName, &i_param_size, psz_name); @@ -513,7 +513,7 @@ } i_streams = i_param_size / sizeof(AudioStreamID); - p_streams = (AudioStreamID *)malloc(i_param_size); + p_streams = malloc(i_param_size); if (p_streams == NULL) { ao_msg(MSGT_AO, MSGL_WARN, "out of memory\n" ); @@ -549,7 +549,7 @@ } i_formats = i_param_size / sizeof(AudioStreamBasicDescription); - p_format_list = (AudioStreamBasicDescription *)malloc(i_param_size); + p_format_list = malloc(i_param_size); if (p_format_list == NULL) { ao_msg(MSGT_AO, MSGL_WARN, "could not malloc the memory\n" ); @@ -742,7 +742,7 @@ } i_streams = i_param_size / sizeof(AudioStreamID); - p_streams = (AudioStreamID *)malloc(i_param_size); + p_streams = malloc(i_param_size); if (p_streams == NULL) { ao_msg(MSGT_AO,MSGL_V, "out of memory\n"); @@ -791,7 +791,7 @@ } i_formats = i_param_size / sizeof(AudioStreamBasicDescription); - p_format_list = (AudioStreamBasicDescription *)malloc(i_param_size); + p_format_list = malloc(i_param_size); if (p_format_list == NULL) { ao_msg(MSGT_AO,MSGL_V, "could not malloc the memory\n" );