diff options
author | Tim Potter <tpot@samba.org> | 2005-01-29 05:04:23 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:22 -0500 |
commit | 7e877072bd7ad52dad43abd85545571d79e7c45c (patch) | |
tree | 22b3bdb4284c7e824e1937c7dad686b3bde09db9 /source4 | |
parent | 51ad25e8ea0d75ea444de8607c84992157e56d43 (diff) | |
download | samba-7e877072bd7ad52dad43abd85545571d79e7c45c.tar.gz samba-7e877072bd7ad52dad43abd85545571d79e7c45c.tar.bz2 samba-7e877072bd7ad52dad43abd85545571d79e7c45c.zip |
r5094: Use builtin swig types for converting between fixed width integer types.
(This used to be commit f2a1b237bcc824bd3e84da69f472ffb3c9055d00)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/swig/samba.i | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/source4/scripting/swig/samba.i b/source4/scripting/swig/samba.i index a989a468b9..6cdf424095 100644 --- a/source4/scripting/swig/samba.i +++ b/source4/scripting/swig/samba.i @@ -24,17 +24,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -%typemap(in) uint32 { - if (!PyInt_Check($input) && !PyLong_Check($input)) { - PyErr_SetString(PyExc_TypeError, "integer expected"); - return NULL; - } - $1 = (uint32_t)PyLong_AsLong($input); -} - -%typemap(out) uint32 { - $result = PyLong_FromLong($1); -} +%apply unsigned char { uint8_t }; +%apply char { int8_t }; +%apply unsigned int { uint16_t }; +%apply int { int16_t }; +%apply unsigned long { uint32_t }; +%apply long { int32_t }; +%apply unsigned long long { uint64_t }; +%apply long long { int64_t }; %typemap(out) NTSTATUS { $result = PyLong_FromLong(NT_STATUS_V($1)); |