[XDK] Remove UNREFERENCE_LOCAL_VARIABLE macro

Change UNREFERENCED_PARAMETER to (VOID)P to support const parameters
This commit is contained in:
Victor Perevertkin 2021-01-19 00:15:02 +03:00
parent af0f8581ad
commit 46ca069e42
No known key found for this signature in database
GPG key ID: C750B7222E9C7830
7 changed files with 10 additions and 20 deletions

View 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);

View 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); \

View file

@ -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))

View 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

View 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");

View 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);
}

View 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();