mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 10:58:06 +02:00
Change CompareChar uses inside compiler/RTL to CompareByte.
This commit is contained in:
parent
0b3d059458
commit
6631f83ccf
@ -1244,7 +1244,7 @@ implementation
|
|||||||
Count:=Count2
|
Count:=Count2
|
||||||
else
|
else
|
||||||
Count:=Count1;
|
Count:=Count1;
|
||||||
result := CompareChar(S1[1],S2[1], Count);
|
result := CompareByte(S1[1],S2[1], Count);
|
||||||
if result=0 then
|
if result=0 then
|
||||||
result:=Count1-Count2;
|
result:=Count1-Count2;
|
||||||
end;
|
end;
|
||||||
|
@ -2980,7 +2980,7 @@ begin
|
|||||||
c:=substr[1];
|
c:=substr[1];
|
||||||
repeat
|
repeat
|
||||||
if (c=pc^) and
|
if (c=pc^) and
|
||||||
(CompareChar(Substr[1],pc^,llen)=0) then
|
(CompareByte(Substr[1],pc^,llen)=0) then
|
||||||
begin
|
begin
|
||||||
rPosex:=pc-pc2+1;
|
rPosex:=pc-pc2+1;
|
||||||
exit;
|
exit;
|
||||||
|
@ -1791,7 +1791,7 @@ function CollectionsEqual(C1, C2: TCollection; Owner1, Owner2: TComponent): Bool
|
|||||||
try
|
try
|
||||||
stream_collection(s1,c1,owner1);
|
stream_collection(s1,c1,owner1);
|
||||||
stream_collection(s2,c2,owner2);
|
stream_collection(s2,c2,owner2);
|
||||||
result:=(s1.size=s2.size) and (CompareChar(s1.memory^,s2.memory^,s1.size)=0);
|
result:=(s1.size=s2.size) and (CompareByte(s1.memory^,s2.memory^,s1.size)=0);
|
||||||
finally
|
finally
|
||||||
s2.free;
|
s2.free;
|
||||||
end;
|
end;
|
||||||
|
@ -489,9 +489,9 @@ begin
|
|||||||
Result:=SameText(System.Copy(Self,NS-L+1,L),AValue)
|
Result:=SameText(System.Copy(Self,NS-L+1,L),AValue)
|
||||||
else
|
else
|
||||||
{$IFDEF IS_SHORTSTRINGHELPER}
|
{$IFDEF IS_SHORTSTRINGHELPER}
|
||||||
Result:=CompareChar(PTStringChar(@Self[1])[NS-L],PTStringChar(@AValue[1])^,L)=0;
|
Result:=CompareByte(PTStringChar(@Self[1])[NS-L],PTStringChar(@AValue[1])^,L*sizeof(TStringChar))=0;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Result:=CompareChar(PTStringChar(Pointer(Self))[NS-L],PTStringChar(Pointer(AValue))^,L)=0;
|
Result:=CompareByte(PTStringChar(Pointer(Self))[NS-L],PTStringChar(Pointer(AValue))^,L*sizeof(TStringChar))=0;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -619,10 +619,10 @@ begin
|
|||||||
Break;
|
Break;
|
||||||
SP:=SP+Ofs+1;
|
SP:=SP+Ofs+1;
|
||||||
{$IFDEF IS_SHORTSTRINGHELPER}
|
{$IFDEF IS_SHORTSTRINGHELPER}
|
||||||
if CompareChar(SP^,PTStringChar(@AValue[1])[1],NV-1)=0 then
|
if CompareByte(SP^,PTStringChar(@AValue[1])[1],(NV-1)*sizeof(TStringChar))=0 then
|
||||||
Exit(SP-PTStringChar(@Self[1])-1);
|
Exit(SP-PTStringChar(@Self[1])-1);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
if CompareChar(SP^,PTStringChar(Pointer(AValue))[1],NV-1)=0 then
|
if CompareByte(SP^,PTStringChar(Pointer(AValue))[1],(NV-1)*sizeof(TStringChar))=0 then
|
||||||
Exit(SP-PTStringChar(Pointer(Self))-1);
|
Exit(SP-PTStringChar(Pointer(Self))-1);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
until false;
|
until false;
|
||||||
@ -1344,9 +1344,9 @@ begin
|
|||||||
Result:=SameText(System.Copy(Self,1,L),AValue)
|
Result:=SameText(System.Copy(Self,1,L),AValue)
|
||||||
else
|
else
|
||||||
{$IFDEF IS_SHORTSTRINGHELPER}
|
{$IFDEF IS_SHORTSTRINGHELPER}
|
||||||
Result:=CompareChar(PTStringChar(@Self[1])^,PTStringChar(@AValue[1])^,L)=0;
|
Result:=CompareByte(PTStringChar(@Self[1])^,PTStringChar(@AValue[1])^,L*sizeof(TStringChar))=0;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Result:=CompareChar(PTStringChar(Pointer(Self))^,PTStringChar(Pointer(AValue))^,L)=0;
|
Result:=CompareByte(PTStringChar(Pointer(Self))^,PTStringChar(Pointer(AValue))^,L*sizeof(TStringChar))=0;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user