ntdll: Remove unneeded casts

Andrew Talbot andrew.talbot at talbotville.com
Fri Dec 28 11:21:48 CST 2007


Changelog:
    ntdll: Remove unneeded casts.

diff --git a/dlls/ntdll/critsection.c b/dlls/ntdll/critsection.c
index 90626db..3c0d549 100644
--- a/dlls/ntdll/critsection.c
+++ b/dlls/ntdll/critsection.c
@@ -209,7 +209,7 @@ static inline HANDLE get_semaphore( RTL_CRITICAL_SECTION *crit )
         HANDLE sem;
         if (NtCreateSemaphore( &sem, SEMAPHORE_ALL_ACCESS, NULL, 0, 1 )) return 0;
         if (!(ret = (HANDLE)interlocked_cmpxchg_ptr( (PVOID *)&crit->LockSemaphore,
-                                                     (PVOID)sem, 0 )))
+                                                     sem, 0 )))
             ret = sem;
         else
             NtClose(sem);  /* somebody beat us to it */
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index 198c5b1..57ae2cb 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -1621,8 +1621,8 @@ NTSTATUS WINAPI RtlWalkHeap( HANDLE heap, PVOID entry_ptr )
         ptr = entry->lpData;
         LIST_FOR_EACH_ENTRY( sub, &heapPtr->subheap_list, SUBHEAP, entry )
         {
-            if (((char *)ptr >= (char *)sub->base) &&
-                ((char *)ptr < (char *)sub->base + sub->size))
+            if ((ptr >= (char *)sub->base) &&
+                (ptr < (char *)sub->base + sub->size))
             {
                 currentheap = sub;
                 break;
diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c
index 8b724ec..a095ee3 100644
--- a/dlls/ntdll/reg.c
+++ b/dlls/ntdll/reg.c
@@ -833,7 +833,7 @@ NTSTATUS WINAPI RtlFormatCurrentUserKeyPath( IN OUT PUNICODE_STRING KeyPath)
                     KeyPath->Buffer = (PWCHAR)((LPBYTE)buf + sizeof(pathW));
                     status = RtlConvertSidToUnicodeString(KeyPath,
                                                           ((TOKEN_USER *)buffer)->User.Sid, FALSE);
-                    KeyPath->Buffer = (PWCHAR)buf;
+                    KeyPath->Buffer = buf;
                     KeyPath->Length += sizeof(pathW);
                     KeyPath->MaximumLength += sizeof(pathW);
                 }
diff --git a/dlls/ntdll/relay.c b/dlls/ntdll/relay.c
index 2f819c4..f9679a6 100644
--- a/dlls/ntdll/relay.c
+++ b/dlls/ntdll/relay.c
@@ -526,7 +526,7 @@ void RELAY_SetupDLL( HMODULE module )
     /* patch the functions in the export table to point to the relay thunks */
 
     funcs = (DWORD *)((char *)module + exports->AddressOfFunctions);
-    entry_point_rva = (const char *)descr->entry_point_base - (const char *)module;
+    entry_point_rva = descr->entry_point_base - (const char *)module;
     for (i = 0; i < exports->NumberOfFunctions; i++, funcs++)
     {
         if (!descr->entry_point_offsets[i]) continue;   /* not a normal function */
diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c
index fd5ed7a..5a1fe89 100644
--- a/dlls/ntdll/sec.c
+++ b/dlls/ntdll/sec.c
@@ -66,8 +66,8 @@ static BOOLEAN copy_acl(DWORD nDestinationAclLength, PACL pDestinationAcl, PACL
 
     if (!pSourceAcl || !RtlValidAcl(pSourceAcl))
         return FALSE;
-        
-    size = ((ACL *)pSourceAcl)->AclSize;
+
+    size = pSourceAcl->AclSize;
     if (nDestinationAclLength < size)
         return FALSE;
 
diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c
index 147667b..f73f707 100644
--- a/dlls/ntdll/threadpool.c
+++ b/dlls/ntdll/threadpool.c
@@ -148,7 +148,7 @@ static NTSTATUS add_work_item_to_queue(struct work_item *work_item)
     {
         HANDLE sem;
         status = NtCreateSemaphore(&sem, SEMAPHORE_ALL_ACCESS, NULL, 1, LONG_MAX);
-        if (interlocked_cmpxchg_ptr( (PVOID *)&work_item_event, (PVOID)sem, 0 ))
+        if (interlocked_cmpxchg_ptr( (PVOID *)&work_item_event, sem, 0 ))
             NtClose(sem);  /* somebody beat us to it */
     }
     else



More information about the wine-patches mailing list