From cd66ac596bb0795ad5f6b0de71302c2ab9a79321 Mon Sep 17 00:00:00 2001 From: Juha Date: Tue, 19 Oct 2021 23:17:45 +0300 Subject: [PATCH] Formatting, minor simplification. --- components/lazutils/lazfileutils.pas | 15 +++------------ ide/buildmanager.pas | 3 +-- ide/compileroptions.pp | 23 +++++++++-------------- 3 files changed, 13 insertions(+), 28 deletions(-) diff --git a/components/lazutils/lazfileutils.pas b/components/lazutils/lazfileutils.pas index 8cda46a252..e7935669d5 100644 --- a/components/lazutils/lazfileutils.pas +++ b/components/lazutils/lazfileutils.pas @@ -1541,20 +1541,11 @@ var begin Result:=Option; if (Result='') or (Result[1] in ['"','''']) then exit; - for i:=1 to length(Result) do begin + for i:=1 to length(Result) do case Result[i] of - ' ','''': - begin - Result:=AnsiQuotedStr(Result,'"'); - exit; - end; - '"': - begin - Result:=AnsiQuotedStr(Result,''''); - exit; - end; + ' ','''': exit(AnsiQuotedStr(Result,'"')); + '"': exit(AnsiQuotedStr(Result,'''')); end; - end; end; { function AddCmdLineParameter(const CmdLine, AddParameter: string): string; diff --git a/ide/buildmanager.pas b/ide/buildmanager.pas index 288c85dede..72e32479f8 100644 --- a/ide/buildmanager.pas +++ b/ide/buildmanager.pas @@ -2807,9 +2807,8 @@ procedure TBuildManager.SetBuildTarget(const TargetOS, TargetCPU, begin if OverrideLCLWidgetType<>'' then Result:=OverrideLCLWidgetType - else if FBuildTarget<>nil then begin + else if FBuildTarget<>nil then Result:=FBuildTarget.CompilerOptions.GetEffectiveLCLWidgetType - end else Result:=''; if (Result='') or (SysUtils.CompareText(Result,'default')=0) then diff --git a/ide/compileroptions.pp b/ide/compileroptions.pp index 5889d45cc3..53c31b12bf 100644 --- a/ide/compileroptions.pp +++ b/ide/compileroptions.pp @@ -475,7 +475,7 @@ type procedure SetAlternativeCompile(const Command: string; ScanFPCMsgs: boolean); override; - function MakeOptionsString(Flags: TCompilerCmdLineOptions): String; virtual; + function MakeOptionsString(Flags: TCompilerCmdLineOptions): String; function GetSyntaxOptionsString(Kind: TPascalCompiler): string; virtual; function CreatePPUFilename(const SourceFileName: string): string; override; function CreateTargetFilename: string; override; @@ -653,7 +653,7 @@ function InheritedOptionsToCompilerParameters( Flags: TCompilerCmdLineOptions): string; function MergeLinkerOptions(const OldOptions, AddOptions: string): string; function MergeCustomOptions(const OldOptions, AddOptions: string): string; -function ConvertSearchPathToCmdLine(const switch, paths: String): String; +function ConvertSearchPathToCmdLine(const Switch, Paths: String): String; function ConvertOptionsToCmdLine(const Switch, OptionStr: string): string; type @@ -901,8 +901,7 @@ begin Result+=AddOptions; end; -function ConvertSearchPathToCmdLine( - const Switch, Paths: String): String; +function ConvertSearchPathToCmdLine(const Switch, Paths: String): String; var StartPos: Integer; l: Integer; @@ -912,7 +911,6 @@ begin RaiseGDBException('ConvertSearchPathToCmdLine no Switch'); Result := ''; if (Paths = '') then exit; - l:=length(Paths); StartPos:=1; while StartPos<=l do begin @@ -929,9 +927,9 @@ begin end; end; -function ConvertOptionsToCmdLine(const Switch, - OptionStr: string): string; -var Startpos, EndPos: integer; +function ConvertOptionsToCmdLine(const Switch, OptionStr: string): string; +var + Startpos, EndPos: integer; p: Integer; begin Result:=''; @@ -1011,8 +1009,7 @@ begin FTree:=Tree; end; -function TCompilerMsgIDFlagsEnumerator. - GetEnumerator: TCompilerMsgIDFlagsEnumerator; +function TCompilerMsgIDFlagsEnumerator.GetEnumerator: TCompilerMsgIDFlagsEnumerator; begin Result:=Self; end; @@ -3226,8 +3223,7 @@ begin Result := switches; end; -function TBaseCompilerOptions.GetSyntaxOptionsString(Kind: TPascalCompiler - ): string; +function TBaseCompilerOptions.GetSyntaxOptionsString(Kind: TPascalCompiler): string; var tempsw: String; begin @@ -3264,8 +3260,7 @@ begin end; end; -function TBaseCompilerOptions.CreatePPUFilename(const SourceFileName: string - ): string; +function TBaseCompilerOptions.CreatePPUFilename(const SourceFileName: string): string; var UnitOutDir: String; begin