Browse Source

* fixed StrToInt, IntToStr and friends for objpas.integer=smallint

git-svn-id: trunk@27067 -
nickysn 11 years ago
parent
commit
afea0739c6
2 changed files with 10 additions and 10 deletions
  1. 5 5
      rtl/objpas/sysutils/sysstr.inc
  2. 5 5
      rtl/objpas/sysutils/sysstrh.inc

+ 5 - 5
rtl/objpas/sysutils/sysstr.inc

@@ -723,7 +723,7 @@ end ;
 
 {   IntToStr returns a string representing the value of Value    }
 
-function IntToStr(Value: integer): string;
+function IntToStr(Value: Longint): string;
 begin
  System.Str(Value, result);
 end ;
@@ -745,7 +745,7 @@ end ;
 const
    HexDigits: array[0..15] of char = '0123456789ABCDEF';
 
-function IntToHex(Value: integer; Digits: integer): string;
+function IntToHex(Value: Longint; Digits: integer): string;
 var i: integer;
 begin
  If Digits=0 then 
@@ -784,7 +784,7 @@ begin
   result:=IntToHex(Int64(Value),Digits);
 end;
 
-function TryStrToInt(const s: string; out i : integer) : boolean;
+function TryStrToInt(const s: string; out i : Longint) : boolean;
 var Error : word;
 begin
   Val(s, i, Error);
@@ -794,7 +794,7 @@ end;
 {   StrToInt converts the string S to an integer value,
     if S does not represent a valid integer value EConvertError is raised  }
 
-function StrToInt(const S: string): integer;
+function StrToInt(const S: string): Longint;
 var Error: word;
 begin
   Val(S, result, Error);
@@ -836,7 +836,7 @@ end;
 {   StrToIntDef converts the string S to an integer value,
     Default is returned in case S does not represent a valid integer value  }
 
-function StrToIntDef(const S: string; Default: integer): integer;
+function StrToIntDef(const S: string; Default: Longint): Longint;
 var Error: word;
 begin
   Val(S, result, Error);

+ 5 - 5
rtl/objpas/sysutils/sysstrh.inc

@@ -104,19 +104,19 @@ function AnsiExtractQuotedStr(var Src: PChar; Quote: Char): string;
 function AdjustLineBreaks(const S: string): string;
 function AdjustLineBreaks(const S: string; Style: TTextLineBreakStyle): string;
 function IsValidIdent(const Ident: string): boolean;
-function IntToStr(Value: integer): string;
+function IntToStr(Value: Longint): string;
 function IntToStr(Value: Int64): string;
 function IntToStr(Value: QWord): string;
-function IntToHex(Value: integer; Digits: integer): string;
+function IntToHex(Value: Longint; Digits: integer): string;
 function IntToHex(Value: Int64; Digits: integer): string;
 function IntToHex(Value: QWord; Digits: integer): string;
-function StrToInt(const s: string): integer;
-function TryStrToInt(const s: string; Out i : integer) : boolean;
+function StrToInt(const s: string): Longint;
+function TryStrToInt(const s: string; Out i : Longint) : boolean;
 function StrToInt64(const s: string): int64;
 function TryStrToInt64(const s: string; Out i : int64) : boolean;
 function StrToQWord(const s: string): QWord;
 function TryStrToQWord(const s: string; Out Q : QWord) : boolean;
-function StrToIntDef(const S: string; Default: integer): integer;
+function StrToIntDef(const S: string; Default: Longint): Longint;
 function StrToInt64Def(const S: string; Default: int64): int64;
 function StrToQWordDef(const S: string; Default: QWord): QWord;
 function LoadStr(Ident: integer): string;