summaryrefslogtreecommitdiff
path: root/pidl/lib/Parse/Pidl/Samba4
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2010-04-15 00:18:46 +0400
committerJelmer Vernooij <jelmer@samba.org>2010-05-02 15:59:49 +0200
commit831336293dfd9ab3771c2eb0f155b7423e71ec94 (patch)
tree6121632c7a9b959759ddd8f518f6408bf9fa19b5 /pidl/lib/Parse/Pidl/Samba4
parent668e28b80e47876bf32ac49abcb1e8f5e0c2cef0 (diff)
downloadsamba-831336293dfd9ab3771c2eb0f155b7423e71ec94.tar.gz
samba-831336293dfd9ab3771c2eb0f155b7423e71ec94.tar.bz2
samba-831336293dfd9ab3771c2eb0f155b7423e71ec94.zip
pidl: Fix the generation of py helper for 64 bit integer
Up to now the generation of code for python helpers dealing with 64 bits (NTTIME,hyper, ...) was broken because they were assumed to be Int (PyInt_From ...) as Integer is always 32 bits in python. This fix use PyLong and states that the incomming data is a long long as it should be 64 bit at least. Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'pidl/lib/Parse/Pidl/Samba4')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 789a7dd87e..226db078d6 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -961,7 +961,11 @@ sub ConvertScalarToPython($$$)
$ctypename = expandAlias($ctypename);
- if ($ctypename =~ /^(char|u?int[0-9]*|hyper|dlong|udlong|udlongr|time_t|NTTIME_hyper|NTTIME|NTTIME_1sec)$/) {
+ if ($ctypename =~ /^(u?int64|hyper|dlong|udlong|udlongr|NTTIME_hyper|NTTIME|NTTIME_1sec)$/) {
+ return "PyLong_FromLongLong($cvar)";
+ }
+
+ if ($ctypename =~ /^(char|u?int[0-9]*|time_t)$/) {
return "PyInt_FromLong($cvar)";
}