summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicholas <nicholas@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2006-05-15 08:56:09 +0000
committernicholas <nicholas@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2006-05-15 08:56:09 +0000
commite4405b97f41ae77b3dae5370a9927af6f1f85039 (patch)
tree847bb59794c31de425ca6119d27b375446e57baf
parentb92e5ec0ffa1d45ed8b4518949b421e243481c3c (diff)
downloadlibgpod-e4405b97f41ae77b3dae5370a9927af6f1f85039.tar.gz
libgpod-e4405b97f41ae77b3dae5370a9927af6f1f85039.tar.xz
libgpod-e4405b97f41ae77b3dae5370a9927af6f1f85039.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 {