Follow-up Comment #4, bug #64360 (project groff): I'd like to propose a small code cleanup.
diff --git a/ChangeLog b/ChangeLog index bc268e1f3..373fab6df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-06-27 G. Branden Robinson <g.branden.robin...@gmail.com> + + * src/devices/gropdf/gropdf.pl: Fix code style nits. Rename + global scalar `gotT` to `t_flg` to align with other similar + flags `w_flg` and `t_flg`. Document these where they are + initialized instead of later in the code. + 2023-06-27 G. Branden Robinson <g.branden.robin...@gmail.com> * src/roff/troff/node.cpp (unbreakable_space_node::tprint): diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl index c65a1051f..074a725c5 100644 --- a/src/devices/gropdf/gropdf.pl +++ b/src/devices/gropdf/gropdf.pl @@ -109,10 +109,10 @@ my $fontchg=0; # font change pending my $tnum=2; # flatness of B-Spline curve my $tden=3; # flatness of B-Spline curve my $linewidth=40; -my $w_flg=0; +my $w_flg=0; # 'w' seen since last 't' my $nomove=0; my $pendmv=0; -my $gotT=0; +my $t_flg=0; # 't' seen since last 'n' my $suppress=0; # Suppress processing? my %incfil; # Included Files my @outlev=([0,undef,0,0]); # Structure pdfmark /OUT entries @@ -130,7 +130,7 @@ my %missing; # fonts in download files which are not found/readable -my $n_flg=1; +my $n_flg=1; # 't' seen since last 'n' my $pginsert=-1; # Growth point for kids array my %pgnames; # 'names' of pages for switchtopage my @outlines=(); # State of Bookmark Outlines at end of each page @@ -374,7 +374,7 @@ while (<>) { $cmd=substr($lin,0,1); $lin=substr($lin,1); - $w_flg=1 if $gotT; + $w_flg=1 if $t_flg; } $lin=~s/^\s+//; @@ -3708,7 +3708,6 @@ sub do_t # $pendmv = 'h' move since last 't' # $nomove = width of char(s) added by 'C', 'N' or 'c' - # $w-flg = 'w' seen since last t if ($fontchg) { @@ -3717,7 +3716,7 @@ sub do_t $stream.="/F$cft $cftsz Tf\n", $fontchg=0 if $fontchg && defined($cft); } - $gotT=1; + $t_flg=1; $stream.="% --- wht=$whtsz, pend=$pendmv, nomv=$nomove\n" if $debug; @@ -3911,7 +3910,7 @@ sub do_N sub do_n { - $gotT=0; + $t_flg=0; PutLine(0); $pendmv=$nomove=0; $n_flg=1; _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?64360> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/