summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Piper <nicholas@users.sourceforge.net>2006-05-15 08:56:09 +0000
committerNicholas Piper <nicholas@users.sourceforge.net>2006-05-15 08:56:09 +0000
commite9148b049cd9b92ebe3ff0e6ed20cc4dc724e8e9 (patch)
tree847bb59794c31de425ca6119d27b375446e57baf
parent74de58ae636ce790cfaf1e1e9e2e75c8fa0f5bfc (diff)
downloadlibgpod-e9148b049cd9b92ebe3ff0e6ed20cc4dc724e8e9.tar.gz
libgpod-e9148b049cd9b92ebe3ff0e6ed20cc4dc724e8e9.tar.xz
libgpod-e9148b049cd9b92ebe3ff0e6ed20cc4dc724e8e9.zip
Another attempt at fixing gint64 and guint64 handling. 'Seems to work', this time.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1263 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r--bindings/python/gpod.i22
1 files changed, 12 insertions, 10 deletions
diff --git a/bindings/python/gpod.i b/bindings/python/gpod.i
index 1d5f231..23d8092 100644
--- a/bindings/python/gpod.i
+++ b/bindings/python/gpod.i
@@ -213,19 +213,21 @@ typedef char gchar;
}
%typemap(in) guint64 {
- unsigned long ival;
- ival = PyInt_AsUnsignedLongLongMask($input);
- if (PyErr_Occurred())
- SWIG_fail;
- $1 = (guint64) ival;
+ if (PyInt_CheckExact($input))
+ $1 = PyInt_AsUnsignedLongLongMask($input);
+ else
+ $1 = PyLong_AsUnsignedLongLong($input);
+ if (PyErr_Occurred())
+ SWIG_fail;
}
%typemap(in) gint64 {
- long ival;
- ival = PyInt_AsUnsignedLongMask($input);
- if (PyErr_Occurred())
- SWIG_fail;
- $1 = (gint64) ival;
+ if (PyInt_CheckExact($input))
+ $1 = PyInt_AsLong($input);
+ else
+ $1 = PyLong_AsLongLong($input);
+ if (PyErr_Occurred())
+ SWIG_fail;
}
%typemap(out) guint64 {