6ed83acafe
This may or may not fully run on LP64 platforms but it's much more likely to now than previously.
45 lines
1.7 KiB
Text
45 lines
1.7 KiB
Text
$NetBSD: patch-ap,v 1.2 2011/07/05 03:27:22 dholland Exp $
|
|
|
|
Fix illegal C.
|
|
|
|
--- videolib/videolib.c.orig 1999-11-03 02:22:04.000000000 +0000
|
|
+++ videolib/videolib.c 2006-06-30 19:10:23.000000000 +0100
|
|
@@ -479,9 +479,9 @@
|
|
*(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;
|
|
+ (void)memset(p, 0, dst_line_pad);
|
|
+ dst_line = (VL_UINT16 *)((VL_UINT8 *)dst_line +
|
|
+ dst->geom.bytes_per_line);
|
|
}
|
|
|
|
src16 = dst_line = (VL_UINT16 *) dst->buf;
|
|
@@ -513,9 +513,9 @@
|
|
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;
|
|
+ (void)memset(p, 0, dst_line_pad);
|
|
+ dst_line = (VL_UINT16 *)((VL_UINT8 *)dst_line +
|
|
+ dst->geom.bytes_per_line);
|
|
}
|
|
|
|
if ( !dst_swap_b ) { /* More ugliness */
|
|
@@ -527,8 +527,10 @@
|
|
*(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_UINT16 *)((VL_UINT8 *)dst_line +
|
|
+ dst->geom.bytes_per_line);
|
|
+ src16 = (VL_UINT16 *)((VL_UINT8 *)src16 +
|
|
+ dst->geom.bytes_per_line);
|
|
}
|
|
}
|
|
}
|