Andrew Talbot : cabinet: Remove order-of-evaluation dependencies.
Alexandre Julliard
julliard at winehq.org
Wed May 14 06:43:38 CDT 2008
Module: wine
Branch: master
Commit: 4046075462c00f4479f185d1c0514584ff851223
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4046075462c00f4479f185d1c0514584ff851223
Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date: Tue May 13 22:41:58 2008 +0100
cabinet: Remove order-of-evaluation dependencies.
---
dlls/cabinet/fdi.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c
index 8b7500f..3194d67 100644
--- a/dlls/cabinet/fdi.c
+++ b/dlls/cabinet/fdi.c
@@ -1034,7 +1034,8 @@ struct Ziphuft **t, cab_LONG *m, fdi_decomp_state *decomp_state)
w += l[h++]; /* add bits already decoded */
/* compute minimum size table less than or equal to *m bits */
- z = (z = g - w) > (cab_ULONG)*m ? *m : z; /* upper limit */
+ if ((z = g - w) > (cab_ULONG)*m) /* upper limit */
+ z = *m;
if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
{ /* too few codes for k-w bit table */
f -= a + 1; /* deduct codes from patterns left */
@@ -1177,7 +1178,9 @@ static cab_LONG fdi_Zipinflate_codes(const struct Ziphuft *tl, const struct Ziph
ZIPDUMPBITS(e)
do
{
- n -= (e = (e = ZIPWSIZE - ((d &= ZIPWSIZE-1) > w ? d : w)) > n ?n:e);
+ d = max(d & (ZIPWSIZE - 1), w);
+ e = min(ZIPWSIZE - d, n);
+ n -= e;
do
{
CAB(outbuf)[w++] = CAB(outbuf)[d++];
More information about the wine-cvs
mailing list