pidl: Always call PyLong_FromLongLong() in ndr_PyLong_FromLongLong()
authorAndrew Bartlett <abartlet@samba.org>
Sun, 5 May 2019 23:22:09 +0000 (11:22 +1200)
committerGary Lockyer <gary@samba.org>
Mon, 6 May 2019 05:46:11 +0000 (05:46 +0000)
The C type is "long long" so use that always, as the Python type is now always the same.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
pidl/lib/Parse/Pidl/Samba4/Python.pm

index 10ea3e6ad1bce270ff01d6a17e06709ef1df01fa..4530b113bf6b13ab708ea86dc489ae26767c999d 100644 (file)
@@ -2318,11 +2318,7 @@ static inline long long ndr_sizeof2intmax(size_t var_size)
 
 static inline PyObject *ndr_PyLong_FromLongLong(long long v)
 {
-       if (v > LONG_MAX || v < LONG_MIN) {
-               return PyLong_FromLongLong(v);
-       } else {
-               return PyLong_FromLong(v);
-       }
+       return PyLong_FromLongLong(v);
 }
 
 static inline PyObject *ndr_PyLong_FromUnsignedLongLong(unsigned long long v)