Simplify a condition in dlls/msi/table.c
Gerald Pfeifer
gerald at pfeifer.com
Tue Jan 1 05:21:52 CST 2008
A few lines above we have "UINT ival = 0" which means the check for
"ival < 0" is a noop for two reasons: the variable is initialized to
0 and, more importantly, the variable cannot be negative.
This is one of the last four or so patches that will allow us to enable
-Wtype-limits as we had discussed in November. :-)
Gerald
ChangeLog:
Simplify condition in TABLE_fetch_stream().
Index: table.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/table.c,v
retrieving revision 1.135
diff -u -3 -p -r1.135 table.c
--- table.c 27 Dec 2007 14:32:30 -0000 1.135
+++ table.c 1 Jan 2008 11:18:03 -0000
@@ -1206,7 +1206,7 @@ static UINT TABLE_fetch_stream( struct t
return r;
/* check the column value is in range */
- if (ival < 0 || ival > tv->num_cols || ival == col)
+ if (ival > tv->num_cols || ival == col)
{
ERR("bad column ref (%u) for stream\n", ival);
return ERROR_FUNCTION_FAILED;
More information about the wine-patches
mailing list