nautilus-python r48 - in trunk: . src



Author: johan
Date: Fri Jan 11 14:14:14 2008
New Revision: 48
URL: http://svn.gnome.org/viewvc/nautilus-python?rev=48&view=rev

Log:
2008-01-11  Jonathan Rogers <jonner teegra net>

	reviewed by: Johan Dahlin

	* src/nautilus-python-object.c:
	* src/nautilus-python.c: (nautilus_python_load_file):
	* src/nautilus-python.h:
	Use Py_ssize_t instead of int, so nautilus-python works on Python 2.5
	fixes #444366	



Modified:
   trunk/ChangeLog
   trunk/src/nautilus-python-object.c
   trunk/src/nautilus-python.c
   trunk/src/nautilus-python.h

Modified: trunk/src/nautilus-python-object.c
==============================================================================
--- trunk/src/nautilus-python-object.c	(original)
+++ trunk/src/nautilus-python-object.c	Fri Jan 11 14:14:14 2008
@@ -74,7 +74,7 @@
 
 #define HANDLE_LIST(py_ret, type, type_name)                           \
     {                                                                  \
-        int i = 0;                                                     \
+        Py_ssize_t i = 0;                                                     \
     	if (!PySequence_Check(py_ret) || PyString_Check(py_ret)) {     \
     		PyErr_SetString(PyExc_TypeError,                           \
     						METHOD_NAME " must return a sequence");    \

Modified: trunk/src/nautilus-python.c
==============================================================================
--- trunk/src/nautilus-python.c	(original)
+++ trunk/src/nautilus-python.c	Fri Jan 11 14:14:14 2008
@@ -114,7 +114,7 @@
 	PyObject *main_module, *main_locals, *locals, *key, *value;
 	PyObject *module;
 	GType gtype;
-	int pos = 0;
+	Py_ssize_t pos = 0;
 	
 	debug_enter_args("filename=%s", filename);
 	

Modified: trunk/src/nautilus-python.h
==============================================================================
--- trunk/src/nautilus-python.h	(original)
+++ trunk/src/nautilus-python.h	Fri Jan 11 14:14:14 2008
@@ -26,6 +26,12 @@
 #include <glib/gprintf.h>
 #include <Python.h>
 
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
 typedef enum {
     NAUTILUS_PYTHON_DEBUG_MISC = 1 << 0,
 } NautilusPythonDebug;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]