mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:52:56 +00:00
[LOCALSPL] Fix 2 Clang-Cl warnings about ullResult and "UserName"
- "warning: comparison of unsigned expression < 0 is always false [-Wtautological-unsigned-zero-compare]" - "warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]" CORE-14306
This commit is contained in:
parent
d82ccaa2a2
commit
6d912629f7
1 changed files with 3 additions and 18 deletions
|
@ -108,7 +108,7 @@ _GlobalJobListCompareRoutine(PVOID FirstStruct, PVOID SecondStruct)
|
||||||
/**
|
/**
|
||||||
* @name _PrinterJobListCompareRoutine
|
* @name _PrinterJobListCompareRoutine
|
||||||
*
|
*
|
||||||
* SKIPLIST_COMPARE_ROUTINE for the each Printer's Job List.
|
* SKIPLIST_COMPARE_ROUTINE for each Printer's Job List.
|
||||||
* Jobs in this list are sorted in the desired order of processing.
|
* Jobs in this list are sorted in the desired order of processing.
|
||||||
*/
|
*/
|
||||||
static int WINAPI
|
static int WINAPI
|
||||||
|
@ -119,9 +119,6 @@ _PrinterJobListCompareRoutine(PVOID FirstStruct, PVOID SecondStruct)
|
||||||
int iComparison;
|
int iComparison;
|
||||||
FILETIME ftSubmittedA;
|
FILETIME ftSubmittedA;
|
||||||
FILETIME ftSubmittedB;
|
FILETIME ftSubmittedB;
|
||||||
ULARGE_INTEGER uliSubmittedA;
|
|
||||||
ULARGE_INTEGER uliSubmittedB;
|
|
||||||
ULONGLONG ullResult;
|
|
||||||
|
|
||||||
// First compare the priorities to determine the order.
|
// First compare the priorities to determine the order.
|
||||||
// The job with a higher priority shall come first.
|
// The job with a higher priority shall come first.
|
||||||
|
@ -130,7 +127,6 @@ _PrinterJobListCompareRoutine(PVOID FirstStruct, PVOID SecondStruct)
|
||||||
return iComparison;
|
return iComparison;
|
||||||
|
|
||||||
// Both have the same priority, so go by creation time.
|
// Both have the same priority, so go by creation time.
|
||||||
// Comparison is done using the MSDN-recommended way for comparing SYSTEMTIMEs.
|
|
||||||
if (!SystemTimeToFileTime(&A->stSubmitted, &ftSubmittedA))
|
if (!SystemTimeToFileTime(&A->stSubmitted, &ftSubmittedA))
|
||||||
{
|
{
|
||||||
ERR("SystemTimeToFileTime failed for A with error %lu!\n", GetLastError());
|
ERR("SystemTimeToFileTime failed for A with error %lu!\n", GetLastError());
|
||||||
|
@ -143,18 +139,7 @@ _PrinterJobListCompareRoutine(PVOID FirstStruct, PVOID SecondStruct)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uliSubmittedA.LowPart = ftSubmittedA.dwLowDateTime;
|
return CompareFileTime(&ftSubmittedA, &ftSubmittedB);
|
||||||
uliSubmittedA.HighPart = ftSubmittedA.dwHighDateTime;
|
|
||||||
uliSubmittedB.LowPart = ftSubmittedB.dwLowDateTime;
|
|
||||||
uliSubmittedB.HighPart = ftSubmittedB.dwHighDateTime;
|
|
||||||
ullResult = uliSubmittedA.QuadPart - uliSubmittedB.QuadPart;
|
|
||||||
|
|
||||||
if (ullResult < 0)
|
|
||||||
return -1;
|
|
||||||
else if (ullResult > 0)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
|
@ -781,7 +766,7 @@ _LocalSetJobLevel1(PLOCAL_PRINTER_HANDLE pPrinterHandle, PLOCAL_JOB pJob, PJOB_I
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the user name has changed. An empty string is permitted here!
|
// Check if the user name has changed. An empty string is permitted here!
|
||||||
if (!_EqualStrings(pJob->pwszUserName, pJobInfo->pUserName) != 0)
|
if (!_EqualStrings(pJob->pwszUserName, pJobInfo->pUserName))
|
||||||
{
|
{
|
||||||
// The new user name doesn't need to exist, so no additional verification is required.
|
// The new user name doesn't need to exist, so no additional verification is required.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue