summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2015-06-18 12:38:22 +1200
committerAndrew Bartlett <abartlet@samba.org>2015-07-07 07:19:49 +0200
commitbba177100c4286f521d60e208a6f048ac33a722f (patch)
treeed83a2bb066326da004f00bae4287466371fbddf /pidl
parentcdbc6d92c6bf0645c5a23955e8ec5e253212e86d (diff)
downloadsamba-bba177100c4286f521d60e208a6f048ac33a722f.tar.gz
Treat uid_t, git_t as 64 bit in Pidl Python bindings
This follows their treatment in librpc/ndr/ndr_basic.c. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Jul 7 07:19:49 CEST 2015 on sn-devel-104
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 0f549442235..ff68e7a3d9c 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -972,7 +972,9 @@ sub ConvertObjectFromPythonData($$$$$$;$)
return;
}
if ($actual_ctype->{TYPE} eq "SCALAR" ) {
- if (expandAlias($actual_ctype->{NAME}) =~ /^(u?int64|hyper|dlong|udlong|udlongr|NTTIME_hyper|NTTIME|NTTIME_1sec)$/) {
+ if (expandAlias($actual_ctype->{NAME}) =~ /^(u?int64|hyper|dlong|udlong|udlongr
+ |NTTIME_hyper|NTTIME|NTTIME_1sec
+ |uid_t|gid_t)$/x) {
$self->pidl("if (PyLong_Check($cvar)) {");
$self->indent;
$self->pidl("$target = PyLong_AsLongLong($cvar);");
@@ -990,7 +992,7 @@ sub ConvertObjectFromPythonData($$$$$$;$)
$self->pidl("}");
return;
}
- if (expandAlias($actual_ctype->{NAME}) =~ /^(char|u?int[0-9]*|time_t|uid_t|gid_t)$/) {
+ if (expandAlias($actual_ctype->{NAME}) =~ /^(char|u?int[0-9]*|time_t)$/) {
$self->pidl("PY_CHECK_TYPE(&PyInt_Type, $cvar, $fail);");
$self->pidl("$target = PyInt_AsLong($cvar);");
return;
@@ -1203,11 +1205,11 @@ sub ConvertScalarToPython($$$)
return "PyLong_FromLongLong($cvar)";
}
- if ($ctypename =~ /^(uint64|hyper|udlong|udlongr|NTTIME_hyper|NTTIME|NTTIME_1sec)$/) {
+ if ($ctypename =~ /^(uint64|hyper|udlong|udlongr|NTTIME_hyper|NTTIME|NTTIME_1sec|uid_t|gid_t)$/) {
return "PyLong_FromUnsignedLongLong($cvar)";
}
- if ($ctypename =~ /^(char|u?int[0-9]*|time_t|uid_t|gid_t)$/) {
+ if ($ctypename =~ /^(char|u?int[0-9]*|time_t)$/) {
return "PyInt_FromLong($cvar)";
}