mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:39:22 +02:00
IDE: Recognize warning msgs case-insensitively. Eliminate a PChar->String conversion.
This commit is contained in:
parent
2d30372b6e
commit
24c3a3a248
@ -1565,14 +1565,12 @@ end;
|
|||||||
function TIDEFPCParser.CheckForUnspecificStdErr(p: PChar): boolean;
|
function TIDEFPCParser.CheckForUnspecificStdErr(p: PChar): boolean;
|
||||||
var
|
var
|
||||||
MsgLine: TMessageLine;
|
MsgLine: TMessageLine;
|
||||||
s: string;
|
|
||||||
begin
|
begin
|
||||||
if not fMsgIsStdErr then exit(false);
|
if not fMsgIsStdErr then exit(false);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
MsgLine:=CreateMsgLine;
|
MsgLine:=CreateMsgLine;
|
||||||
MsgLine.SubTool:=SubToolFPC;
|
MsgLine.SubTool:=SubToolFPC;
|
||||||
s:=p;
|
if FindSubStrI('warning',p)<>nil then
|
||||||
if Pos('warning',s)>0 then
|
|
||||||
MsgLine.Urgency:=mluWarning
|
MsgLine.Urgency:=mluWarning
|
||||||
else
|
else
|
||||||
MsgLine.Urgency:=mluError;
|
MsgLine.Urgency:=mluError;
|
||||||
|
@ -114,10 +114,8 @@ begin
|
|||||||
if (SubStr='') or (p=nil) then exit;
|
if (SubStr='') or (p=nil) then exit;
|
||||||
s:=PChar(SubStr);
|
s:=PChar(SubStr);
|
||||||
while p^<>#0 do begin
|
while p^<>#0 do begin
|
||||||
if (UpChars[p^]=UpChars[s^]) and CompStrI(SubStr,p) then begin
|
if (UpChars[p^]=UpChars[s^]) and CompStrI(SubStr,p) then
|
||||||
Result:=p;
|
exit(p);
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
inc(p);
|
inc(p);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -151,10 +149,8 @@ begin
|
|||||||
Negated:=false;
|
Negated:=false;
|
||||||
while p^ in ['0'..'9'] do begin
|
while p^ in ['0'..'9'] do begin
|
||||||
i:=i*10+ord(p^)-ord('0');
|
i:=i*10+ord(p^)-ord('0');
|
||||||
if (i>High(Result)) then begin
|
if (i>High(Result)) then
|
||||||
Result:=Default;
|
exit(Default);
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
inc(p);
|
inc(p);
|
||||||
end;
|
end;
|
||||||
Result:=i;
|
Result:=i;
|
||||||
|
Loading…
Reference in New Issue
Block a user