ntdll: Avoid signed-unsigned integer comparisons

Andrew Talbot andrew.talbot at talbotville.com
Wed Feb 20 15:25:56 CST 2013


Changelog:
    ntdll: Avoid signed-unsigned integer comparisons.

diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 863a320..cc6e5cb 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -215,7 +215,7 @@ static inline BOOL is_same_file( const struct file_identity *file, const struct
 
 static inline BOOL is_ignored_file( const struct stat *st )
 {
-    unsigned int i;
+    int i;
 
     for (i = 0; i < ignored_files_count; i++)
         if (is_same_file( &ignored_files[i], st )) return TRUE;
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index a2e0716..ee89bb7 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -1166,7 +1166,7 @@ void fill_cpu_info(void)
 static inline BOOL logical_proc_info_add_by_id(SYSTEM_LOGICAL_PROCESSOR_INFORMATION *data,
         DWORD *len, DWORD max_len, LOGICAL_PROCESSOR_RELATIONSHIP rel, DWORD id, DWORD proc)
 {
-    int i;
+    DWORD i;
 
     for(i=0; i<*len; i++)
     {
@@ -1192,7 +1192,7 @@ static inline BOOL logical_proc_info_add_by_id(SYSTEM_LOGICAL_PROCESSOR_INFORMAT
 static inline BOOL logical_proc_info_add_cache(SYSTEM_LOGICAL_PROCESSOR_INFORMATION *data,
         DWORD *len, DWORD max_len, ULONG_PTR mask, CACHE_DESCRIPTOR *cache)
 {
-    int i;
+    DWORD i;
 
     for(i=0; i<*len; i++)
     {
@@ -1891,7 +1891,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
             if (cpus == 0)
             {
                 static int i = 1;
-                int n;
+                unsigned int n;
                 cpus = min(NtCurrentTeb()->Peb->NumberOfProcessors, out_cpus);
                 len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * cpus;
                 sppi = RtlAllocateHeap(GetProcessHeap(), 0, len);
diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c
index 09151a9..58dde65 100644
--- a/dlls/ntdll/sync.c
+++ b/dlls/ntdll/sync.c
@@ -1091,7 +1091,8 @@ NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handles, UIN
                                           const LARGE_INTEGER *timeout, HANDLE signal_object )
 {
     NTSTATUS ret;
-    int i, cookie;
+    UINT i;
+    int cookie;
     BOOL user_apc = FALSE;
     obj_handle_t obj_handles[MAXIMUM_WAIT_OBJECTS];
     obj_handle_t apc_handle = 0;




More information about the wine-patches mailing list