Permalink
Browse files

try to fix IdemPropNameUSameLen/IdemPropNameU on Android

  • Loading branch information...
Arnaud Bouchez
Arnaud Bouchez committed Jun 25, 2018
1 parent 05aabd9 commit dd58930346fae63248385d4f6c17a95be5c2adf4
Showing with 367 additions and 363 deletions.
  1. +20 −18 SynCommons.pas
  2. +344 −344 SynGSSAPIAuth.pas
  3. +2 −0 SynSelfTests.pas
  4. +1 −1 SynopseCommit.inc
@@ -19663,19 +19663,17 @@ function TSynTempBuffer.InitIncreasing(Count, Start: integer): PIntegerArray;
procedure TSynTempBuffer.Done;
begin
if buf<>@tmp then
if buf<>nil then
FreeMem(buf);
if (buf<>@tmp) and (buf<>nil) then
FreeMem(buf);
end;
procedure TSynTempBuffer.Done(EndBuf: pointer; var Dest: RawUTF8);
begin
if EndBuf=nil then
Dest := '' else
SetString(Dest,PAnsiChar(buf),PAnsiChar(EndBuf)-PAnsiChar(buf));
if buf<>@tmp then
if buf<>nil then
FreeMem(buf);
if (buf<>@tmp) and (buf<>nil) then
FreeMem(buf);
end;
@@ -26442,17 +26440,19 @@ function StrLenSSE2(S: pointer): PtrInt;
function IdemPropNameU(const P1,P2: RawUTF8): boolean;
{$ifdef PUREPASCAL}
var i,L: PtrInt;
var i,j,L: PtrInt;
begin
result := false;
L := length(P1);
if L<>length(P2) then
exit;
for i := 0 to (L shr 2)-1 do
if (PCardinalArray(P1)^[i] xor PCardinalArray(P2)^[i]) and $dfdfdfdf<>0 then
exit;
for i := L-(L and 3) to L-1 do
if (PByteArray(P1)^[i] xor PByteArray(P2)^[i]) and $df<>0 then
j := 0;
for i := 1 to L shr 2 do
if (PCardinalArray(P1)[j] xor PCardinalArray(P2)[j]) and $dfdfdfdf<>0 then
exit else
inc(j);
for i := j*4 to L-1 do
if (PByteArray(P1)[i] xor PByteArray(P2)[i]) and $df<>0 then
exit;
result := true;
end;
@@ -26525,14 +26525,16 @@ function IdemPropNameU(const P1: RawUTF8; P2: PUTF8Char; P2Len: PtrInt): boolean
function IdemPropNameUSameLen(P1,P2: PUTF8Char; P1P2Len: PtrInt): boolean;
{$ifdef PUREPASCAL}
var i: PtrInt;
var i,j: PtrInt;
begin
result := false;
for i := 0 to (P1P2Len shr 2)-1 do
if (PCardinalArray(P1)^[i] xor PCardinalArray(P2)^[i]) and $dfdfdfdf<>0 then
exit;
for i := P1P2Len-(P1P2Len and 3) to P1P2Len-1 do
if (PByteArray(P1)^[i] xor PByteArray(P2)^[i]) and $df<>0 then
j := 0;
for i := 1 to P1P2Len shr 2 do
if (PCardinalArray(P1)[j] xor PCardinalArray(P2)[j]) and $dfdfdfdf<>0 then
exit else
inc(j);
for i := j*4 to P1P2Len-1 do
if (ord(P1[i]) xor ord(P2[i])) and $df<>0 then
exit;
result := true;
end;
Oops, something went wrong.

0 comments on commit dd58930

Please sign in to comment.