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

git-svn-id: trunk@27067 -
This commit is contained in:
nickysn 2014-03-10 00:33:53 +00:00
parent 9e74fd4d33
commit afea0739c6
2 changed files with 10 additions and 10 deletions

View File

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

View File

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