https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a3763c61dcd579798bd154...
commit a3763c61dcd579798bd1548c6e82091fa94b91df Author: Timo Kreuzer timo.kreuzer@reactos.org AuthorDate: Tue Jun 29 10:57:43 2021 +0200 Commit: Timo Kreuzer timo.kreuzer@reactos.org CommitDate: Fri Jul 23 22:03:48 2021 +0200
[PSDK][NDK] Use hex to define MIN/MAX constants like in native SDK
This fixes use of unary minus operator on unsigned type warning. --- ntoskrnl/ke/wait.c | 2 +- sdk/include/ndk/umtypes.h | 12 ++++++------ sdk/include/xdk/ntbasedef.h | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/ntoskrnl/ke/wait.c b/ntoskrnl/ke/wait.c index 26869fdd7de..bc9b4e3115b 100644 --- a/ntoskrnl/ke/wait.c +++ b/ntoskrnl/ke/wait.c @@ -470,7 +470,7 @@ KeWaitForSingleObject(IN PVOID Object, (Thread == CurrentObject->OwnerThread)) { /* Just unwait this guy and exit */ - if (CurrentObject->Header.SignalState != (LONG)MINLONG) + if (CurrentObject->Header.SignalState != MINLONG) { /* It has a normal signal state. Unwait and return */ KiSatisfyMutantWait(CurrentObject, Thread); diff --git a/sdk/include/ndk/umtypes.h b/sdk/include/ndk/umtypes.h index 82b32eae971..3037151b6b0 100644 --- a/sdk/include/ndk/umtypes.h +++ b/sdk/include/ndk/umtypes.h @@ -108,12 +108,12 @@ Author: // // Limits // -#define MINCHAR (-128) -#define MAXCHAR 127 -#define MINSHORT (-32768) -#define MAXSHORT 32767 -#define MINLONG (-2147483648) -#define MAXLONG 2147483647 +#define MINCHAR 0x80 +#define MAXCHAR 0x7f +#define MINSHORT 0x8000 +#define MAXSHORT 0x7fff +#define MINLONG 0x80000000 +#define MAXLONG 0x7fffffff #define MAXUCHAR 0xff #define MAXUSHORT 0xffff #define MAXULONG 0xffffffff diff --git a/sdk/include/xdk/ntbasedef.h b/sdk/include/xdk/ntbasedef.h index 204d3164eaf..0071d7352e9 100644 --- a/sdk/include/xdk/ntbasedef.h +++ b/sdk/include/xdk/ntbasedef.h @@ -735,12 +735,12 @@ extern "C++" { \ #define COMPILETIME_OR_5FLAGS(a,b,c,d,e) ((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d)|(UINT)(e))
/* Type Limits */ -#define MINCHAR (-128) -#define MAXCHAR 127 -#define MINSHORT (-32768) -#define MAXSHORT 32767 -#define MINLONG (-2147483648) -#define MAXLONG 2147483647 +#define MINCHAR 0x80 +#define MAXCHAR 0x7f +#define MINSHORT 0x8000 +#define MAXSHORT 0x7fff +#define MINLONG 0x80000000 +#define MAXLONG 0x7fffffff $if(_NTDEF_) #define MAXUCHAR 0xff #define MAXUSHORT 0xffff