From a804cc711b773234ce74c27ae4aab5e4614b38ab Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 14 Oct 2013 15:14:16 +0200 Subject: [PATCH] jscript: Use the official Windows constant for MAXLONGLONG. --- dlls/jscript/global.c | 6 ++---- dlls/jscript/lex.c | 6 ++---- include/winnt.h | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index 0c0aa2946f9..64546bdf3db 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -29,8 +29,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript); -#define LONGLONG_MAX (((LONGLONG)0x7fffffff<<32)|0xffffffff) - static const WCHAR NaNW[] = {'N','a','N',0}; static const WCHAR InfinityW[] = {'I','n','f','i','n','i','t','y',0}; static const WCHAR ArrayW[] = {'A','r','r','a','y',0}; @@ -554,7 +552,7 @@ static HRESULT JSGlobal_parseFloat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag while(isdigitW(*str)) { hlp = d*10 + *(str++) - '0'; - if(d>LONGLONG_MAX/10 || hlp<0) { + if(d>MAXLONGLONG/10 || hlp<0) { exp++; break; } @@ -573,7 +571,7 @@ static HRESULT JSGlobal_parseFloat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag while(isdigitW(*str)) { hlp = d*10 + *(str++) - '0'; - if(d>LONGLONG_MAX/10 || hlp<0) + if(d>MAXLONGLONG/10 || hlp<0) break; d = hlp; diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c index 54c8fcf98ce..8b881f39a9a 100644 --- a/dlls/jscript/lex.c +++ b/dlls/jscript/lex.c @@ -33,8 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(jscript); -#define LONGLONG_MAX (((LONGLONG)0x7fffffff<<32)|0xffffffff) - static const WCHAR breakW[] = {'b','r','e','a','k',0}; static const WCHAR caseW[] = {'c','a','s','e',0}; static const WCHAR catchW[] = {'c','a','t','c','h',0}; @@ -397,7 +395,7 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li d = int_part; while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { hlp = d*10 + *(ctx->ptr++) - '0'; - if(d>LONGLONG_MAX/10 || hlp<0) { + if(d>MAXLONGLONG/10 || hlp<0) { exp++; break; } @@ -414,7 +412,7 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) { hlp = d*10 + *(ctx->ptr++) - '0'; - if(d>LONGLONG_MAX/10 || hlp<0) + if(d>MAXLONGLONG/10 || hlp<0) break; d = hlp; diff --git a/include/winnt.h b/include/winnt.h index 293e05d445e..3e19225450c 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -742,6 +742,7 @@ typedef struct _MEMORY_BASIC_INFORMATION #define MAXBYTE 0xff #define MAXWORD 0xffff #define MAXDWORD 0xffffffff +#define MAXLONGLONG (((LONGLONG)0x7fffffff << 32) | 0xffffffff) #define UNICODE_STRING_MAX_CHARS 32767