summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/NDR.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-02-28 00:19:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:48:58 -0500
commitc1aef15fe7e7a7558b6ede11babc1932263814e6 (patch)
treee0b088f33b3313bedf7aff2060b9d418b313c2e4 /source4/pidl/lib/Parse/Pidl/NDR.pm
parentd7a7b7fb0c423c461c24e8157ad926d0cee07da1 (diff)
downloadsamba-c1aef15fe7e7a7558b6ede11babc1932263814e6.tar.gz
samba-c1aef15fe7e7a7558b6ede11babc1932263814e6.tar.bz2
samba-c1aef15fe7e7a7558b6ede11babc1932263814e6.zip
r21573: Remove more code that assumed all types are typedefs.
(This used to be commit bbbfbfa870c44a6148c3d4d47ff409098e85fcc3)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/NDR.pm')
-rw-r--r--source4/pidl/lib/Parse/Pidl/NDR.pm16
1 files changed, 9 insertions, 7 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm
index 3e45bca1ad..934aba3a02 100644
--- a/source4/pidl/lib/Parse/Pidl/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/NDR.pm
@@ -35,7 +35,7 @@ use vars qw($VERSION);
$VERSION = '0.01';
@ISA = qw(Exporter);
@EXPORT = qw(GetPrevLevel GetNextLevel ContainsDeferred ContainsString);
-@EXPORT_OK = qw(GetElementLevelTable ParseElement ValidElement align_type);
+@EXPORT_OK = qw(GetElementLevelTable ParseElement ValidElement align_type mapToScalar);
use strict;
use Parse::Pidl qw(warning fatal);
@@ -880,17 +880,19 @@ sub ValidProperties($$)
sub mapToScalar($)
{
+ sub mapToScalar($);
my $t = shift;
+ return $t->{NAME} if (ref($t) eq "HASH" and $t->{TYPE} eq "SCALAR");
my $ti = getType($t);
if (not defined ($ti)) {
return undef;
- } elsif ($ti->{DATA}->{TYPE} eq "ENUM") {
- return Parse::Pidl::Typelist::enum_type_fn($ti->{DATA});
- } elsif ($ti->{DATA}->{TYPE} eq "BITMAP") {
- return Parse::Pidl::Typelist::enum_type_fn($ti->{DATA});
- } elsif ($ti->{DATA}->{TYPE} eq "SCALAR") {
- return $t;
+ } elsif ($ti->{TYPE} eq "TYPEDEF") {
+ return mapToScalar($ti->{DATA});
+ } elsif ($ti->{TYPE} eq "ENUM") {
+ return Parse::Pidl::Typelist::enum_type_fn($ti);
+ } elsif ($ti->{TYPE} eq "BITMAP") {
+ return Parse::Pidl::Typelist::bitmap_type_fn($ti);
}
return undef;