View Issue Details

IDProjectCategoryView StatusLast Update
0034285FPCUtilitiespublic2019-10-06 12:37
ReporterBart BroersmaAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindowsOS Version10
Product Version3.3.1Product Build 
Target VersionFixed in Version3.3.1 
Summary0034285: ptop: silence hint about unused parameter
DescriptionIf you build ptop, you'll get a hint about procedure RShiftIndent, parameter currmsym not used.
The paramter is only used when debug is defined.
I ifdef'ed the paramter list.
TagsNo tags attached.
Fixed in Revision43137
FPCOldBugId
FPCTarget3.2.0
Attached Files
  • ptop2.diff (1,152 bytes)
    Index: utils/ptopu.pp
    ===================================================================
    --- utils/ptopu.pp	(revision 39352)
    +++ utils/ptopu.pp	(working copy)
    @@ -190,7 +190,7 @@
         Procedure PPSymbol;
         Procedure Gobble(terminators: keysymset);
         Procedure RShift(currmsym: keysymbol);
    -    Procedure RShiftIndent(currmsym: keysymbol);
    +    Procedure RShiftIndent{$ifdef debug}(currmsym: keysymbol){$endif debug};
         Function ReadConfigFile: Boolean;
       Public
         Constructor Create;
    @@ -959,7 +959,7 @@
     {$endif debug}
       END; { of RShift }
     
    -Procedure TprettyPrinter.RShiftIndent(currmsym: keysymbol);
    +Procedure TprettyPrinter.RShiftIndent{$ifdef debug}(currmsym: keysymbol){$endif debug};
       { Move right, stacking margin positions }
       BEGIN
     {$ifdef debug}
    @@ -1384,7 +1384,7 @@
         IF inbytab IN sets^.selected THEN
           RShift(currsym^.name)
         else IF inbyindent IN sets^.selected THEN
    -      RShiftIndent(currsym^.name);
    +      RShiftIndent{$ifdef debug}(currsym^.name){$endif debug};
         IF gobsym IN sets^.selected THEN Gobble(sets^.terminators);
         IF crafter IN sets^.selected THEN CrPending := TRUE
       END;
    
    ptop2.diff (1,152 bytes)

Activities

Bart Broersma

2018-09-15 19:33

reporter  

ptop2.diff (1,152 bytes)
Index: utils/ptopu.pp
===================================================================
--- utils/ptopu.pp	(revision 39352)
+++ utils/ptopu.pp	(working copy)
@@ -190,7 +190,7 @@
     Procedure PPSymbol;
     Procedure Gobble(terminators: keysymset);
     Procedure RShift(currmsym: keysymbol);
-    Procedure RShiftIndent(currmsym: keysymbol);
+    Procedure RShiftIndent{$ifdef debug}(currmsym: keysymbol){$endif debug};
     Function ReadConfigFile: Boolean;
   Public
     Constructor Create;
@@ -959,7 +959,7 @@
 {$endif debug}
   END; { of RShift }
 
-Procedure TprettyPrinter.RShiftIndent(currmsym: keysymbol);
+Procedure TprettyPrinter.RShiftIndent{$ifdef debug}(currmsym: keysymbol){$endif debug};
   { Move right, stacking margin positions }
   BEGIN
 {$ifdef debug}
@@ -1384,7 +1384,7 @@
     IF inbytab IN sets^.selected THEN
       RShift(currsym^.name)
     else IF inbyindent IN sets^.selected THEN
-      RShiftIndent(currsym^.name);
+      RShiftIndent{$ifdef debug}(currsym^.name){$endif debug};
     IF gobsym IN sets^.selected THEN Gobble(sets^.terminators);
     IF crafter IN sets^.selected THEN CrPending := TRUE
   END;
ptop2.diff (1,152 bytes)

Bart Broersma

2019-10-04 17:36

reporter   ~0118328

Some feedback on this trivial patch would be nice.

Thaddy de Koning

2019-10-06 07:25

reporter   ~0118361

An alternative to do it like this:
implementation section only:
{$push}{$warn 5024 off}
Procedure TprettyPrinter.RShiftIndent(currmsym: keysymbol);
{$pop}

That's a bit shorter and looks cleaner.
But the patch works correct.

Thaddy de Koning

2019-10-06 07:32

reporter   ~0118362

Or maybe even with a comment:
{$push}{$warn 5024 off : currmsym is currently only used for debugging}
Procedure TprettyPrinter.RShiftIndent(currmsym: keysymbol);
{$pop}

Michael Van Canneyt

2019-10-06 09:51

administrator   ~0118364

Checked & applied. Thank you very much !

Bart, I will repeat my invitation: if you see you don't get a reply within a reasonable time, please feel free to mail me personally.
If the bugreport didn't jump to the top of the 'recently changed' list, I would not have noticed it...

Bart Broersma

2019-10-06 12:37

reporter   ~0118370

OK, thanks.

Issue History

Date Modified Username Field Change
2018-09-15 19:33 Bart Broersma New Issue
2018-09-15 19:33 Bart Broersma File Added: ptop2.diff
2019-10-04 17:36 Bart Broersma Note Added: 0118328
2019-10-06 07:25 Thaddy de Koning Note Added: 0118361
2019-10-06 07:32 Thaddy de Koning Note Added: 0118362
2019-10-06 09:51 Michael Van Canneyt Assigned To => Michael Van Canneyt
2019-10-06 09:51 Michael Van Canneyt Status new => resolved
2019-10-06 09:51 Michael Van Canneyt Resolution open => fixed
2019-10-06 09:51 Michael Van Canneyt Fixed in Version => 3.3.1
2019-10-06 09:51 Michael Van Canneyt Fixed in Revision => 43137
2019-10-06 09:51 Michael Van Canneyt FPCTarget => 3.2.0
2019-10-06 09:51 Michael Van Canneyt Note Added: 0118364
2019-10-06 12:37 Bart Broersma Status resolved => closed
2019-10-06 12:37 Bart Broersma Note Added: 0118370