dlls/oleaut32/typelib2.c -- simplify (RESEND)

Gerald Pfeifer gerald at pfeifer.com
Wed Nov 21 18:06:32 CST 2007


This relates to your discussion on -Wtype-limits.

Gerald

---------- Forwarded message ----------
From: Gerald Pfeifer <gerald at pfeifer.com>
To:  <wine-patches at winehq.org>
Date: Sat, 3 Nov 2007 15:23:21 +0100 (CET)
Subject: dlls/oleaut32/typelib2.c -- simplify

ChangeLog:
Simplify two conditions based on the fact that unsigned variables 
cannot be negative.

Index: dlls/oleaut32/typelib2.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib2.c,v
retrieving revision 1.46
diff -u -3 -p -r1.46 typelib2.c
--- dlls/oleaut32/typelib2.c	27 Jul 2007 12:36:04 -0000	1.46
+++ dlls/oleaut32/typelib2.c	3 Nov 2007 14:21:13 -0000
@@ -3493,7 +3493,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTyp
 
     TRACE("(%p,%d,%p)\n", iface, index, ppTInfo);
 
-    if ((index < 0) || (index >= This->typelib_header.nrtypeinfos)) {
+    if (index >= This->typelib_header.nrtypeinfos) {
 	return TYPE_E_ELEMENTNOTFOUND;
     }
 
@@ -3514,7 +3514,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTyp
 
     TRACE("(%p,%d,%p)\n", iface, index, pTKind);
 
-    if ((index < 0) || (index >= This->typelib_header.nrtypeinfos)) {
+    if (index >= This->typelib_header.nrtypeinfos) {
 	return TYPE_E_ELEMENTNOTFOUND;
     }
 



More information about the wine-patches mailing list