From 831336293dfd9ab3771c2eb0f155b7423e71ec94 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Thu, 15 Apr 2010 00:18:46 +0400 Subject: 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 --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pidl/lib/Parse/Pidl/Samba4/Python.pm') 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)"; } -- cgit