blob: 6439e82118e5d8bc3fb6a1d8c20a1af29af69560 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
$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);
}
}
}
|