PATCH: invalid c expression

Marcus Meissner marcus at jet.franken.de
Wed Jun 13 15:13:42 CDT 2001


Hi,

gcc 3 complains about using multiple *ptr++ constructs as being invalid.

This moves them out of the expression.

Ciao, Marcus

Changelog:
	multiple *ptr++ constructs in one expression have undefined behaviour,
	moved them out of the expression.

Index: dib.c
===================================================================
RCS file: /home/wine/wine/objects/dib.c,v
retrieving revision 1.52
diff -u -r1.52 dib.c
--- dib.c	2001/04/20 18:36:06	1.52
+++ dib.c	2001/06/13 21:09:21
@@ -559,10 +559,17 @@
                             LPBYTE srcbits = sbits;
 
                             for( y = 0; y < lines; y++) {
-                                for( x = 0; x < srcwidth; x++ )
-                                    *dstbits++ = ((*srcbits++ >> 3) & bmask) |
-                                                 (((WORD)*srcbits++ << 2) & gmask) |
-                                                 (((WORD)*srcbits++ << 7) & rmask);
+                                for( x = 0; x < srcwidth; x++ ) {
+				    BYTE a,b,c;
+
+				    a = *srcbits++;
+				    b = *srcbits++;
+				    c = *srcbits++;
+
+                                    *dstbits++ = ((a >> 3) & bmask) |
+                                                 (((WORD)b << 2) & gmask) |
+                                                 (((WORD)c << 7) & rmask);
+				}
                                 dstbits = (LPWORD)(dbits+=dstwidthb);
                                 srcbits = (sbits += srcwidthb);
                             }




More information about the wine-patches mailing list