summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/NDR.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-12 21:21:14 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-12 21:21:14 +0100
commit1b906190091718eb16ea3754c671ebccb78a0b33 (patch)
tree3a82d168b92797c39d443abf0f36f1a2bfae4e5d /source4/pidl/lib/Parse/Pidl/NDR.pm
parent6963e9b90bc1bfa1e370701e792f34fb0c3e6944 (diff)
downloadsamba-1b906190091718eb16ea3754c671ebccb78a0b33.tar.gz
samba-1b906190091718eb16ea3754c671ebccb78a0b33.tar.bz2
samba-1b906190091718eb16ea3754c671ebccb78a0b33.zip
pidl: Remove declare tests, add more tests for typedef.
(This used to be commit 254bf85c2eb69fc2ee22d3a92a6b027a25594250)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/NDR.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/NDR.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm
index 8e7cf40d90..80ecec938a 100644
--- a/source4/pidl/lib/Parse/Pidl/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/NDR.pm
@@ -352,9 +352,11 @@ sub align_type($)
return $scalar_alignment->{$e->{NAME}};
}
+ return 0 if ($e eq "EMPTY");
+
unless (hasType($e)) {
# it must be an external type - all we can do is guess
- # print "Warning: assuming alignment of unknown type '$e' is 4\n";
+ # warning($e, "assuming alignment of unknown type '$e' is 4");
return 4;
}
@@ -367,6 +369,8 @@ sub align_type($)
} elsif ($dt->{TYPE} eq "BITMAP") {
return align_type(Parse::Pidl::Typelist::bitmap_type_fn($dt));
} elsif (($dt->{TYPE} eq "STRUCT") or ($dt->{TYPE} eq "UNION")) {
+ # Struct/union without body: assume 4
+ return 4 unless (defined($dt->{ELEMENTS}));
return find_largest_alignment($dt);
}