util/find-doc-nits: Modernise printem()
authorRichard Levitte <levitte@openssl.org>
Wed, 17 Jun 2020 20:04:53 +0000 (22:04 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 22 Jun 2020 21:47:11 +0000 (23:47 +0200)
It wasn't up to date with the new variables used to track information
on what's documented, what's in the .num files and what's in the
"missing" files.

Fixes #12117

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12125)

util/find-doc-nits

index 389e3da0606c929f6df4ad3d25bb7d45b064e442..a54d75458ca6754c3c2ef67a59f1bc9e3683260e 100755 (executable)
@@ -865,21 +865,14 @@ sub checkmacros {
 sub printem ($) {
     my $type = shift;
     my $count = 0;
 sub printem ($) {
     my $type = shift;
     my $count = 0;
-    my %seen;
-
-    foreach my $func ( grep { $_ eq $type } sort keys %state ) {
-        $func .= '(3)';         # We know they're all in section 3
-
-        # Skip functions known to be missing
-        next if $opt_v && defined $name_map{$func} && $name_map{$func} eq '';
 
 
-        # Skip known names
-        next if defined $name_map{$func} || defined $seen{$func};
+    foreach my $func ( grep { $state{$_} eq $type } sort keys %state ) {
+        next if defined $name_map{$func}
+            || defined $missing{$func};
 
         err("$type:", "function $func undocumented")
             if $opt_d || $opt_e;
         $count++;
 
         err("$type:", "function $func undocumented")
             if $opt_d || $opt_e;
         $count++;
-        $seen{$func} = 1;
     }
     err("# $count lib$type names are not documented")
         if $count > 0;
     }
     err("# $count lib$type names are not documented")
         if $count > 0;
@@ -906,7 +899,7 @@ sub collectnames {
         my $name_sec = "$name($section)";
         if ( !defined $name_map{$name_sec} ) {
             $name_map{$name_sec} = $filename;
         my $name_sec = "$name($section)";
         if ( !defined $name_map{$name_sec} ) {
             $name_map{$name_sec} = $filename;
-            $state{$name_sec} =
+            $state{$name_sec} //=
                 ( $filename =~ /\/internal\// ? 'internal' : 'public' )
                 if $is_generic;
         } elsif ( $filename eq $name_map{$name_sec} ) {
                 ( $filename =~ /\/internal\// ? 'internal' : 'public' )
                 if $is_generic;
         } elsif ( $filename eq $name_map{$name_sec} ) {