From: Zebediah Figura Subject: Re: [PATCH] ntoskrnl.exe/tests: Use NULL instead of casting 0 Message-Id: Date: Fri, 7 Dec 2018 15:43:08 -0600 In-Reply-To: <003c5bc7-364a-41e2-91e6-31e1c52ef6d0@winehq.org> References: <20181207205717.11320-2-mstefani@winehq.org> <95aed620-34c9-6ac3-d594-6c9d889f3601@gmail.com> <003c5bc7-364a-41e2-91e6-31e1c52ef6d0@winehq.org> On 12/07/2018 03:40 PM, Michael Stefaniuc wrote: > On 12/7/18 10:03 PM, Zebediah Figura wrote: >> On 12/07/2018 02:57 PM, Michael Stefaniuc wrote: >>> Signed-off-by: Michael Stefaniuc >>> --- >>>   dlls/ntoskrnl.exe/tests/driver.c | 4 ++-- >>>   1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/dlls/ntoskrnl.exe/tests/driver.c >>> b/dlls/ntoskrnl.exe/tests/driver.c >>> index 17e54cd508..8f41d39747 100644 >>> --- a/dlls/ntoskrnl.exe/tests/driver.c >>> +++ b/dlls/ntoskrnl.exe/tests/driver.c >>> @@ -435,7 +435,7 @@ static void test_sync(void) >>>           ok(ret == i - 9, "expected %d, got %d\n", i - 9, ret); >>>       } >>>   -    run_thread(mutex_thread, (void *)0); >>> +    run_thread(mutex_thread, NULL); >>>         ret = wait_single(&test_mutex, 0); >>>       ok(ret == 0, "got %#x\n", ret); >>> @@ -445,7 +445,7 @@ static void test_sync(void) >>>       ret = KeReleaseMutex(&test_mutex, 0); >>>       ok(ret == 0, "got %#x\n", ret); >>>   -    run_thread(mutex_thread, (void *)0); >>> +    run_thread(mutex_thread, NULL); >>>         /* test timers */ >>>       KeInitializeTimerEx(&timer, NotificationTimer); >>> >> >> I'd argue this should be left as it is; the test is casting an NTSTATUS >> value to the (void *) used as the thread parameter. > If it is a NTSTATUS shouldn't you use STATUS_SUCCESS instead of 0 then? > Well, maybe, but given that KeWaitForMultipleObjects returns an index, this isn't clearly better.