diff options
| -rw-r--r-- | debian/changelog | 1 | ||||
| -rw-r--r-- | python/cache.cc | 8 | ||||
| -rw-r--r-- | python/generic.h | 4 | ||||
| -rw-r--r-- | python/tag.cc | 2 |
4 files changed, 10 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index 964128c0..8487ba9b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ python-apt (0.6.19ubuntu4) edgy; urgency=low * python/apt_pkgmodule.cc: - fix missing docstring (closes: #368907), Thanks to Josh Triplett + * make it build against python2.5 -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 18 Sep 2006 18:28:19 +0200 diff --git a/python/cache.cc b/python/cache.cc index 15b63b35..aa4d9ffc 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -287,12 +287,12 @@ PyTypeObject PkgCacheFileType = /*}}}*/ // Package List Class /*{{{*/ // --------------------------------------------------------------------- -static int PkgListLen(PyObject *Self) +static Py_ssize_t PkgListLen(PyObject *Self) { return GetCpp<PkgListStruct>(Self).Iter.Cache()->HeaderP->PackageCount; } -static PyObject *PkgListItem(PyObject *iSelf,int Index) +static PyObject *PkgListItem(PyObject *iSelf,Py_ssize_t Index) { PkgListStruct &Self = GetCpp<PkgListStruct>(iSelf); if (Index < 0 || (unsigned)Index >= Self.Iter.Cache()->HeaderP->PackageCount) @@ -884,12 +884,12 @@ PyTypeObject DependencyType = /*}}}*/ // Reverse Dependency List Class /*{{{*/ // --------------------------------------------------------------------- -static int RDepListLen(PyObject *Self) +static Py_ssize_t RDepListLen(PyObject *Self) { return GetCpp<RDepListStruct>(Self).Len; } -static PyObject *RDepListItem(PyObject *iSelf,int Index) +static PyObject *RDepListItem(PyObject *iSelf,Py_ssize_t Index) { RDepListStruct &Self = GetCpp<RDepListStruct>(iSelf); if (Index < 0 || (unsigned)Index >= Self.Len) diff --git a/python/generic.h b/python/generic.h index a808e28d..b47ed1a2 100644 --- a/python/generic.h +++ b/python/generic.h @@ -31,6 +31,10 @@ #include <string> #include <new> +#if PYTHON_API_VERSION < 1013 +typedef int Py_ssize_t; +#endif + template <class T> struct CppPyObject : public PyObject { // We are only using CppPyObject and friends as dumb structs only, ie the diff --git a/python/tag.cc b/python/tag.cc index 41db059c..883a8eab 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -132,7 +132,7 @@ static PyObject *TagSecMap(PyObject *Self,PyObject *Arg) } // len() operation -static int TagSecLength(PyObject *Self) +static Py_ssize_t TagSecLength(PyObject *Self) { pkgTagSection &Sec = GetCpp<pkgTagSection>(Self); return Sec.Count(); |
