diff options
| author | Julian Andres Klode <jak@debian.org> | 2011-04-12 11:38:25 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2011-04-12 11:38:25 +0200 |
| commit | f441b008883170d6a8c4cfeb814b0c07a27e6afd (patch) | |
| tree | 6773ef5fec948428e98fd0a7bb6956372c21305f /python/depcache.cc | |
| parent | 91603aac68593f6749428825d7e94b75873927f4 (diff) | |
| download | python-apt-f441b008883170d6a8c4cfeb814b0c07a27e6afd.tar.gz | |
apt_pkg: Fix unsigned/long-vs-int issues (LP: #610820)
This fix is large, but simple in concept. Instead of relying
on Py_BuildValue and type signatures, or type-specific
conversion functions, create a new set of overloaded
MkPyNumber() functions that automatically do the right
thing for each numerical type.
Diffstat (limited to 'python/depcache.cc')
| -rw-r--r-- | python/depcache.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/depcache.cc b/python/depcache.cc index 12c13a73..e6113429 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -668,22 +668,22 @@ static PyMethodDef PkgDepCacheMethods[] = #define depcache (GetCpp<pkgDepCache *>(Self)) static PyObject *PkgDepCacheGetKeepCount(PyObject *Self,void*) { - return Py_BuildValue("l", depcache->KeepCount()); + return MkPyNumber(depcache->KeepCount()); } static PyObject *PkgDepCacheGetInstCount(PyObject *Self,void*) { - return Py_BuildValue("l", depcache->InstCount()); + return MkPyNumber(depcache->InstCount()); } static PyObject *PkgDepCacheGetDelCount(PyObject *Self,void*) { - return Py_BuildValue("l", depcache->DelCount()); + return MkPyNumber(depcache->DelCount()); } static PyObject *PkgDepCacheGetBrokenCount(PyObject *Self,void*) { - return Py_BuildValue("l", depcache->BrokenCount()); + return MkPyNumber(depcache->BrokenCount()); } static PyObject *PkgDepCacheGetUsrSize(PyObject *Self,void*) { - return Py_BuildValue("L", depcache->UsrSize()); + return MkPyNumber(depcache->UsrSize()); } static PyObject *PkgDepCacheGetDebSize(PyObject *Self,void*) { - return Py_BuildValue("L", depcache->DebSize()); + return MkPyNumber(depcache->DebSize()); } #undef depcache |
