pidl: Remove support for the declare keyword in other parts of the pidl code.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 12 Jan 2008 00:22:23 +0000 (01:22 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 12 Jan 2008 00:22:23 +0000 (01:22 +0100)
source/pidl/lib/Parse/Pidl/Compat.pm
source/pidl/lib/Parse/Pidl/NDR.pm
source/pidl/lib/Parse/Pidl/Samba4/EJS.pm
source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
source/pidl/lib/Parse/Pidl/Typelist.pm

index f1241ef341c1ed4b7b40d1c04ae3b32ed3ef5e9a..7939bb2df2eb1df32f248a4f70e3ceb802a4644a 100644 (file)
@@ -152,13 +152,6 @@ sub CheckInterface($)
                $if->{PROPERTIES}->{pointer_default_top} ne "ref") {
                warning($if, "pointer_default_top() is pidl-specific");
        }
-
-       foreach my $x (@{$if->{DATA}}) {
-               if ($x->{TYPE} eq "DECLARE") {
-                       warning($if, "the declare keyword is pidl-specific");
-                       next;
-               }
-       }
 }
 
 sub Check($)
index f624d2bdc03ea3791bb865ad164edf18de372e1c..8e7cf40d9026924f24a20008a0c68fc61cb7d4c9 100644 (file)
@@ -287,8 +287,6 @@ sub can_contain_deferred($)
 
        return 0 if (Parse::Pidl::Typelist::is_scalar($type));
 
-       return 1 if ($type->{TYPE} eq "DECLARE"); # assume the worst
-
        return can_contain_deferred($type->{DATA}) if ($type->{TYPE} eq "TYPEDEF");
 
        return 0 unless defined($type->{ELEMENTS});
@@ -362,7 +360,7 @@ sub align_type($)
 
        my $dt = getType($e);
 
-       if ($dt->{TYPE} eq "TYPEDEF" or $dt->{TYPE} eq "DECLARE") {
+       if ($dt->{TYPE} eq "TYPEDEF") {
                return align_type($dt->{DATA});
        } elsif ($dt->{TYPE} eq "ENUM") {
                return align_type(Parse::Pidl::Typelist::enum_type_fn($dt));
@@ -650,7 +648,6 @@ sub ParseInterface($)
        my @consts = ();
        my @functions = ();
        my @endpoints;
-       my @declares = ();
        my $opnum = 0;
        my $version;
 
@@ -667,9 +664,7 @@ sub ParseInterface($)
        }
 
        foreach my $d (@{$idl->{DATA}}) {
-               if ($d->{TYPE} eq "DECLARE") {
-                       push (@declares, $d);
-               } elsif ($d->{TYPE} eq "FUNCTION") {
+               if ($d->{TYPE} eq "FUNCTION") {
                        push (@functions, ParseFunction($idl, $d, \$opnum));
                } elsif ($d->{TYPE} eq "CONST") {
                        push (@consts, ParseConst($idl, $d));
@@ -701,7 +696,6 @@ sub ParseInterface($)
                FUNCTIONS => \@functions,
                CONSTS => \@consts,
                TYPES => \@types,
-               DECLARES => \@declares,
                ENDPOINTS => \@endpoints
        };
 }
index 36cc469ff6425787929a9c5d8a67415db3ee5a68..fa0c97961c738f32b0eae0fd9288b68fd1926b01 100644 (file)
@@ -860,7 +860,7 @@ sub TypeFunctionName($$)
        my ($prefix, $t) = @_;
 
        return "$prefix\_$t->{NAME}" if (ref($t) eq "HASH" and 
-                       ($t->{TYPE} eq "TYPEDEF" or $t->{TYPE} eq "DECLARE"));
+                       $t->{TYPE} eq "TYPEDEF");
        return "$prefix\_$t->{TYPE}_$t->{NAME}" if (ref($t) eq "HASH");
        return "$prefix\_$t";
 }
index a261910c17533a50491837aa4cc96472d469f30a..abbfe2259b5290fd1b4bae088a81587f3f22d4e3 100644 (file)
@@ -2723,7 +2723,7 @@ sub TypeFunctionName($$)
        my ($prefix, $t) = @_;
 
        return "$prefix\_$t->{NAME}" if (ref($t) eq "HASH" and 
-                       ($t->{TYPE} eq "TYPEDEF" or $t->{TYPE} eq "DECLARE"));
+                       $t->{TYPE} eq "TYPEDEF");
        return "$prefix\_$t->{TYPE}_$t->{NAME}" if (ref($t) eq "HASH");
        return "$prefix\_$t";
 }
index b2069c784b538ff6641e0b23ea491781c6e5afb9..8fb7448070af02d6b0fe3a1ab0881262298395f8 100644 (file)
@@ -138,8 +138,7 @@ sub is_scalar($)
        return 1 if (ref($type) eq "HASH" and $type->{TYPE} eq "SCALAR");
 
        if (my $dt = getType($type)) {
-               return is_scalar($dt->{DATA}) if ($dt->{TYPE} eq "TYPEDEF" or 
-                                                 $dt->{TYPE} eq "DECLARE");
+               return is_scalar($dt->{DATA}) if ($dt->{TYPE} eq "TYPEDEF");
                return 1 if ($dt->{TYPE} eq "SCALAR" or $dt->{TYPE} eq "ENUM" or 
                                 $dt->{TYPE} eq "BITMAP");
        }
@@ -214,7 +213,6 @@ sub mapType($$)
        my ($t, $n) = @_;
 
        return mapType($t->{DATA}, $n) if ($t->{TYPE} eq "TYPEDEF");
-       return mapType($t->{DATA}, $n) if ($t->{TYPE} eq "DECLARE");
        return mapScalarType($n) if ($t->{TYPE} eq "SCALAR");
        return "enum $n" if ($t->{TYPE} eq "ENUM");
        return "struct $n" if ($t->{TYPE} eq "STRUCT");
@@ -248,7 +246,6 @@ sub LoadIdl($)
                foreach my $y (@{$x->{DATA}}) {
                        addType($y) if (
                                $y->{TYPE} eq "TYPEDEF" 
-                            or $y->{TYPE} eq "DECLARE" 
                                 or $y->{TYPE} eq "UNION"
                                 or $y->{TYPE} eq "STRUCT"
                         or $y->{TYPE} eq "ENUM"