diff options
author | David Mitchell <davem@iabyn.com> | 2022-04-25 16:42:03 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2022-05-04 10:43:03 +0100 |
commit | 5595fe1bed2bdb0a467a1c551d0edaccb29ead2f (patch) | |
tree | 9217902d4378a51b06a66e1313a191e9af721989 /regen/warnings.pl | |
parent | f7b0949de3007d11027dd49ff4a4d32018a21c0a (diff) | |
download | perl-5595fe1bed2bdb0a467a1c551d0edaccb29ead2f.tar.gz |
regen/warnings.pl: better comment what the subs do
Diffstat (limited to 'regen/warnings.pl')
-rw-r--r-- | regen/warnings.pl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/regen/warnings.pl b/regen/warnings.pl index 7a40bb44d1..591a6fc192 100644 --- a/regen/warnings.pl +++ b/regen/warnings.pl @@ -209,8 +209,13 @@ sub orderValues return $index ; } + ########################################################################### +# Recurse the tree and populate +# %CATEGORIES +# %DEFAULTS + sub walk { my $tre = shift ; @@ -238,8 +243,11 @@ sub walk return @list ; } + ########################################################################### +# convert a list like (1,2,3,7,8) into a string like '1..3,7,8' + sub mkRange { my @in = @_ ; @@ -258,7 +266,12 @@ sub mkRange return $out; } + ########################################################################### + +# return a string containing a visual representation of the warnings tree +# structure. + sub warningsTree { my $tre = shift ; @@ -300,8 +313,11 @@ sub warningsTree return $rv; } + ########################################################################### +# common backend for mkHex() and mkOct() + sub mkHexOct { my ($f, $max, @bits) = @_ ; @@ -323,18 +339,24 @@ sub mkHexOct return $string ; } +# Convert a list of bit offsets (0...) into a string containing $max bytes +# of the form "\xMM\xNN...." + sub mkHex { my($max, @bits) = @_; return mkHexOct("x", $max, @bits); } +# Like mkHex(), but outputs "\o..." instead + sub mkOct { my($max, @bits) = @_; return mkHexOct("o", $max, @bits); } + ########################################################################### if (@ARGV && $ARGV[0] eq "tree") |