Commit 00981b58 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

ntdll: Remove unneeded casts.

parent a69418c5
...@@ -39,12 +39,12 @@ WINE_DECLARE_DEBUG_CHANNEL(relay); ...@@ -39,12 +39,12 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
static inline LONG interlocked_inc( PLONG dest ) static inline LONG interlocked_inc( PLONG dest )
{ {
return interlocked_xchg_add( (int *)dest, 1 ) + 1; return interlocked_xchg_add( dest, 1 ) + 1;
} }
static inline LONG interlocked_dec( PLONG dest ) static inline LONG interlocked_dec( PLONG dest )
{ {
return interlocked_xchg_add( (int *)dest, -1 ) - 1; return interlocked_xchg_add( dest, -1 ) - 1;
} }
static inline void small_pause(void) static inline void small_pause(void)
...@@ -208,8 +208,7 @@ static inline HANDLE get_semaphore( RTL_CRITICAL_SECTION *crit ) ...@@ -208,8 +208,7 @@ static inline HANDLE get_semaphore( RTL_CRITICAL_SECTION *crit )
{ {
HANDLE sem; HANDLE sem;
if (NtCreateSemaphore( &sem, SEMAPHORE_ALL_ACCESS, NULL, 0, 1 )) return 0; if (NtCreateSemaphore( &sem, SEMAPHORE_ALL_ACCESS, NULL, 0, 1 )) return 0;
if (!(ret = (HANDLE)interlocked_cmpxchg_ptr( (PVOID *)&crit->LockSemaphore, if (!(ret = interlocked_cmpxchg_ptr( &crit->LockSemaphore, sem, 0 )))
sem, 0 )))
ret = sem; ret = sem;
else else
NtClose(sem); /* somebody beat us to it */ NtClose(sem); /* somebody beat us to it */
...@@ -490,7 +489,7 @@ NTSTATUS WINAPI RtlEnterCriticalSection( RTL_CRITICAL_SECTION *crit ) ...@@ -490,7 +489,7 @@ NTSTATUS WINAPI RtlEnterCriticalSection( RTL_CRITICAL_SECTION *crit )
if (crit->LockCount > 0) break; /* more than one waiter, don't bother spinning */ if (crit->LockCount > 0) break; /* more than one waiter, don't bother spinning */
if (crit->LockCount == -1) /* try again */ if (crit->LockCount == -1) /* try again */
{ {
if (interlocked_cmpxchg( (int *)&crit->LockCount, 0, -1 ) == -1) goto done; if (interlocked_cmpxchg( &crit->LockCount, 0, -1 ) == -1) goto done;
} }
small_pause(); small_pause();
} }
...@@ -534,7 +533,7 @@ done: ...@@ -534,7 +533,7 @@ done:
BOOL WINAPI RtlTryEnterCriticalSection( RTL_CRITICAL_SECTION *crit ) BOOL WINAPI RtlTryEnterCriticalSection( RTL_CRITICAL_SECTION *crit )
{ {
BOOL ret = FALSE; BOOL ret = FALSE;
if (interlocked_cmpxchg( (int *)&crit->LockCount, 0, -1 ) == -1) if (interlocked_cmpxchg( &crit->LockCount, 0, -1 ) == -1)
{ {
crit->OwningThread = ULongToHandle(GetCurrentThreadId()); crit->OwningThread = ULongToHandle(GetCurrentThreadId());
crit->RecursionCount = 1; crit->RecursionCount = 1;
......
...@@ -264,9 +264,9 @@ static NTSTATUS get_line_control(int fd, SERIAL_LINE_CONTROL* slc) ...@@ -264,9 +264,9 @@ static NTSTATUS get_line_control(int fd, SERIAL_LINE_CONTROL* slc)
case CS6: slc->WordLength = 6; break; case CS6: slc->WordLength = 6; break;
case CS7: slc->WordLength = 7; break; case CS7: slc->WordLength = 7; break;
case CS8: slc->WordLength = 8; break; case CS8: slc->WordLength = 8; break;
default: ERR("unknown size %x\n", (UINT)(port.c_cflag & CSIZE)); default: ERR("unknown size %x\n", port.c_cflag & CSIZE);
} }
if (port.c_cflag & CSTOPB) if (port.c_cflag & CSTOPB)
{ {
if (slc->WordLength == 5) if (slc->WordLength == 5)
......
...@@ -73,12 +73,12 @@ struct work_item ...@@ -73,12 +73,12 @@ struct work_item
static inline LONG interlocked_inc( PLONG dest ) static inline LONG interlocked_inc( PLONG dest )
{ {
return interlocked_xchg_add( (int *)dest, 1 ) + 1; return interlocked_xchg_add( dest, 1 ) + 1;
} }
static inline LONG interlocked_dec( PLONG dest ) static inline LONG interlocked_dec( PLONG dest )
{ {
return interlocked_xchg_add( (int *)dest, -1 ) - 1; return interlocked_xchg_add( dest, -1 ) - 1;
} }
static void WINAPI worker_thread_proc(void * param) static void WINAPI worker_thread_proc(void * param)
...@@ -148,7 +148,7 @@ static NTSTATUS add_work_item_to_queue(struct work_item *work_item) ...@@ -148,7 +148,7 @@ static NTSTATUS add_work_item_to_queue(struct work_item *work_item)
{ {
HANDLE sem; HANDLE sem;
status = NtCreateSemaphore(&sem, SEMAPHORE_ALL_ACCESS, NULL, 1, LONG_MAX); status = NtCreateSemaphore(&sem, SEMAPHORE_ALL_ACCESS, NULL, 1, LONG_MAX);
if (interlocked_cmpxchg_ptr( (PVOID *)&work_item_event, sem, 0 )) if (interlocked_cmpxchg_ptr( &work_item_event, sem, 0 ))
NtClose(sem); /* somebody beat us to it */ NtClose(sem); /* somebody beat us to it */
} }
else else
...@@ -486,14 +486,14 @@ NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE WaitHandle, HANDLE CompletionEvent) ...@@ -486,14 +486,14 @@ NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE WaitHandle, HANDLE CompletionEvent)
status = NtCreateEvent( &CompletionEvent, EVENT_ALL_ACCESS, NULL, TRUE, FALSE ); status = NtCreateEvent( &CompletionEvent, EVENT_ALL_ACCESS, NULL, TRUE, FALSE );
if (status != STATUS_SUCCESS) if (status != STATUS_SUCCESS)
return status; return status;
interlocked_xchg_ptr( (PVOID *)&wait_work_item->CompletionEvent, CompletionEvent ); interlocked_xchg_ptr( &wait_work_item->CompletionEvent, CompletionEvent );
if (wait_work_item->CallbackInProgress) if (wait_work_item->CallbackInProgress)
NtWaitForSingleObject( CompletionEvent, FALSE, NULL ); NtWaitForSingleObject( CompletionEvent, FALSE, NULL );
NtClose( CompletionEvent ); NtClose( CompletionEvent );
} }
else else
{ {
interlocked_xchg_ptr( (PVOID *)&wait_work_item->CompletionEvent, CompletionEvent ); interlocked_xchg_ptr( &wait_work_item->CompletionEvent, CompletionEvent );
if (wait_work_item->CallbackInProgress) if (wait_work_item->CallbackInProgress)
status = STATUS_PENDING; status = STATUS_PENDING;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment