svn commit: samba r5709 - in branches/SAMBA_4_0/source/build/pidl: .

jelmer at samba.org jelmer at samba.org
Wed Mar 9 15:39:55 GMT 2005


Author: jelmer
Date: 2005-03-09 15:39:55 +0000 (Wed, 09 Mar 2005)
New Revision: 5709

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5709

Log:
Leave out the pull/push call with NDR_BUFFERS for not just 
scalars but also for structs/unions containing only scalars. 

Modified:
   branches/SAMBA_4_0/source/build/pidl/ndr.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/ndr.pm
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/ndr.pm	2005-03-09 15:22:06 UTC (rev 5708)
+++ branches/SAMBA_4_0/source/build/pidl/ndr.pm	2005-03-09 15:39:55 UTC (rev 5709)
@@ -171,8 +171,7 @@
 sub need_buffers_section($)
 {
 	my $e = shift;
-	if ((is_scalar_type($e->{TYPE}) || util::has_property($e, "subcontext")) &&
-	    $e->{POINTERS} == 0 && 
+	if (!can_contain_deferred($e) &&
 	    !util::array_size($e)) {
 		return 0;
 	}
@@ -408,6 +407,26 @@
 }
 
 #####################################################################
+# see if a type contains any deferred data 
+sub can_contain_deferred
+{
+	my $e = shift;
+
+	return 1 if ($e->{POINTERS});
+	return 0 if (is_scalar_type($e->{TYPE}));
+	return 0 if (util::has_property($e, "subcontext"));
+	return 1 unless (typelist::hasType($e->{TYPE})); # assume the worst
+
+	my $type = typelist::getType($e->{TYPE});
+
+	foreach my $x (@{$type->{DATA}->{ELEMENTS}}) {
+		return 1 if (can_contain_deferred ($x));
+	}
+	
+	return 0;
+}
+
+#####################################################################
 # parse array preceding data - push side
 sub ParseArrayPushPreceding($$$)
 {



More information about the samba-cvs mailing list