pidl/python: Provide static inline helper function ndr_PyLong_FromUnsignedLongLong
authorAndrew Bartlett <abartlet@samba.org>
Tue, 1 Sep 2015 02:33:35 +0000 (14:33 +1200)
committerStefan Metzmacher <metze@samba.org>
Tue, 1 Sep 2015 12:01:23 +0000 (14:01 +0200)
commitd1416d65a3cc61e4e56d1a43bb634d12f418ba0e
tree0885dd737d175b9964d0fe6e6e1585d746e4be7d
parentc2f4e324d9c1ced2e1da859594ef67ae9f645919
pidl/python: Provide static inline helper function ndr_PyLong_FromUnsignedLongLong

This should isolate any coverity warnings on 64-bit platforms
(where LONG_MAX is larger than any possible 32 bit value) to
a single spot, or possibly eliminate it.

This is needed for the unsigned 64 bit case, and on 32 bit
systems, as PyInt_FromLong is limited to a signed "long" int.

The compiler should be able to eliminate many of these calls
with the embedded type knowlege.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11429

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
pidl/lib/Parse/Pidl/Samba4/Python.pm