diff options
author | Matthieu Patou <mat@matws.net> | 2010-04-15 00:18:46 +0400 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-05-02 15:59:49 +0200 |
commit | 831336293dfd9ab3771c2eb0f155b7423e71ec94 (patch) | |
tree | 6121632c7a9b959759ddd8f518f6408bf9fa19b5 /pidl/lib | |
parent | 668e28b80e47876bf32ac49abcb1e8f5e0c2cef0 (diff) | |
download | samba-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')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/Python.pm | 6 |
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)"; } |