diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-14 20:09:18 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-01-14 20:09:18 +0100 |
commit | 1530d7c3b0d02a2b75c1ee393209f69473f3c4af (patch) | |
tree | d90f1812197b0800187dabe070ba3ec52b3a7957 /source4/pidl/lib/Parse | |
parent | 506f6432882804ed62fd3b8c1ddc2a4ac80fa08d (diff) | |
download | samba-1530d7c3b0d02a2b75c1ee393209f69473f3c4af.tar.gz samba-1530d7c3b0d02a2b75c1ee393209f69473f3c4af.tar.bz2 samba-1530d7c3b0d02a2b75c1ee393209f69473f3c4af.zip |
python: Fix handling of pointer-less strings in function arguments.
(This used to be commit cb2700094fc1fc3887d5254e5d42e035deefa5b9)
Diffstat (limited to 'source4/pidl/lib/Parse')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/Python.pm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm index 31b06d16b8..2475925377 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -642,12 +642,12 @@ sub ConvertObjectFromPythonData($$$$$$) if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "NTSTATUS") { - $self->pidl("$target = PyInt_AsLong($cvar);"); + $self->pidl("$target = NT_STATUS(PyInt_AsLong($cvar));"); return; } if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "WERROR") { - $self->pidl("$target = PyInt_AsLong($cvar);"); + $self->pidl("$target = W_ERROR(PyInt_AsLong($cvar));"); return; } @@ -690,16 +690,16 @@ sub ConvertObjectFromPythonLevel($$$$$$$$) $self->pidl("}"); } } elsif ($l->{TYPE} eq "ARRAY") { + my $pl = GetPrevLevel($e, $l); + if ($pl && $pl->{TYPE} eq "POINTER") { + $var_name = get_pointer_to($var_name); + } + if (is_charset_array($e, $l)) { $self->pidl("PY_CHECK_TYPE(PyUnicode, $py_var, $fail);"); # FIXME: Use Unix charset setting rather than utf-8 - $self->pidl(get_pointer_to($var_name) . " = PyString_AsString(PyUnicode_AsEncodedString($py_var, \"utf-8\", \"ignore\"));"); + $self->pidl($var_name . " = PyString_AsString(PyUnicode_AsEncodedString($py_var, \"utf-8\", \"ignore\"));"); } else { - my $pl = GetPrevLevel($e, $l); - if ($pl && $pl->{TYPE} eq "POINTER") { - $var_name = get_pointer_to($var_name); - } - my $counter = "$e->{NAME}_cntr_$l->{LEVEL_INDEX}"; $self->pidl("PY_CHECK_TYPE(PyList, $py_var, $fail);"); $self->pidl("{"); |