diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-12-10 16:32:35 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-12-10 18:24:06 +0100 |
commit | 8babee2c0083c5ec3d3824a6919ef1217eec6c31 (patch) | |
tree | 9a6c817e758a6bf0312e1461c11f68c81f5d7b59 | |
parent | 6ef8524840e7e65775341934e4c67e1fd4a17f7a (diff) | |
download | samba-8babee2c0083c5ec3d3824a6919ef1217eec6c31.tar.gz samba-8babee2c0083c5ec3d3824a6919ef1217eec6c31.tar.bz2 samba-8babee2c0083c5ec3d3824a6919ef1217eec6c31.zip |
pidl:Samba4/Python.pm: don't handle scalar reference types special
The only special thing is that don't need get_value_of(),
all other checks are needed.
metze
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/Python.pm | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 1ed75ae0e1..801c0bf972 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -981,10 +981,6 @@ sub ConvertObjectFromPythonLevel($$$$$$$$) my $nl = GetNextLevel($e, $l); if ($l->{TYPE} eq "POINTER") { - if ($nl->{TYPE} eq "DATA" and Parse::Pidl::Typelist::scalar_is_reference($nl->{DATA_TYPE})) { - $self->ConvertObjectFromPythonLevel($env, $mem_ctx, $py_var, $e, $nl, $var_name, $fail); - return; - } if ($l->{POINTER_TYPE} ne "ref") { $self->pidl("if ($py_var == Py_None) {"); $self->indent; @@ -1000,7 +996,10 @@ sub ConvertObjectFromPythonLevel($$$$$$$$) } else { $self->pidl("$var_name = NULL;"); } - $self->ConvertObjectFromPythonLevel($env, $mem_ctx, $py_var, $e, $nl, get_value_of($var_name), $fail); + unless ($nl->{TYPE} eq "DATA" and Parse::Pidl::Typelist::scalar_is_reference($nl->{DATA_TYPE})) { + $var_name = get_value_of($var_name); + } + $self->ConvertObjectFromPythonLevel($env, $mem_ctx, $py_var, $e, $nl, $var_name, $fail); if ($l->{POINTER_TYPE} ne "ref") { $self->deindent; $self->pidl("}"); @@ -1176,10 +1175,6 @@ sub ConvertObjectToPythonLevel($$$$$$) my $nl = GetNextLevel($e, $l); if ($l->{TYPE} eq "POINTER") { - if ($nl->{TYPE} eq "DATA" and Parse::Pidl::Typelist::scalar_is_reference($nl->{DATA_TYPE})) { - $self->ConvertObjectToPythonLevel($var_name, $env, $e, $nl, $var_name, $py_var, $fail); - return; - } if ($l->{POINTER_TYPE} ne "ref") { $self->pidl("if ($var_name == NULL) {"); $self->indent; @@ -1189,7 +1184,11 @@ sub ConvertObjectToPythonLevel($$$$$$) $self->pidl("} else {"); $self->indent; } - $self->ConvertObjectToPythonLevel($var_name, $env, $e, $nl, get_value_of($var_name), $py_var, $fail); + my $var_name2 = $var_name; + unless ($nl->{TYPE} eq "DATA" and Parse::Pidl::Typelist::scalar_is_reference($nl->{DATA_TYPE})) { + $var_name2 = get_value_of($var_name); + } + $self->ConvertObjectToPythonLevel($var_name, $env, $e, $nl, $var_name2, $py_var, $fail); if ($l->{POINTER_TYPE} ne "ref") { $self->deindent; $self->pidl("}"); |