1
mirror of https://github.com/mpv-player/mpv synced 2025-01-13 00:06:25 +01:00

cleanup: remove some casts of memalign() return value

Do not pointlessly cast the return value of memalign().
memalign() returns void*, which is compatible with any pointer in C.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32850 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2011-02-04 10:06:01 +00:00 committed by Uoti Urpala
parent 8aac9fae9b
commit 30f9c5cd2b
2 changed files with 6 additions and 6 deletions

View File

@ -129,7 +129,7 @@ switch(video_codec){
}
mp_msg(MSGT_DECVIDEO,MSGL_V,"OK!\n");
if(!videobuffer) {
videobuffer=(char*)memalign(8,VIDEOBUFFER_SIZE + MP_INPUT_BUFFER_PADDING_SIZE);
videobuffer = memalign(8, VIDEOBUFFER_SIZE + MP_INPUT_BUFFER_PADDING_SIZE);
if (videobuffer) memset(videobuffer+VIDEOBUFFER_SIZE, 0, MP_INPUT_BUFFER_PADDING_SIZE);
else {
mp_tmsg(MSGT_DECVIDEO,MSGL_ERR,"Cannot allocate shared memory.\n");
@ -224,7 +224,7 @@ switch(video_codec){
}
mp_msg(MSGT_DECVIDEO,MSGL_V,"OK!\n");
if(!videobuffer) {
videobuffer=(char*)memalign(8,VIDEOBUFFER_SIZE + MP_INPUT_BUFFER_PADDING_SIZE);
videobuffer = memalign(8, VIDEOBUFFER_SIZE + MP_INPUT_BUFFER_PADDING_SIZE);
if (videobuffer) memset(videobuffer+VIDEOBUFFER_SIZE, 0, MP_INPUT_BUFFER_PADDING_SIZE);
else {
mp_tmsg(MSGT_DECVIDEO,MSGL_ERR,"Cannot allocate shared memory.\n");
@ -289,7 +289,7 @@ mpeg_header_parser:
mp_msg(MSGT_DECVIDEO,MSGL_V,"OK!\n");
// ========= Read & process sequence header & extension ============
if(!videobuffer) {
videobuffer=(char*)memalign(8,VIDEOBUFFER_SIZE + MP_INPUT_BUFFER_PADDING_SIZE);
videobuffer = memalign(8, VIDEOBUFFER_SIZE + MP_INPUT_BUFFER_PADDING_SIZE);
if (videobuffer) memset(videobuffer+VIDEOBUFFER_SIZE, 0, MP_INPUT_BUFFER_PADDING_SIZE);
else {
mp_tmsg(MSGT_DECVIDEO,MSGL_ERR,"Cannot allocate shared memory.\n");
@ -357,7 +357,7 @@ mpeg_header_parser:
}
mp_msg(MSGT_DECVIDEO,MSGL_INFO,"found\n");
if(!videobuffer) {
videobuffer=(char*)memalign(8,VIDEOBUFFER_SIZE + MP_INPUT_BUFFER_PADDING_SIZE);
videobuffer = memalign(8, VIDEOBUFFER_SIZE + MP_INPUT_BUFFER_PADDING_SIZE);
if (videobuffer) memset(videobuffer+VIDEOBUFFER_SIZE, 0, MP_INPUT_BUFFER_PADDING_SIZE);
else {
mp_tmsg(MSGT_DECVIDEO,MSGL_ERR,"Cannot allocate shared memory.\n");

View File

@ -155,8 +155,8 @@ static void alloc_buf(mp_osd_obj_t* obj)
obj->allocated = len;
free(obj->bitmap_buffer);
free(obj->alpha_buffer);
obj->bitmap_buffer = (unsigned char *)memalign(16, len);
obj->alpha_buffer = (unsigned char *)memalign(16, len);
obj->bitmap_buffer = memalign(16, len);
obj->alpha_buffer = memalign(16, len);
}
memset(obj->bitmap_buffer, sub_bg_color, len);
memset(obj->alpha_buffer, sub_bg_alpha, len);