rtl: clean up

This commit is contained in:
mattias 2020-05-06 17:42:44 +00:00
parent 726d0d3b3d
commit 1bf007ef13
2 changed files with 10 additions and 6 deletions

View File

@ -365,7 +365,7 @@ function Pos(const Search, InString: String; StartAt : Integer): Integer; assemb
procedure Insert(const Insertion: String; var Target: String; Index: Integer); overload;
function upcase(c : char) : char; assembler;
function HexStr(Val: NativeInt; cnt: byte): string; external name 'rtl.hexStr'; overload;
function binstr(val : int64; cnt : byte) : string;
function binstr(val : NativeUInt; cnt : byte) : string;
procedure val(const S: String; out NI : NativeInt; out Code: Integer); overload;
procedure val(const S: String; out NI : NativeUInt; out Code: Integer); overload;
@ -716,7 +716,7 @@ begin
Code:=1;
end;
function binstr(val : int64;cnt : byte) : string;
function binstr(val : NativeUInt;cnt : byte) : string;
var
i : Integer;
begin

View File

@ -2309,7 +2309,7 @@ Var ChPos,OldPos,ArgPos,DoArg,Len : SizeInt;
If Fmt[ChPos]='*' then
begin
if Index=-1 then
if Index=High(byte) then
ArgN:=Argpos
else
begin
@ -2395,7 +2395,7 @@ Var ChPos,OldPos,ArgPos,DoArg,Len : SizeInt;
begin
Index:=-1;
Index:=High(byte);
Width:=-1;
Prec:=-1;
Value:=-1;
@ -4499,8 +4499,11 @@ function IntToHex(Value: NativeInt; Digits: integer): string;
begin
// Result:=HexStr(Value,Digits); // TestNegLongintHelper Failed: "ToHexString" expected: <FFFE0000> but was: <00-20000> !
Result:='';
if Value<0 then
asm
if (Value<0) Value = 0xFFFFFFFF + Value + 1;
end;
asm
if (Value<0) Value = 0xFFFFFFFF + Value + 1;
Result=Value.toString(16);
end;
Result:=UpperCase(Result);
@ -6274,7 +6277,8 @@ Var
Result:=S.IndexOfAnyUnQuoted(Separators,AQuoteStart,AQuoteEnd,StartIndex,Match)
else
// MVC todo:
Result:=-1; // S.IndexOfAny(Separators,StartIndex,Length,Match);
//Result:=-1;
Result:=S.IndexOfAny(Separators,StartIndex,Length,Match);
end;
Procedure MaybeGrow(Curlen : SizeInt);