mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-30 01:31:31 +01:00
merge r17318 from cpstrnew branch by florian:
* compilation fix by Inoussa OUEDRAOGO, resolves #19160 git-svn-id: trunk@19104 -
This commit is contained in:
parent
99dae8b97e
commit
9e0ad7baae
@ -108,6 +108,15 @@ implementation
|
|||||||
{ error recovery }
|
{ error recovery }
|
||||||
consume(_RECKKLAMMER);
|
consume(_RECKKLAMMER);
|
||||||
end
|
end
|
||||||
|
{else
|
||||||
|
begin
|
||||||
|
if (tordconstnode(p).value<=0) then
|
||||||
|
begin
|
||||||
|
Message(parser_e_invalid_string_size);
|
||||||
|
tordconstnode(p).value:=255;
|
||||||
|
end;
|
||||||
|
consume(_RECKKLAMMER);
|
||||||
|
end}
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if (tordconstnode(p).value<=0) then
|
if (tordconstnode(p).value<=0) then
|
||||||
|
|||||||
@ -595,7 +595,7 @@ end;
|
|||||||
{$else VER2_4}
|
{$else VER2_4}
|
||||||
Procedure fpc_AnsiStr_CheckRange(p: Pointer; index: SizeInt);[Public,Alias : 'FPC_ANSISTR_RANGECHECK']; compilerproc;
|
Procedure fpc_AnsiStr_CheckRange(p: Pointer; index: SizeInt);[Public,Alias : 'FPC_ANSISTR_RANGECHECK']; compilerproc;
|
||||||
begin
|
begin
|
||||||
if (p=nil) or (index>PAnsiRec(p-FirstOff)^.Len) or (Index<1) then
|
if (p=nil) or (index>PAnsiRec(p-AnsiFirstOff)^.Len) or (Index<1) then
|
||||||
HandleErrorFrame(201,get_frame);
|
HandleErrorFrame(201,get_frame);
|
||||||
end;
|
end;
|
||||||
{$endif VER2_4}
|
{$endif VER2_4}
|
||||||
@ -1115,7 +1115,7 @@ end;
|
|||||||
Procedure SetString (Out S : AnsiString; Buf : PWideChar; Len : SizeInt);
|
Procedure SetString (Out S : AnsiString; Buf : PWideChar; Len : SizeInt);
|
||||||
begin
|
begin
|
||||||
if (Buf<>nil) and (Len>0) then
|
if (Buf<>nil) and (Len>0) then
|
||||||
widestringmanager.Wide2AnsiMoveProc(Buf,S,Len)
|
widestringmanager.Wide2AnsiMoveProc(Buf,S,DefaultSystemCodePage,Len)
|
||||||
else
|
else
|
||||||
SetLength(S, Len);
|
SetLength(S, Len);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -1371,7 +1371,7 @@ Begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ valid code point -> convert to widestring}
|
{ valid code point -> convert to widestring}
|
||||||
widestringmanager.Ansi2WideMoveProc(@str[0],ws,i+1);
|
widestringmanager.Ansi2WideMoveProc(@str[0],DefaultSystemCodePage,ws,i+1);
|
||||||
{ has to be exactly one widechar }
|
{ has to be exactly one widechar }
|
||||||
if length(ws)=1 then
|
if length(ws)=1 then
|
||||||
begin
|
begin
|
||||||
|
|||||||
@ -1113,9 +1113,9 @@ function DoCompareStringA(P1, P2: PWideChar; L1, L2: PtrUInt; Flags: DWORD): Ptr
|
|||||||
a1, a2: AnsiString;
|
a1, a2: AnsiString;
|
||||||
begin
|
begin
|
||||||
if L1>0 then
|
if L1>0 then
|
||||||
widestringmanager.Wide2AnsiMoveProc(P1,a1,L1);
|
widestringmanager.Wide2AnsiMoveProc(P1,a1,DefaultSystemCodePage,L1);
|
||||||
if L2>0 then
|
if L2>0 then
|
||||||
widestringmanager.Wide2AnsiMoveProc(P2,a2,L2);
|
widestringmanager.Wide2AnsiMoveProc(P2,a2,DefaultSystemCodePage,L2);
|
||||||
SetLastError(0);
|
SetLastError(0);
|
||||||
Result:=CompareStringA(LOCALE_USER_DEFAULT,Flags,pchar(a1),
|
Result:=CompareStringA(LOCALE_USER_DEFAULT,Flags,pchar(a1),
|
||||||
length(a1),pchar(a2),length(a2))-2;
|
length(a1),pchar(a2),length(a2))-2;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user