From 1ebe82af65943bdafe8dfcfc613b60677f41c765 Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Fri, 28 Dec 2007 17:21:48 +0000 Subject: [PATCH] ntdll: Remove unneeded casts. --- dlls/ntdll/critsection.c | 2 +- dlls/ntdll/heap.c | 4 ++-- dlls/ntdll/reg.c | 2 +- dlls/ntdll/relay.c | 2 +- dlls/ntdll/sec.c | 4 ++-- dlls/ntdll/threadpool.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/critsection.c b/dlls/ntdll/critsection.c index 90626db396e..3c0d549e9b9 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 198c5b1d386..57ae2cb271b 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 8b724ec4b48..a095ee389b8 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 2f819c4a601..f9679a6e37d 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 fd5ed7a7601..5a1fe89a384 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 147667b0895..f73f7075e6f 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