Andrew Talbot : oleaut32: Avoid signed-unsigned integer comparisons.

Alexandre Julliard julliard at winehq.org
Fri Feb 22 14:14:00 CST 2013


Module: wine
Branch: master
Commit: eedf2f6fab3756eebd575c42aea45d8251f569fa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=eedf2f6fab3756eebd575c42aea45d8251f569fa

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Thu Feb 21 22:30:17 2013 +0000

oleaut32: Avoid signed-unsigned integer comparisons.

---

 dlls/oleaut32/olepicture.c   |    4 ++--
 dlls/oleaut32/olepropframe.c |    2 +-
 dlls/oleaut32/typelib.c      |   17 +++++++++++------
 dlls/oleaut32/typelib2.c     |    4 +++-
 4 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index 3fdb1c7..4b3e9dd 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -1420,8 +1420,8 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface, IStream *pStm)
   } while (!headerisdata);
 
   if (statfailed) { /* we don't know the size ... read all we get */
-      int sizeinc = 4096;
-      int origsize = sizeinc;
+      unsigned int sizeinc = 4096;
+      unsigned int origsize = sizeinc;
       ULONG nread = 42;
 
       TRACE("Reading all data from stream.\n");
diff --git a/dlls/oleaut32/olepropframe.c b/dlls/oleaut32/olepropframe.c
index e566266..9a563f1 100644
--- a/dlls/oleaut32/olepropframe.c
+++ b/dlls/oleaut32/olepropframe.c
@@ -168,7 +168,7 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
     IPropertyPage **property_page;
     PropertyPageSite *property_page_site;
     HRESULT res;
-    int i;
+    ULONG i;
     HMODULE hcomctl;
     HRSRC property_sheet_dialog_find = NULL;
     HGLOBAL property_sheet_dialog_load = NULL;
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 0f3ca6b..6d37bd4 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -4388,7 +4388,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid(
     ITypeInfo **ppTInfo)
 {
     ITypeLibImpl *This = impl_from_ITypeLib2(iface);
-    UINT i;
+    int i;
 
     TRACE("%p %s %p\n", This, debugstr_guid(guid), ppTInfo);
 
@@ -4553,7 +4553,8 @@ static HRESULT WINAPI ITypeLib2_fnIsName(
 	BOOL *pfName)
 {
     ITypeLibImpl *This = impl_from_ITypeLib2(iface);
-    UINT nNameBufLen = (lstrlenW(szNameBuf)+1)*sizeof(WCHAR), tic, fdc, vrc, pc;
+    int tic;
+    UINT nNameBufLen = (lstrlenW(szNameBuf)+1)*sizeof(WCHAR), fdc, vrc;
 
     TRACE("(%p)->(%s,%08x,%p)\n", This, debugstr_w(szNameBuf), lHashVal,
 	  pfName);
@@ -4564,6 +4565,8 @@ static HRESULT WINAPI ITypeLib2_fnIsName(
         if(!memcmp(szNameBuf,pTInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit;
         for(fdc = 0; fdc < pTInfo->TypeAttr.cFuncs; ++fdc) {
             TLBFuncDesc *pFInfo = &pTInfo->funcdescs[fdc];
+            int pc;
+
             if(!memcmp(szNameBuf,pFInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit;
             for(pc=0; pc < pFInfo->funcdesc.cParams; pc++)
                 if(!memcmp(szNameBuf,pFInfo->pParamDesc[pc].Name, nNameBufLen))
@@ -4599,7 +4602,8 @@ static HRESULT WINAPI ITypeLib2_fnFindName(
 	UINT16 *found)
 {
     ITypeLibImpl *This = impl_from_ITypeLib2(iface);
-    UINT tic, count = 0;
+    int tic;
+    UINT count = 0;
     UINT len;
 
     TRACE("(%p)->(%s %u %p %p %p)\n", This, debugstr_w(name), hash, ppTInfo, memid, found);
@@ -4616,7 +4620,7 @@ static HRESULT WINAPI ITypeLib2_fnFindName(
         if(!memcmp(name, pTInfo->Name, len)) goto ITypeLib2_fnFindName_exit;
         for(fdc = 0; fdc < pTInfo->TypeAttr.cFuncs; ++fdc) {
             TLBFuncDesc *func = &pTInfo->funcdescs[fdc];
-            UINT pc;
+            int pc;
 
             if(!memcmp(name, func->Name, len)) goto ITypeLib2_fnFindName_exit;
             for(pc = 0; pc < func->funcdesc.cParams; pc++) {
@@ -4995,7 +4999,7 @@ static HRESULT WINAPI ITypeLibComp_fnBindType(
     ITypeComp ** ppTComp)
 {
     ITypeLibImpl *This = impl_from_ITypeComp(iface);
-    UINT i;
+    int i;
 
     TRACE("(%s, %x, %p, %p)\n", debugstr_w(szName), lHash, ppTInfo, ppTComp);
 
@@ -5097,7 +5101,7 @@ static ULONG WINAPI ITypeInfo_fnAddRef( ITypeInfo2 *iface)
 
 static void ITypeInfoImpl_Destroy(ITypeInfoImpl *This)
 {
-    UINT i, j;
+    UINT i;
 
     TRACE("destroying ITypeInfo(%p)\n",This);
 
@@ -5112,6 +5116,7 @@ static void ITypeInfoImpl_Destroy(ITypeInfoImpl *This)
 
     for (i = 0; i < This->TypeAttr.cFuncs; ++i)
     {
+        int j;
         TLBFuncDesc *pFInfo = &This->funcdescs[i];
         for(j = 0; j < pFInfo->funcdesc.cParams; j++)
         {
diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c
index 689d9af..354ec8a 100644
--- a/dlls/oleaut32/typelib2.c
+++ b/dlls/oleaut32/typelib2.c
@@ -2050,8 +2050,10 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddFuncDesc(
         if(This->dual)
             This->dual->typedata = This->typedata;
     } else {
+        unsigned int j;
+
         iter = This->typedata->next;
-        for(i=0; i<index; i++)
+        for (j = 0; j < index; j++)
             iter = iter->next;
 
         insert->next = iter->next;




More information about the wine-cvs mailing list