From 61e53fd42ac3f84169467eead72671b030d8365c Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Sun, 11 Jun 2023 23:30:18 +0200 Subject: [PATCH] Rename variable called section to _section to avoid parsing error for morphos OS --- packages/chm/src/chmfilewriter.pas | 8 ++++---- packages/chm/src/chmls.lpr | 16 ++++++++-------- packages/chm/src/chmreader.pas | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/chm/src/chmfilewriter.pas b/packages/chm/src/chmfilewriter.pas index 1e8d19b993..7f882697ba 100644 --- a/packages/chm/src/chmfilewriter.pas +++ b/packages/chm/src/chmfilewriter.pas @@ -574,7 +574,7 @@ var Fini : TMemIniFile; // TMemInifile is more compatible with Delphi. Delphi's API based TIniFile fails on .hhp files. secs,strs : TStringList; i,j : Integer; - section : TSectionEnum; + _section : TSectionEnum; nd : TChmContextNode; begin @@ -615,10 +615,10 @@ begin for i:=0 to secs.count-1 do begin - section:=FindSectionName(Uppercase(Secs[i])); - if section<>secunknown then + _section:=FindSectionName(Uppercase(Secs[i])); + if _section<>secunknown then fini.readsectionvalues(secs[i] ,strs); - case section of + case _section of secOptions : readinioptions(strs); secWindows : for j:=0 to strs.count-1 do FWindows.add(TCHMWindow.Create(strs[j])); diff --git a/packages/chm/src/chmls.lpr b/packages/chm/src/chmls.lpr index b3d789eb48..7f9eb5209c 100644 --- a/packages/chm/src/chmls.lpr +++ b/packages/chm/src/chmls.lpr @@ -40,7 +40,7 @@ type { TListObject } TListObject = class - Section : Integer; + _Section : Integer; count : integer; donotpage: boolean; nameonly : boolean; @@ -196,7 +196,7 @@ procedure TListObject.OnFileEntry(Name: String; Offset, UncompressedSize, ASection: Integer); begin Inc(Count); - if (Section > -1) and (ASection <> Section) then Exit; + if (_Section > -1) and (ASection <> _Section) then Exit; if (Count = 1) or ((Count mod 40 = 0) and not donotpage) then begin Write(StdErr, '
'); @@ -274,7 +274,7 @@ end; var donotpage:boolean=false; name_only :boolean=false; -procedure ListChm(Const Name:string;Section:Integer); +procedure ListChm(Const Name:string;_Section:Integer); var ITS: TITSFReader; Stream: TFileStream; @@ -289,7 +289,7 @@ begin Stream := TFileStream.Create(name, fmOpenRead); JunkObject := TListObject.Create; - JunkObject.Section:=Section; + JunkObject._Section:=_Section; JunkObject.Count:=0; JunkObject.DoNotPage:=DoNotPage; JunkObject.NameOnly:=Name_Only; @@ -1002,7 +1002,7 @@ Var Params, OptionIndex : Longint; cmd : TCmdEnum; - section : Integer = -1; + _section : Integer = -1; // Start of program begin @@ -1043,15 +1043,15 @@ begin case cmd of cmdlist : begin case length(localparams) of - 1 : ListChm(localparams[0],Section); + 1 : ListChm(localparams[0],_Section); 2 : begin - if not TryStrToInt(localparams[1],section) then + if not TryStrToInt(localparams[1],_section) then begin writeln(stderr,' Invalid value for section ',localparams[2]); usage; halt(1); end; - ListChm(localparams[0],Section); + ListChm(localparams[0],_Section); end; else WrongNrParam(cmdnames[cmd],length(localparams)); diff --git a/packages/chm/src/chmreader.pas b/packages/chm/src/chmreader.pas index e1f6089cc3..6bb53d1d60 100644 --- a/packages/chm/src/chmreader.pas +++ b/packages/chm/src/chmreader.pas @@ -50,7 +50,7 @@ type end; { TITSFReader } - TFileEntryForEach = procedure(Name: String; Offset, UncompressedSize, Section: Integer) of object; + TFileEntryForEach = procedure(Name: String; Offset, UncompressedSize, _Section: Integer) of object; TITSFReader = class(TObject) protected