]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
wireshark-pidl: Reduce Perl strict warnings
authorJohn Thacker <johnthacker@gmail.com>
Sun, 12 Oct 2025 18:56:40 +0000 (14:56 -0400)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 5 Nov 2025 10:08:28 +0000 (10:08 +0000)
From the Wireshark git development branch:

    commit 8dee8601776175a6132bef7ab19f36ee3d589d06
    Author: John Thacker <johnthacker@gmail.com>
    Date:   Wed Oct 8 17:15:56 2025 -0400

        pidl: Use has_property to avoid comparing undef with the empty string

        Prevents a bunch of (harmless) warnings when compiling:

        Use of uninitialized value in string eq at /builds/wireshark/wireshark/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm line 521.

Signed-off-by: John Thacker <johnthacker@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
pidl/lib/Parse/Pidl/Wireshark/NDR.pm

index 78320e8d093c675ba4ff016334a8fe6bfbeff15b..5f374dd914631307aca65698ddcbd7e835e303b2 100644 (file)
@@ -493,7 +493,7 @@ sub Element($$$$$$)
                } else {
                        $moreparam = "";
                }
-               if (($e->{PROPERTIES}->{switch_is} eq "") && ($switchvars{$name}) &&
+               if ((not has_property($e, "switch_is")) && ($switchvars{$name}) &&
                        #not a "native" type
                        (!($type =~ /^uint(8|16|1632|32|3264|64)/))) {
                        $param = $name;