Alexandre Julliard : jscript: Use the official Windows constant for MAXLONGLONG.

Alexandre Julliard julliard at winehq.org
Mon Oct 14 12:39:28 CDT 2013


Module: wine
Branch: master
Commit: a804cc711b773234ce74c27ae4aab5e4614b38ab
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a804cc711b773234ce74c27ae4aab5e4614b38ab

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Oct 14 15:14:16 2013 +0200

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 0c0aa29..64546bd 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 54c8fcf..8b881f3 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 293e05d..3e19225 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
 




More information about the wine-cvs mailing list