diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-12-27 15:36:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:30:15 -0500 |
commit | 3c20e210de357e4f7b6dd54880110a56ae1d7eb0 (patch) | |
tree | 216e9498616a3d1acc3ba99a6b306b34333114ce /source4 | |
parent | 1757c0f0a44a2db80d39b7a3eddf48575a4faeae (diff) | |
download | samba-3c20e210de357e4f7b6dd54880110a56ae1d7eb0.tar.gz samba-3c20e210de357e4f7b6dd54880110a56ae1d7eb0.tar.bz2 samba-3c20e210de357e4f7b6dd54880110a56ae1d7eb0.zip |
r20358: - fix ejs generated code for ipv4address
- (not Parse::Pidl::Typelist::scalar_is_reference($e->{TYPE}))
is much more generic than ($e->{TYPE} ne "string")
and handles ipv4address and other special types...
metze
(This used to be commit 02d2ce65e614a0c99ef3246bc738eb0f8d91b24a)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/EJS.pm | 7 | ||||
-rw-r--r-- | source4/scripting/ejs/ejsrpc.c | 4 | ||||
-rw-r--r-- | source4/scripting/ejs/ejsrpc.h | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/EJS.pm b/source4/pidl/lib/Parse/Pidl/Samba4/EJS.pm index 960f610cd9..f820dbbc5a 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/EJS.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/EJS.pm @@ -153,7 +153,8 @@ sub EjsPullScalar($$$$$) my $pl = Parse::Pidl::NDR::GetPrevLevel($e, $l); $var = get_pointer_to($var); # have to handle strings specially :( - if ($e->{TYPE} eq "string" && $pl && $pl->{TYPE} eq "POINTER") { + if (Parse::Pidl::Typelist::scalar_is_reference($e->{TYPE}) + and (defined($pl) and $pl->{TYPE} eq "POINTER")) { $var = get_pointer_to($var); } pidl "NDR_CHECK(ejs_pull_$e->{TYPE}(ejs, v, $name, $var));"; @@ -445,7 +446,9 @@ sub EjsPushScalar($$$$$) my ($e, $l, $var, $name, $env) = @_; # have to handle strings specially :( my $pl = Parse::Pidl::NDR::GetPrevLevel($e, $l); - if ($e->{TYPE} ne "string" || ($pl && $pl->{TYPE} eq "POINTER")) { + + if ((not Parse::Pidl::Typelist::scalar_is_reference($e->{TYPE})) + or (defined($pl) and $pl->{TYPE} eq "POINTER")) { $var = get_pointer_to($var); } pidl "NDR_CHECK(ejs_push_$e->{TYPE}(ejs, v, $name, $var));"; diff --git a/source4/scripting/ejs/ejsrpc.c b/source4/scripting/ejs/ejsrpc.c index c41cdd972b..fa5d880a1c 100644 --- a/source4/scripting/ejs/ejsrpc.c +++ b/source4/scripting/ejs/ejsrpc.c @@ -267,9 +267,9 @@ NTSTATUS ejs_pull_ipv4address(struct ejs_rpc *ejs, push a ipv4address (internally a string) */ NTSTATUS ejs_push_ipv4address(struct ejs_rpc *ejs, - struct MprVar *v, const char *name, char * const *s) + struct MprVar *v, const char *name, const char *s) { - return ejs_push_string(ejs, v, name, *s); + return ejs_push_string(ejs, v, name, s); } diff --git a/source4/scripting/ejs/ejsrpc.h b/source4/scripting/ejs/ejsrpc.h index 7288042120..e4be242c91 100644 --- a/source4/scripting/ejs/ejsrpc.h +++ b/source4/scripting/ejs/ejsrpc.h @@ -96,7 +96,7 @@ NTSTATUS ejs_push_string(struct ejs_rpc *ejs, NTSTATUS ejs_pull_ipv4address(struct ejs_rpc *ejs, struct MprVar *v, const char *name, const char **s); NTSTATUS ejs_push_ipv4address(struct ejs_rpc *ejs, - struct MprVar *v, const char *name, char * const *s); + struct MprVar *v, const char *name, const char *s); void ejs_set_constant_int(int eid, const char *name, int value); void ejs_set_constant_string(int eid, const char *name, const char *value); |