mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 23:18:39 +00:00
[PSDK] Do not compare to max value if we can make sure that the value fits in target type
This fixes clang warning -Wtautological-constant-out-of-range-compare
This commit is contained in:
parent
a4138329a1
commit
7513cc9fca
1 changed files with 1 additions and 1 deletions
|
@ -259,7 +259,7 @@ INTSAFE_NAME(_Name)( \
|
||||||
_In_ _TypeFrom Input, \
|
_In_ _TypeFrom Input, \
|
||||||
_Out_ _Deref_out_range_(==, Input) _TypeTo *pOutput) \
|
_Out_ _Deref_out_range_(==, Input) _TypeTo *pOutput) \
|
||||||
{ \
|
{ \
|
||||||
if (Input <= _TypeTo ## _MAX) \
|
if ((sizeof(_TypeFrom) < sizeof(_TypeTo)) || (Input <= _TypeTo ## _MAX)) \
|
||||||
{ \
|
{ \
|
||||||
*pOutput = (_TypeTo)Input; \
|
*pOutput = (_TypeTo)Input; \
|
||||||
return INTSAFE_SUCCESS; \
|
return INTSAFE_SUCCESS; \
|
||||||
|
|
Loading…
Reference in a new issue