# HG changeset patch # User syrjala # Date 1221479222 0 # Node ID 7012606cf0028b4525f070bef6d5c25c57921f0a # Parent 34d3e0c8487a21f92e9ca83565062b5fefe93018 Eliminate void * arithmetic. diff -r 34d3e0c8487a -r 7012606cf002 libvo/vo_dfbmga.c --- a/libvo/vo_dfbmga.c Mon Sep 15 05:40:29 2008 +0000 +++ b/libvo/vo_dfbmga.c Mon Sep 15 11:47:02 2008 +0000 @@ -959,7 +959,8 @@ unsigned char *srca, int stride ) { - void *dst; + uint8_t *dst; + void *ptr; int pitch; if (use_spic) { @@ -974,44 +975,45 @@ 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 @@ 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 @@ 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 @@ 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 @@ /* 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))) {