[XDK] Remove UNREFERENCE_LOCAL_VARIABLE macro
authorVictor Perevertkin <victor.perevertkin@reactos.org>
Mon, 18 Jan 2021 21:15:02 +0000 (00:15 +0300)
committerVictor Perevertkin <victor.perevertkin@reactos.org>
Mon, 18 Jan 2021 21:15:02 +0000 (00:15 +0300)
Change UNREFERENCED_PARAMETER to (VOID)P to support const parameters

dll/win32/kernel32/client/proc.c
modules/rostests/kmtests/ntos_ke/KeSpinLock.c
sdk/include/xdk/ntbasedef.h
sdk/include/xdk/winnt_old.h
sdk/include/xdk/x86/ke.h
win32ss/drivers/videoprt/videoprt.c
win32ss/user/ntuser/object.h

index cba4cf6..e107c19 100644 (file)
@@ -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);
index 30838b3..d761d8e 100644 (file)
@@ -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);                                              \
index c87be90..671ec27 100644 (file)
 #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))
 
index dff77ba..75e8639 100644 (file)
@@ -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
index 4b66e2a..b367a93 100644 (file)
@@ -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");
index edce0fe..6c54e16 100644 (file)
@@ -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);
 }
 
index b30a77b..9fb1b7f 100644 (file)
@@ -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();