Blob Blame History Raw
--- k3d-0.6.5.0/modules/python/object_model.cpp.orig	2006-12-28 07:18:06.000000000 -0800
+++ k3d-0.6.5.0/modules/python/object_model.cpp	2006-12-28 07:25:14.000000000 -0800
@@ -240,13 +240,13 @@
 		return_val_if_fail(PyObject_TypeCheck(Object, &name##_type), 0); \
 		return reinterpret_cast<name*>(Object)->container; \
 	} \
-	int name##_length(PyObject* Object) \
+	Py_ssize_t name##_length(PyObject* Object) \
 	{ \
 		container_type* const container = python_cast<container_type*>(Object); \
 		return_val_if_fail(container, -1); \
 		return container->size(); \
 	} \
-	PyObject* name##_item(PyObject* Object, int Index) \
+	PyObject* name##_item(PyObject* Object, Py_ssize_t Index) \
 	{ \
 		container_type* const container = python_cast<container_type*>(Object); \
 		return_val_if_fail(container, 0); \
@@ -255,7 +255,7 @@
 			container->resize(Index + 1); \
 		return python_wrap(container->at(Index)); \
 	} \
-	int name##_assign_item(PyObject* Object, int Index, PyObject* Value) \
+	int name##_assign_item(PyObject* Object, Py_ssize_t Index, PyObject* Value) \
 	{ \
 		container_type* const container = python_cast<container_type*>(Object); \
 		return_val_if_fail(container, -1); \
@@ -402,20 +402,20 @@
 		return_val_if_fail(PyObject_TypeCheck(Object, &name##_type), 0); \
 		return reinterpret_cast<name*>(Object)->container; \
 	} \
-	int name##_length(PyObject* Object) \
+	Py_ssize_t name##_length(PyObject* Object)		\
 	{ \
 		container_type* const container = python_cast<container_type*>(Object); \
 		return_val_if_fail(container, -1); \
 		return container->size(); \
 	} \
-	PyObject* name##_item(PyObject* Object, int Index) \
+	PyObject* name##_item(PyObject* Object, Py_ssize_t Index) \
 	{ \
 		container_type* const container = python_cast<container_type*>(Object); \
 		return_val_if_fail(container, 0); \
 		return_val_if_fail(0 <= Index && static_cast<unsigned int>(Index) < container->size(), 0); \
 		return python_wrap(container->at(Index)); \
 	} \
-	int name##_assign_item(PyObject* Object, int Index, PyObject* Value) \
+	int name##_assign_item(PyObject* Object, Py_ssize_t Index, PyObject* Value) \
 	{ \
 		return_val_if_fail(Value, -1); \
 		container_type* const container = python_cast<container_type*>(Object); \
@@ -3535,7 +3535,7 @@
 	return reinterpret_cast<k3d_bitmap*>(Object)->object;
 }
 
-PyObject* k3d_bitmap_item(PyObject* Object, int Index)
+PyObject* k3d_bitmap_item(PyObject* Object, Py_ssize_t Index)
 {
 	k3d::bitmap* const value = python_cast<k3d::bitmap*>(Object);
 	return_val_if_fail(value, 0);
@@ -3546,7 +3546,7 @@
 	return python_wrap(*(value->begin() + Index));
 }
 
-int k3d_bitmap_assign_item(PyObject* Object, int Index, PyObject* Value)
+int k3d_bitmap_assign_item(PyObject* Object, Py_ssize_t Index, PyObject* Value)
 {
 	k3d::bitmap* const lhs = python_cast<k3d::bitmap*>(Object);
 	return_val_if_fail(lhs, -1);
@@ -3890,7 +3890,7 @@
 	return -1;
 }
 
-PyObject* k3d_point3_item(PyObject* Object, int Index)
+PyObject* k3d_point3_item(PyObject* Object, Py_ssize_t Index)
 {
 	return_val_if_fail(0 <= Index, 0);
 	return_val_if_fail(Index <= 2, 0);
@@ -3901,7 +3901,7 @@
 	return python_wrap((*value)[Index]);
 }
 
-int k3d_point3_assign_item(PyObject* Object, int Index, PyObject* Value)
+int k3d_point3_assign_item(PyObject* Object, Py_ssize_t Index, PyObject* Value)
 {
 	return_val_if_fail(0 <= Index, -1);
 	return_val_if_fail(Index <= 2, -1);
@@ -4137,7 +4137,7 @@
 	return -1;
 }
 
-PyObject* k3d_vector3_item(PyObject* Object, int Index)
+PyObject* k3d_vector3_item(PyObject* Object, Py_ssize_t Index)
 {
 	return_val_if_fail(0 <= Index, 0);
 	return_val_if_fail(Index <= 2, 0);
@@ -4148,7 +4148,7 @@
 	return python_wrap((*value)[Index]);
 }
 
-int k3d_vector3_assign_item(PyObject* Object, int Index, PyObject* Value)
+int k3d_vector3_assign_item(PyObject* Object, Py_ssize_t Index, PyObject* Value)
 {
 	return_val_if_fail(0 <= Index, -1);
 	return_val_if_fail(Index <= 2, -1);
@@ -4582,7 +4582,7 @@
 	return -1;
 }
 
-PyObject* k3d_euler_angles_item(PyObject* Object, int Index)
+PyObject* k3d_euler_angles_item(PyObject* Object, Py_ssize_t Index)
 {
 	return_val_if_fail(0 <= Index, 0);
 	return_val_if_fail(Index <= 2, 0);
@@ -4593,7 +4593,7 @@
 	return python_wrap((*value)[Index]);
 }
 
-int k3d_euler_angles_assign_item(PyObject* Object, int Index, PyObject* Value)
+int k3d_euler_angles_assign_item(PyObject* Object, Py_ssize_t Index, PyObject* Value)
 {
 	return_val_if_fail(0 <= Index, -1);
 	return_val_if_fail(Index <= 2, -1);
@@ -4805,7 +4805,7 @@
 	return -1;
 }
 
-PyObject* k3d_point4_item(PyObject* Object, int Index)
+PyObject* k3d_point4_item(PyObject* Object, Py_ssize_t Index)
 {
 	return_val_if_fail(0 <= Index, 0);
 	return_val_if_fail(Index <= 3, 0);
@@ -4816,7 +4816,7 @@
 	return python_wrap((*value)[Index]);
 }
 
-int k3d_point4_assign_item(PyObject* Object, int Index, PyObject* Value)
+int k3d_point4_assign_item(PyObject* Object, Py_ssize_t Index, PyObject* Value)
 {
 	return_val_if_fail(0 <= Index, -1);
 	return_val_if_fail(Index <= 3, -1);
@@ -4960,7 +4960,7 @@
 	return -1;
 }
 
-PyObject* k3d_matrix4_item(PyObject* Object, int Index)
+PyObject* k3d_matrix4_item(PyObject* Object, Py_ssize_t Index)
 {
 	return_val_if_fail(0 <= Index, 0);
 	return_val_if_fail(Index <= 3, 0);
@@ -4968,10 +4968,10 @@
 	k3d::matrix4* const value = python_cast<k3d::matrix4*>(Object);
 	return_val_if_fail(value, 0);
 
-	return python_wrap((*value)[Index]);
+	return python_wrap((*value)[(int)Index]);
 }
 
-int k3d_matrix4_assign_item(PyObject* Object, int Index, PyObject* Value)
+int k3d_matrix4_assign_item(PyObject* Object, Py_ssize_t Index, PyObject* Value)
 {
 	return -1;
 }