فهرست منبع

* properly define Min/Max values of Native*Int helpers, resolves #33543

git-svn-id: trunk@38664 -
florian 7 سال پیش
والد
کامیت
add418db0e
1فایلهای تغییر یافته به همراه3 افزوده شده و 12 حذف شده
  1. 3 12
      rtl/objpas/sysutils/syshelph.inc

+ 3 - 12
rtl/objpas/sysutils/syshelph.inc

@@ -522,13 +522,8 @@ Type
   TNativeIntHelper = Type Helper for NativeInt
   TNativeIntHelper = Type Helper for NativeInt
   public
   public
     const
     const
-{$IFDEF CPU64BITS}
-      MaxValue = 9223372036854775807;
-      MinValue = -9223372036854775808;
-{$ELSE !CPU64BITS}
-      MaxValue = 2147483647;
-      MinValue = -2147483648;
-{$ENDIF CPU64BITS}
+      MaxValue = High(NativeInt);
+      MinValue = Low(NativeUInt);
   Public
   Public
     Class Function Parse(const AString: string): NativeInt; inline; static;
     Class Function Parse(const AString: string): NativeInt; inline; static;
     Class Function Size: Integer; inline; static;
     Class Function Size: Integer; inline; static;
@@ -547,11 +542,7 @@ Type
   TNativeUIntHelper = Type Helper for NativeUInt
   TNativeUIntHelper = Type Helper for NativeUInt
   public
   public
     const
     const
-{$IFDEF CPU64BITS}
-      MaxValue = 18446744073709551615;
-{$ELSE !CPU64BITS}
-      MaxValue = 4294967295;
-{$ENDIF CPU64BITS}
+      MaxValue = High(NativeUInt);
       MinValue = 0;
       MinValue = 0;
   Public
   Public
     Class Function Parse(const AString: string): NativeUInt; inline; static;
     Class Function Parse(const AString: string): NativeUInt; inline; static;