summaryrefslogtreecommitdiff
path: root/source4/build/pidl/ndr.pm
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-05-30 00:19:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:14 -0500
commit89a17e60a14783e8560d3babc8a9a328adc3c94c (patch)
tree7aaa93cd78bb26f76618eab8cf79a04e1fc28633 /source4/build/pidl/ndr.pm
parent4f1a5b716972bc2af916a528399c9dc0c2f18c35 (diff)
downloadsamba-89a17e60a14783e8560d3babc8a9a328adc3c94c.tar.gz
samba-89a17e60a14783e8560d3babc8a9a328adc3c94c.tar.bz2
samba-89a17e60a14783e8560d3babc8a9a328adc3c94c.zip
r7084: - readd the work from rev 6516,6517,6572
- use a single list of scalars - let "string" not be so special anymore - fix support for "string_array" metze (This used to be commit e1fa7ae6c8420dc582578e084b9c0d641bcfbd73)
Diffstat (limited to 'source4/build/pidl/ndr.pm')
-rw-r--r--source4/build/pidl/ndr.pm50
1 files changed, 4 insertions, 46 deletions
diff --git a/source4/build/pidl/ndr.pm b/source4/build/pidl/ndr.pm
index 98e3d2b4bc..aa1a557dd1 100644
--- a/source4/build/pidl/ndr.pm
+++ b/source4/build/pidl/ndr.pm
@@ -177,7 +177,7 @@ sub can_contain_deferred
my $e = shift;
return 1 if ($e->{POINTERS});
- return 0 if (is_scalar_type($e->{TYPE}));
+ return 0 if (typelist::is_scalar($e->{TYPE}));
return 0 if (util::has_property($e, "subcontext"));
return 1 unless (typelist::hasType($e->{TYPE})); # assume the worst
@@ -190,19 +190,6 @@ sub can_contain_deferred
return 0;
}
-sub is_scalar_type($)
-{
- my $type = shift;
-
- return 0 unless(typelist::hasType($type));
-
- if (my $dt = typelist::getType($type)->{DATA}->{TYPE}) {
- return 1 if ($dt eq "SCALAR" or $dt eq "ENUM" or $dt eq "BITMAP");
- }
-
- return 0;
-}
-
sub pointer_type($)
{
my $e = shift;
@@ -252,35 +239,6 @@ sub find_largest_alignment($)
return $align;
}
-my %scalar_alignments =
-(
- "char" => 1,
- "int8" => 1,
- "uint8" => 1,
- "short" => 2,
- "wchar_t" => 2,
- "int16" => 2,
- "uint16" => 2,
- "long" => 4,
- "int32" => 4,
- "uint32" => 4,
- "dlong" => 4,
- "udlong" => 4,
- "udlongr" => 4,
- "NTTIME" => 4,
- "NTTIME_1sec" => 4,
- "time_t" => 4,
- "DATA_BLOB" => 4,
- "error_status_t" => 4,
- "WERROR" => 4,
- "NTSTATUS" => 4,
- "boolean32" => 4,
- "unsigned32" => 4,
- "ipv4address" => 4,
- "hyper" => 8,
- "NTTIME_hyper" => 8
-);
-
#####################################################################
# align a type
sub align_type
@@ -302,10 +260,10 @@ sub align_type
} elsif (($dt->{TYPE} eq "STRUCT") or ($dt->{TYPE} eq "UNION")) {
return find_largest_alignment($dt);
} elsif ($dt->{TYPE} eq "SCALAR") {
- return $scalar_alignments{$dt->{NAME}};
- } else {
- die("Unknown data type type $dt->{TYPE}");
+ return typelist::getScalarAlignment($dt->{NAME});
}
+
+ die("Unknown data type type $dt->{TYPE}");
}
# determine if an element needs a reference pointer on the wire