IDE: Recognize warning msgs case-insensitively. Eliminate a PChar->String conversion.

This commit is contained in:
Juha 2022-12-04 08:53:37 +02:00
parent 2d30372b6e
commit 24c3a3a248
2 changed files with 5 additions and 11 deletions

View File

@ -1565,14 +1565,12 @@ end;
function TIDEFPCParser.CheckForUnspecificStdErr(p: PChar): boolean;
var
MsgLine: TMessageLine;
s: string;
begin
if not fMsgIsStdErr then exit(false);
Result:=true;
MsgLine:=CreateMsgLine;
MsgLine.SubTool:=SubToolFPC;
s:=p;
if Pos('warning',s)>0 then
if FindSubStrI('warning',p)<>nil then
MsgLine.Urgency:=mluWarning
else
MsgLine.Urgency:=mluError;

View File

@ -114,10 +114,8 @@ begin
if (SubStr='') or (p=nil) then exit;
s:=PChar(SubStr);
while p^<>#0 do begin
if (UpChars[p^]=UpChars[s^]) and CompStrI(SubStr,p) then begin
Result:=p;
exit;
end;
if (UpChars[p^]=UpChars[s^]) and CompStrI(SubStr,p) then
exit(p);
inc(p);
end;
end;
@ -151,10 +149,8 @@ begin
Negated:=false;
while p^ in ['0'..'9'] do begin
i:=i*10+ord(p^)-ord('0');
if (i>High(Result)) then begin
Result:=Default;
exit;
end;
if (i>High(Result)) then
exit(Default);
inc(p);
end;
Result:=i;