Rev 11209: Don't add extra pointer on unique out pointers. in
file:///home/jelmer/bzr.samba/4.0-fixref/
Jelmer Vernooij
jelmer at samba.org
Tue Jan 16 11:28:06 GMT 2007
------------------------------------------------------------
revno: 11209
revision-id: jelmer at samba.org-20070116112756-5af2czzoome1oh1i
parent: svn-v2:20825 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 4.0-fixref
timestamp: Tue 2007-01-16 12:27:56 +0100
message:
Don't add extra pointer on unique out pointers.
modified:
source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm svn-v2:15437 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fpidl%2flib%2fParse%2fPidl%2fSamba3%2fClientNDR.pm
source/pidl/lib/Parse/Pidl/Samba4.pm svn-v2:14488 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fpidl%2flib%2fParse%2fPidl%2fSamba4.pm
=== modified file 'source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm'
--- a/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm 2007-01-05 20:52:12 +0000
+++ b/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm 2007-01-16 11:27:56 +0000
@@ -11,7 +11,7 @@
use Parse::Pidl::Typelist qw(hasType getType mapType scalar_is_reference);
use Parse::Pidl::Util qw(has_property is_constant);
use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred);
-use Parse::Pidl::Samba4 qw(DeclLong_cli IsUniqueOut);
+use Parse::Pidl::Samba4 qw(DeclLong);
use vars qw($VERSION);
$VERSION = '0.01';
@@ -35,7 +35,7 @@
my $ufn = "DCERPC_".uc($fn->{NAME});
foreach (@{$fn->{ELEMENTS}}) {
- $defargs .= ", " . DeclLong_cli($_);
+ $defargs .= ", " . DeclLong($_);
}
fn_declare "NTSTATUS rpccli_$fn->{NAME}(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx$defargs)";
pidl "{";
@@ -47,12 +47,7 @@
foreach (@{$fn->{ELEMENTS}}) {
if (grep(/in/, @{$_->{DIRECTION}})) {
- if ( IsUniqueOut($_) ) {
- pidl "r.in.$_->{NAME} = *$_->{NAME};";
- }
- else {
pidl "r.in.$_->{NAME} = $_->{NAME};";
- }
}
}
@@ -83,8 +78,12 @@
fatal($e, "[out] argument is not a pointer or array") if ($e->{LEVELS}[0]->{TYPE} ne "POINTER" and $e->{LEVELS}[0]->{TYPE} ne "ARRAY");
- if ( IsUniqueOut($e) ) {
- pidl "*$e->{NAME} = r.out.$e->{NAME};";
+ if ( ($e->{LEVELS}[0]->{TYPE} eq "POINTER") && ($e->{LEVELS}[0]->{POINTER_TYPE} eq "unique") ) {
+ pidl "if ( $e->{NAME} ) {";
+ indent;
+ pidl "*$e->{NAME} = *r.out.$e->{NAME};";
+ deindent;
+ pidl "}";
} else {
pidl "*$e->{NAME} = *r.out.$e->{NAME};";
}
=== modified file 'source/pidl/lib/Parse/Pidl/Samba4.pm'
--- a/source/pidl/lib/Parse/Pidl/Samba4.pm 2006-11-19 17:56:35 +0000
+++ b/source/pidl/lib/Parse/Pidl/Samba4.pm 2007-01-16 11:27:56 +0000
@@ -7,7 +7,7 @@
require Exporter;
@ISA = qw(Exporter);
- at EXPORT = qw(is_intree choose_header DeclLong DeclLong_cli IsUniqueOut);
+ at EXPORT = qw(is_intree choose_header DeclLong);
use Parse::Pidl::Util qw(has_property is_constant);
use Parse::Pidl::Typelist qw(mapType scalar_is_reference);
@@ -32,19 +32,9 @@
return "#include <$out>";
}
-sub IsUniqueOut($)
-{
- my ($e) = shift;
-
- return grep(/out/, @{$e->{DIRECTION}}) &&
- ((($e->{LEVELS}[0]->{TYPE} eq "POINTER") &&
- ($e->{LEVELS}[0]->{POINTER_TYPE} eq "unique")) ||
- ($e->{LEVELS}[0]->{TYPE} eq "ARRAY"));
-}
-
-sub DeclLong_int($$)
-{
- my($element,$cli) = @_;
+sub DeclLong($)
+{
+ my($element) = shift;
my $ret = "";
if (has_property($element, "represent_as")) {
@@ -67,9 +57,6 @@
not has_property($element, "charset");
$numstar++;
}
- if ($cli && IsUniqueOut($element)) {
- $numstar++;
- }
$ret.="*" foreach (1..$numstar);
}
$ret.=$element->{NAME};
@@ -81,14 +68,4 @@
return $ret;
}
-sub DeclLong($)
-{
- return DeclLong_int($_, 0);
-}
-
-sub DeclLong_cli($)
-{
- return DeclLong_int($_, 1);
-}
-
1;
More information about the samba-cvs
mailing list