]> git.saurik.com Git - wxWidgets.git/commitdiff
avoid undefined behavior from token paste resulting in more than one token
authorPaul Cornett <paulcor@bullseye.com>
Wed, 9 Jan 2008 07:35:14 +0000 (07:35 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Wed, 9 Jan 2008 07:35:14 +0000 (07:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h
src/common/wxcrt.cpp

index 4d4b4bbf695329285c3d461a7c5aba219921f832..44704739c516f40a5d20fbbb0edfe1d1202f156d 100644 (file)
@@ -928,7 +928,7 @@ typedef wxUint32 wxDword;
     #define wxINT64_MIN LLONG_MIN
 #else
     #define wxINT64_MAX wxLL(9223372036854775807)
     #define wxINT64_MIN LLONG_MIN
 #else
     #define wxINT64_MAX wxLL(9223372036854775807)
-    #define wxINT64_MIN wxLL(-9223372036854775807-1)
+    #define wxINT64_MIN (wxLL(-9223372036854775807)-1)
 #endif
 
 /*
 #endif
 
 /*
index 9ae281d008da750a34f8246e6b17f3b9fbea3b05..c329848585c7c2006e12f73f976bc4015f52b1d1 100644 (file)
@@ -1039,12 +1039,9 @@ static wxLongLong_t wxCRT_DoStrtoll(const T* nptr, T** endptr, int base)
 
     if ( sign == wxT('-') )
     {
 
     if ( sign == wxT('-') )
     {
-        if ( uval <= wxULL(wxINT64_MAX+1) )
+        if (uval <= (wxULongLong_t)wxINT64_MAX + 1)
         {
         {
-            if ( uval == wxULL(wxINT64_MAX+1))
-                val = -((wxLongLong_t)wxINT64_MAX) - 1;
-            else
-                val = -((wxLongLong_t)uval);
+            val = -(wxLongLong_t)uval;
         }
         else
         {
         }
         else
         {