advapi32: Avoid signed-unsigned integer comparisons

Andrew Talbot andrew.talbot at talbotville.com
Sat Dec 8 12:36:20 CST 2012


Changelog:
    advapi32: Avoid signed-unsigned integer comparisons.

diff --git a/dlls/advapi32/eventlog.c b/dlls/advapi32/eventlog.c
index 38c533a..eb3f606 100644
--- a/dlls/advapi32/eventlog.c
+++ b/dlls/advapi32/eventlog.c
@@ -651,7 +651,7 @@ BOOL WINAPI ReportEventA ( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD d
 {
     LPWSTR *wideStrArray;
     UNICODE_STRING str;
-    int i;
+    unsigned int i;
     BOOL ret;
 
     FIXME("(%p,0x%04x,0x%04x,0x%08x,%p,0x%04x,0x%08x,%p,%p): stub\n", hEventLog,
@@ -684,7 +684,7 @@ BOOL WINAPI ReportEventA ( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD d
 BOOL WINAPI ReportEventW( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID,
     PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCWSTR *lpStrings, LPVOID lpRawData )
 {
-    int i;
+    unsigned int i;
 
     FIXME("(%p,0x%04x,0x%04x,0x%08x,%p,0x%04x,0x%08x,%p,%p): stub\n", hEventLog,
           wType, wCategory, dwEventID, lpUserSid, wNumStrings, dwDataSize, lpStrings, lpRawData);
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index 744908f..520a34a 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -2617,7 +2617,7 @@ LSTATUS WINAPI RegOpenUserClassesRoot(
  * avoid importing user32, which is higher level than advapi32. Helper for
  * RegLoadMUIString.
  */
-static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars)
+static UINT load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, UINT cMaxChars)
 {
     HGLOBAL hMemory;
     HRSRC hResource;
@@ -2644,7 +2644,7 @@ static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMa
 
     /* Else copy over the string, respecting the buffer size. */
     cMaxChars = (*pString < cMaxChars) ? *pString : (cMaxChars - 1);
-    if (cMaxChars >= 0) {
+    if (cMaxChars > 0) {
         memcpy(pwszBuffer, pString+1, cMaxChars * sizeof(WCHAR));
         pwszBuffer[cMaxChars] = '\0';
     }
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index e000854..678bfe0 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -4757,8 +4757,7 @@ static BOOL DumpAce(LPVOID pace, WCHAR **pwptr, ULONG *plen)
 
 static BOOL DumpAcl(PACL pacl, WCHAR **pwptr, ULONG *plen, BOOL protected, BOOL autoInheritReq, BOOL autoInherited)
 {
-    WORD count;
-    int i;
+    UINT count, i;
 
     if (protected)
         DumpString(SDDL_PROTECTED, -1, pwptr, plen);




More information about the wine-patches mailing list