openbsd-ports/graphics/fxtv/patches/patch-videolib_videolib_c
2010-05-22 14:12:50 +00:00

45 lines
1.8 KiB
Plaintext

$OpenBSD: patch-videolib_videolib_c,v 1.1 2010/05/22 14:12:50 espie Exp $
--- videolib/videolib.c.orig Sat May 22 16:06:23 2010
+++ videolib/videolib.c Sat May 22 16:09:09 2010
@@ -479,9 +479,11 @@ static void VIDEOLIBConvertRGBToRGB( VL_IMAGE *src, VL
*(p++) = (*src16 >> 8) | (*src16 << 8);
src16++;
}
- for ( i = dst_line_pad; i > 0; i-- )
- *(((VL_UINT8 *)p)++) = 0x00;
- (VL_UINT8 *)dst_line += dst->geom.bytes_per_line;
+ for ( i = dst_line_pad; i > 0; i-- ) {
+ *((VL_UINT8 *)p) = 0x00;
+ p = (VL_UINT8 *)p + 1;
+ }
+ dst_line = (VL_UINT8 *)dst_line + dst->geom.bytes_per_line;
}
src16 = dst_line = (VL_UINT16 *) dst->buf;
@@ -513,9 +515,11 @@ static void VIDEOLIBConvertRGBToRGB( VL_IMAGE *src, VL
if ( src_padded )
src16 = (VL_UINT16 *)( (VL_UINT8 *)src16 + dst_line_pad );
else
- for ( i = dst_line_pad; i > 0; i-- )
- *(((VL_UINT8 *)dst)++) = 0x00;
- (VL_UINT8 *)dst_line += dst->geom.bytes_per_line;
+ for ( i = dst_line_pad; i > 0; i-- ) {
+ *((VL_UINT8 *)dst) = 0x00;
+ dst = (VL_UINT8 *)dst + 1;
+ }
+ dst_line = (VL_UINT8 *)dst_line + dst->geom.bytes_per_line;
}
if ( !dst_swap_b ) { /* More ugliness */
@@ -527,8 +531,8 @@ static void VIDEOLIBConvertRGBToRGB( VL_IMAGE *src, VL
*(p++) = (*src16 >> 8) | (*src16 << 8);
src16++;
}
- (VL_UINT8 *)dst_line += dst->geom.bytes_per_line;
- (VL_UINT8 *)src16 += dst->geom.bytes_per_line;
+ dst_line = (VL_UINT8 *)dst_line + dst->geom.bytes_per_line;
+ src16 = (VL_UINT8 *)src16 + dst->geom.bytes_per_line;
}
}
}