https://git.reactos.org/?p=reactos.git;a=commitdiff;h=46ca069e422996575a20dd...
commit 46ca069e422996575a20dd76f2a62b59c5183060 Author: Victor Perevertkin victor.perevertkin@reactos.org AuthorDate: Tue Jan 19 00:15:02 2021 +0300 Commit: Victor Perevertkin victor.perevertkin@reactos.org CommitDate: Tue Jan 19 00:15:02 2021 +0300
[XDK] Remove UNREFERENCE_LOCAL_VARIABLE macro
Change UNREFERENCED_PARAMETER to (VOID)P to support const parameters --- dll/win32/kernel32/client/proc.c | 9 ++++----- modules/rostests/kmtests/ntos_ke/KeSpinLock.c | 2 +- sdk/include/xdk/ntbasedef.h | 3 +-- sdk/include/xdk/winnt_old.h | 2 +- sdk/include/xdk/x86/ke.h | 2 +- win32ss/drivers/videoprt/videoprt.c | 11 ++--------- win32ss/user/ntuser/object.h | 1 - 7 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/dll/win32/kernel32/client/proc.c b/dll/win32/kernel32/client/proc.c index cba4cf6a1e6..e107c19b029 100644 --- a/dll/win32/kernel32/client/proc.c +++ b/dll/win32/kernel32/client/proc.c @@ -1606,12 +1606,11 @@ FatalAppExitW(IN UINT uAction, #endif &Response);
-#if DBG /* Give the user a chance to abort */ - if ((NT_SUCCESS(Status)) && (Response == ResponseCancel)) return; -#else - UNREFERENCED_LOCAL_VARIABLE(Status); -#endif + if ((NT_SUCCESS(Status)) && (Response == ResponseCancel)) + { + return; + }
/* Otherwise kill the process */ ExitProcess(0); diff --git a/modules/rostests/kmtests/ntos_ke/KeSpinLock.c b/modules/rostests/kmtests/ntos_ke/KeSpinLock.c index 30838b3271a..d761d8e9a25 100644 --- a/modules/rostests/kmtests/ntos_ke/KeSpinLock.c +++ b/modules/rostests/kmtests/ntos_ke/KeSpinLock.c @@ -166,7 +166,7 @@ BOOLEAN TryNoRaise(PKSPIN_LOCK SpinLock, PCHECK_DATA CheckData) { #define CheckSpinLockLock(SpinLock, CheckData, Value) do \ { \ PKTHREAD Thread = KeGetCurrentThread(); \ - UNREFERENCED_LOCAL_VARIABLE(Thread); \ + (VOID)Thread; \ if (KmtIsMultiProcessorBuild) \ { \ ok_eq_bool(Ret, (Value) == 0); \ diff --git a/sdk/include/xdk/ntbasedef.h b/sdk/include/xdk/ntbasedef.h index c87be90a7a0..671ec27b0ec 100644 --- a/sdk/include/xdk/ntbasedef.h +++ b/sdk/include/xdk/ntbasedef.h @@ -314,8 +314,7 @@ #endif /* DEPRECATE_DDK_FUNCTIONS */
/* Use to silence unused variable warnings when it is intentional */ -#define UNREFERENCED_PARAMETER(P) {(P)=(P);} -#define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L)) +#define UNREFERENCED_PARAMETER(P) ((void)(P)) #define DBG_UNREFERENCED_PARAMETER(P) {(P)=(P);} #define DBG_UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L))
diff --git a/sdk/include/xdk/winnt_old.h b/sdk/include/xdk/winnt_old.h index dff77bab5c3..75e86392711 100644 --- a/sdk/include/xdk/winnt_old.h +++ b/sdk/include/xdk/winnt_old.h @@ -4262,7 +4262,7 @@ VOID MemoryBarrier(VOID) { LONG Barrier, *Dummy = &Barrier; - UNREFERENCED_LOCAL_VARIABLE(Dummy); + (VOID)Dummy; __asm__ __volatile__("xchgl %%eax, %[Barrier]" : : [Barrier] "m" (Barrier) : "memory"); } #endif diff --git a/sdk/include/xdk/x86/ke.h b/sdk/include/xdk/x86/ke.h index 4b66e2a9d37..b367a93d1b5 100644 --- a/sdk/include/xdk/x86/ke.h +++ b/sdk/include/xdk/x86/ke.h @@ -52,7 +52,7 @@ VOID KeMemoryBarrier(VOID) { LONG Barrier, *Dummy = &Barrier; - UNREFERENCED_LOCAL_VARIABLE(Dummy); + (VOID)Dummy;
#if defined(__GNUC__) __asm__ __volatile__ ("xchg %%eax, %0" : : "m" (Barrier) : "%eax"); diff --git a/win32ss/drivers/videoprt/videoprt.c b/win32ss/drivers/videoprt/videoprt.c index edce0febccd..6c54e16fbef 100644 --- a/win32ss/drivers/videoprt/videoprt.c +++ b/win32ss/drivers/videoprt/videoprt.c @@ -1477,14 +1477,10 @@ VideoPortAcquireDeviceLock( IN PVOID HwDeviceExtension) { PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; - NTSTATUS Status; - - UNREFERENCED_LOCAL_VARIABLE(Status);
TRACE_(VIDEOPRT, "VideoPortAcquireDeviceLock\n"); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); - Status = KeWaitForMutexObject(&DeviceExtension->DeviceLock, Executive, - KernelMode, FALSE, NULL); + KeWaitForMutexObject(&DeviceExtension->DeviceLock, Executive, KernelMode, FALSE, NULL); // ASSERT(Status == STATUS_SUCCESS); }
@@ -1497,13 +1493,10 @@ VideoPortReleaseDeviceLock( IN PVOID HwDeviceExtension) { PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension; - LONG Status; - - UNREFERENCED_LOCAL_VARIABLE(Status);
TRACE_(VIDEOPRT, "VideoPortReleaseDeviceLock\n"); DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension); - Status = KeReleaseMutex(&DeviceExtension->DeviceLock, FALSE); + KeReleaseMutex(&DeviceExtension->DeviceLock, FALSE); //ASSERT(Status == STATUS_SUCCESS); }
diff --git a/win32ss/user/ntuser/object.h b/win32ss/user/ntuser/object.h index b30a77b5cc6..9fb1b7f6637 100644 --- a/win32ss/user/ntuser/object.h +++ b/win32ss/user/ntuser/object.h @@ -40,7 +40,6 @@ UserDerefObjectCo(PVOID obj) PTHREADINFO W32Thread; PSINGLE_LIST_ENTRY ReferenceEntry; PUSER_REFERENCE_ENTRY UserReferenceEntry; - UNREFERENCED_LOCAL_VARIABLE(UserReferenceEntry);
ASSERT(obj != NULL); W32Thread = PsGetCurrentThreadWin32Thread();