r5094: Use builtin swig types for converting between fixed width integer types.
authorTim Potter <tpot@samba.org>
Sat, 29 Jan 2005 05:04:23 +0000 (05:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:09:22 +0000 (13:09 -0500)
(This used to be commit f2a1b237bcc824bd3e84da69f472ffb3c9055d00)

source4/scripting/swig/samba.i

index a989a468b9c8ae89359a482f951b265ff4229132..6cdf4240956c15da97ae97e61a8f94462fcf4f9a 100644 (file)
    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));