]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pidl: Wireshark: Don't assign hash undef, assign it an empty array
authorJohn Thacker <johnthacker@gmail.com>
Wed, 3 Jul 2024 12:00:59 +0000 (08:00 -0400)
committerStefan Metzmacher <metze@samba.org>
Fri, 12 Jul 2024 09:59:32 +0000 (09:59 +0000)
Pick up change from Wireshark:

    commit ade6577f109e2bf741909226254b758e79a816f1
    Author: John Thacker <johnthacker@gmail.com>
    Date:   Fri Jun 21 20:27:51 2024 -0400

        pidl: Don't assign hash undef, assign it an empty array

        Perl works, but complains if warnings are on, if a hash is
        initialized to undef instead of to empty. Upstream Samba turned on
        warnings in the next commit to catch things like this.

Signed-off-by: John Thacker <johnthacker@gmail.com>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
pidl/lib/Parse/Pidl/Wireshark/NDR.pm

index fef98db8abdce7412cd2b40fb11aa59fdb285576..ee28e8a7c36e1d5e82629811730f847d1eacef47 100644 (file)
@@ -584,7 +584,7 @@ sub Function($$$)
        my %dissectornames;
 
        foreach (@{$fn->{ELEMENTS}}) {
-           $dissectornames{$_->{NAME}} = $self->Element($_, $fn->{NAME}, $ifname, undef, undef) if not defined($dissectornames{$_->{NAME}});
+           $dissectornames{$_->{NAME}} = $self->Element($_, $fn->{NAME}, $ifname, undef, ()) if not defined($dissectornames{$_->{NAME}});
        }
 
        my $fn_name = $_->{NAME};
@@ -814,7 +814,7 @@ sub Union($$$$)
        foreach (@{$e->{ELEMENTS}}) {
                $res.="\n\t\t$_->{CASE}:\n";
                if ($_->{TYPE} ne "EMPTY") {
-                       $res.="\t\t\t".$self->Element($_, $name, $ifname, undef, undef)."\n";
+                       $res.="\t\t\t".$self->Element($_, $name, $ifname, undef, ())."\n";
                }
                $res.="\t\tbreak;\n";
        }