Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56491 - in trunk: boost/python libs/python/src libs/python/src/object
From: rwgk_at_[hidden]
Date: 2009-09-30 08:35:55


Author: rwgk
Date: 2009-09-30 08:35:54 EDT (Wed, 30 Sep 2009)
New Revision: 56491
URL: http://svn.boost.org/trac/boost/changeset/56491

Log:
boost/python: some Py_ssize_t replaced with boost::python::ssize_t to restore compatibility with Python 2.3 and 2.4
Text files modified:
   trunk/boost/python/list.hpp | 2 +-
   trunk/libs/python/src/list.cpp | 4 ++--
   trunk/libs/python/src/object/class.cpp | 2 +-
   3 files changed, 4 insertions(+), 4 deletions(-)

Modified: trunk/boost/python/list.hpp
==============================================================================
--- trunk/boost/python/list.hpp (original)
+++ trunk/boost/python/list.hpp 2009-09-30 08:35:54 EDT (Wed, 30 Sep 2009)
@@ -19,7 +19,7 @@
   {
       void append(object_cref); // append object to end
 
- Py_ssize_t count(object_cref value) const; // return number of occurrences of value
+ ssize_t count(object_cref value) const; // return number of occurrences of value
 
       void extend(object_cref sequence); // extend list by appending sequence elements
     

Modified: trunk/libs/python/src/list.cpp
==============================================================================
--- trunk/libs/python/src/list.cpp (original)
+++ trunk/libs/python/src/list.cpp 2009-09-30 08:35:54 EDT (Wed, 30 Sep 2009)
@@ -144,11 +144,11 @@
 
 // For some reason, moving this to the end of the TU suppresses an ICE
 // with vc6.
-Py_ssize_t list_base::count(object_cref value) const
+ssize_t list_base::count(object_cref value) const
 {
     object result_obj(this->attr("count")(value));
 #if PY_VERSION_HEX >= 0x03000000
- Py_ssize_t result = PyLong_AsSsize_t(result_obj.ptr());
+ ssize_t result = PyLong_AsSsize_t(result_obj.ptr());
 #else
     long result = PyInt_AsLong(result_obj.ptr());
 #endif

Modified: trunk/libs/python/src/object/class.cpp
==============================================================================
--- trunk/libs/python/src/object/class.cpp (original)
+++ trunk/libs/python/src/object/class.cpp 2009-09-30 08:35:54 EDT (Wed, 30 Sep 2009)
@@ -355,7 +355,7 @@
           PyObject* d = type_->tp_dict;
           PyObject* instance_size_obj = PyObject_GetAttrString(d, const_cast<char*>("__instance_size__"));
 
- Py_ssize_t instance_size = instance_size_obj ?
+ ssize_t instance_size = instance_size_obj ?
 #if PY_VERSION_HEX >= 0x03000000
               PyLong_AsSsize_t(instance_size_obj) : 0;
 #else


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk