Multiple *ptr++ constructs in one expression have undefined behaviour,

moved them out of the expression.
This commit is contained in:
Marcus Meissner 2001-06-14 19:22:55 +00:00 committed by Alexandre Julliard
parent dae8de69e2
commit 183eae9096
1 changed files with 5 additions and 4 deletions

View File

@ -559,10 +559,11 @@ INT WINAPI GetDIBits(
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++, srcbits += 3)
*dstbits++ = ((srcbits[0] >> 3) & bmask) |
(((WORD)srcbits[1] << 2) & gmask) |
(((WORD)srcbits[2] << 7) & rmask);
dstbits = (LPWORD)(dbits+=dstwidthb);
srcbits = (sbits += srcwidthb);
}