From d45397dbdd99cbe83f4e297c608aecbbd77c64c2 Mon Sep 17 00:00:00 2001 From: syrjala Date: Mon, 15 Sep 2008 11:47:02 +0000 Subject: Eliminate void * arithmetic. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27615 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_dfbmga.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'libvo/vo_dfbmga.c') diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index 3c22145517..ac968bb442 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -959,7 +959,8 @@ draw_alpha( int x0, int y0, unsigned char *srca, int stride ) { - void *dst; + uint8_t *dst; + void *ptr; int pitch; if (use_spic) { @@ -974,44 +975,45 @@ draw_alpha( int x0, int y0, osd_dirty |= osd_current; } - if (subframe->Lock( subframe, DSLF_READ | DSLF_WRITE, &dst, &pitch ) != DFB_OK) + if (subframe->Lock( subframe, DSLF_READ | DSLF_WRITE, &ptr, &pitch ) != DFB_OK) return; + dst = ptr; switch (subframe_format) { case DSPF_ALUT44: vo_draw_alpha_alut44( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + x0, + dst + pitch * y0 + x0, pitch ); break; case DSPF_RGB32: case DSPF_ARGB: vo_draw_alpha_rgb32( w, h, src, srca, stride, - (( uint8_t *) dst) + pitch * y0 + 4 * x0, + dst + pitch * y0 + 4 * x0, pitch ); break; case DSPF_RGB24: vo_draw_alpha_rgb24( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + 3 * x0, + dst + pitch * y0 + 3 * x0, pitch ); break; case DSPF_RGB16: vo_draw_alpha_rgb16( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + 2 * x0, + dst + pitch * y0 + 2 * x0, pitch ); break; case DSPF_ARGB1555: vo_draw_alpha_rgb15( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + 2 * x0, + dst + pitch * y0 + 2 * x0, pitch ); break; case DSPF_YUY2: vo_draw_alpha_yuy2( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + 2 * x0, + dst + pitch * y0 + 2 * x0, pitch ); break; case DSPF_UYVY: vo_draw_alpha_yuy2( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + 2 * x0 + 1, + dst + pitch * y0 + 2 * x0 + 1, pitch ); break; #if DIRECTFBVERSION > DFB_VERSION(0,9,21) @@ -1021,7 +1023,7 @@ draw_alpha( int x0, int y0, case DSPF_I420: case DSPF_YV12: vo_draw_alpha_yv12( w, h, src, srca, stride, - ((uint8_t *) dst) + pitch * y0 + x0, + dst + pitch * y0 + x0, pitch ); break; } @@ -1038,11 +1040,13 @@ draw_frame( uint8_t * src[] ) static int draw_slice( uint8_t * src[], int stride[], int w, int h, int x, int y ) { - void *dst; + uint8_t *dst; + void *ptr; int pitch; - if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK) + if (frame->Lock( frame, DSLF_WRITE, &ptr, &pitch ) != DFB_OK) return VO_FALSE; + dst = ptr; memcpy_pic( dst + pitch * y + x, src[0], w, h, pitch, stride[0] ); @@ -1214,7 +1218,8 @@ static uint32_t get_image( mp_image_t *mpi ) { int buf = current_buf; - void *dst; + uint8_t *dst; + void *ptr; int pitch; if (mpi->flags & MP_IMGFLAG_READABLE && @@ -1237,8 +1242,9 @@ get_image( mp_image_t *mpi ) /* Always use DSLF_READ to preserve system memory copy */ if (frame->Lock( frame, DSLF_WRITE | DSLF_READ, - &dst, &pitch ) != DFB_OK) + &ptr, &pitch ) != DFB_OK) return VO_FALSE; + dst = ptr; if ((mpi->width == pitch) || (mpi->flags & (MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_ACCEPT_WIDTH))) { -- cgit v1.2.3