r759: Fix some perl warnings.
authorTim Potter <tpot@samba.org>
Mon, 17 May 2004 12:34:17 +0000 (12:34 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:53:49 +0000 (12:53 -0500)
(This used to be commit 1517ef3a986ec213d33b624fbbe8071600cc5b61)

source4/build/pidl/eparser.pm

index 6c6596bf073b0240941533f617df4363fe59ed4e..d3caef6b3cdb318c1624c6703b8dc85d562fb60a 100644 (file)
@@ -490,14 +490,17 @@ sub Parse($)
     my($uuid_version) = "";
     my(@fns) = ();
 
-    foreach my $d (@$idl) {
+    my($d, $e);
+
+    foreach $d (@$idl) {
 
        # Get data from interface definition
 
        $module = $d->{NAME}, if $d->{TYPE} eq "INTERFACE";
 
        if ($d->{TYPE} eq "MODULEHEADER") {
-           $uuid = $d->{PROPERTIES}->{uuid};
+           $uuid = $d->{PROPERTIES}->{uuid}, 
+               if defined($d->{PROPERTIES}->{uuid});
            $uuid_version = $d->{PROPERTIES}->{version};
        }
 
@@ -515,7 +518,7 @@ sub Parse($)
 
                    # Register function fields (parameter names)
 
-                   foreach my $e (@{$d->{DATA}}) {
+                   foreach $e (@{$d->{DATA}}) {
                        AddField($e->{NAME}, $e->{TYPE});
                    }
                }
@@ -529,7 +532,7 @@ sub Parse($)
                    # Register typedef fields (element names)
 
                    if ($d->{DATA}->{TYPE} eq "STRUCT") {
-                       foreach my $e (@{$d->{DATA}->{ELEMENTS}}) {
+                       foreach $e (@{$d->{DATA}->{ELEMENTS}}) {
                            AddField($e->{NAME}, $e->{TYPE});
                        }
                    }
@@ -546,10 +549,10 @@ sub Parse($)
     $res .= EtherealFieldDefinitions();
     $res .= EtherealSubtreeDefinitions($module);
 
-    foreach my $d (@$idl) {
+    foreach $d (@$idl) {
 
        if ($d->{TYPE} eq "INTERFACE") {
-           foreach my $d (@{$d->{DATA}}) {
+           foreach $d (@{$d->{DATA}}) {
 
                # Generate function code fragments
 
@@ -565,10 +568,12 @@ sub Parse($)
 
     $res .= EtherealSubdissectorRegistration($module, \@fns);
 
-    $res .= EtherealUuidRegistration($module, $uuid, $uuid_version);
-    $res .= EtherealModuleRegistration($module,
-                                      EtherealFieldInitialisation($module),
-                                      EtherealSubtreeInitialisation());
+    if ($uuid ne "") {
+       $res .= EtherealUuidRegistration($module, $uuid, $uuid_version);
+       $res .= EtherealModuleRegistration
+           ($module, EtherealFieldInitialisation($module),
+            EtherealSubtreeInitialisation());
+    }
 
     return $res;
 }