Boost logo

Boost-Commit :

From: dave_at_[hidden]
Date: 2007-11-30 21:15:20


Author: dave
Date: 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
New Revision: 41521
URL: http://svn.boost.org/trac/boost/changeset/41521

Log:

Boost.Python:

* Workarounds for many SunCC 5.9 bugs
* Suppression of many SunCC 5.9 warnings
* Improve the style of some test invocations in Jamfile

Text files modified:
   trunk/boost/python/converter/rvalue_from_python_data.hpp | 4 ++--
   trunk/boost/python/data_members.hpp | 6 ++++--
   trunk/boost/python/object/class_metadata.hpp | 2 +-
   trunk/boost/python/object/pointer_holder.hpp | 9 ++++++++-
   trunk/boost/python/object_protocol.hpp | 14 +++++++-------
   trunk/boost/python/object_slices.hpp | 22 ++++++++++++++--------
   trunk/libs/python/src/dict.cpp | 2 +-
   trunk/libs/python/src/exec.cpp | 2 +-
   trunk/libs/python/src/list.cpp | 2 +-
   trunk/libs/python/src/long.cpp | 6 +++---
   trunk/libs/python/src/object/class.cpp | 36 ++++++++++++++++++------------------
   trunk/libs/python/src/object/enum.cpp | 6 +++---
   trunk/libs/python/src/object/function.cpp | 21 +++++++++++----------
   trunk/libs/python/src/object/life_support.cpp | 2 +-
   trunk/libs/python/src/str.cpp | 7 ++++---
   trunk/libs/python/src/tuple.cpp | 2 +-
   trunk/libs/python/test/Jamfile.v2 | 5 +++--
   trunk/libs/python/test/andreas_beyer.cpp | 4 ++--
   trunk/libs/python/test/back_reference.cpp | 2 +-
   trunk/libs/python/test/callbacks.cpp | 2 +-
   trunk/libs/python/test/complicated.hpp | 6 +++---
   trunk/libs/python/test/exec.cpp | 2 +-
   trunk/libs/python/test/m1.cpp | 6 +++---
   trunk/libs/python/test/numpy.cpp | 4 ++--
   trunk/libs/python/test/pickle1.cpp | 4 ++--
   trunk/libs/python/test/pickle2.cpp | 4 ++--
   trunk/libs/python/test/pickle3.cpp | 4 ++--
   trunk/libs/python/test/pickle4.cpp | 4 ++--
   trunk/libs/python/test/slice.cpp | 6 +++++-
   trunk/libs/python/test/staticmethod.cpp | 2 +-
   trunk/libs/python/test/test_class.hpp | 2 +-
   trunk/libs/python/test/test_pointer_adoption.cpp | 2 +-
   trunk/libs/python/test/virtual_functions.cpp | 2 +-
   trunk/tools/build/v2/tools/python.jam | 15 +++++++++------
   34 files changed, 122 insertions(+), 97 deletions(-)

Modified: trunk/boost/python/converter/rvalue_from_python_data.hpp
==============================================================================
--- trunk/boost/python/converter/rvalue_from_python_data.hpp (original)
+++ trunk/boost/python/converter/rvalue_from_python_data.hpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -117,9 +117,9 @@
 // Implementataions
 //
 template <class T>
-inline rvalue_from_python_data<T>::rvalue_from_python_data(rvalue_from_python_stage1_data const& stage1)
+inline rvalue_from_python_data<T>::rvalue_from_python_data(rvalue_from_python_stage1_data const& _stage1)
 {
- this->stage1 = stage1;
+ this->stage1 = _stage1;
 }
 
 template <class T>

Modified: trunk/boost/python/data_members.hpp
==============================================================================
--- trunk/boost/python/data_members.hpp (original)
+++ trunk/boost/python/data_members.hpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -265,7 +265,8 @@
 template <class D>
 inline object make_getter(D& x)
 {
- detail::not_specified policy;
+ detail::not_specified policy
+ = detail::not_specified(); // suppress a SunPro warning
     return detail::make_getter(x, policy, is_member_pointer<D>(), 0L);
 }
 
@@ -273,7 +274,8 @@
 template <class D>
 inline object make_getter(D const& d)
 {
- detail::not_specified policy;
+ detail::not_specified policy
+ = detail::not_specified(); // Suppress a SunPro warning
     return detail::make_getter(d, policy, is_member_pointer<D>(), 0L);
 }
 # endif

Modified: trunk/boost/python/object/class_metadata.hpp
==============================================================================
--- trunk/boost/python/object/class_metadata.hpp (original)
+++ trunk/boost/python/object/class_metadata.hpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -236,7 +236,7 @@
     //
     // Support for converting smart pointers to python
     //
- inline static void maybe_register_pointer_to_python(void*,void*,void*) {}
+ inline static void maybe_register_pointer_to_python(...) {}
 
 #ifndef BOOST_PYTHON_NO_PY_SYGNATURES
     inline static void maybe_register_pointer_to_python(void*,void*,mpl::true_*)

Modified: trunk/boost/python/object/pointer_holder.hpp
==============================================================================
--- trunk/boost/python/object/pointer_holder.hpp (original)
+++ trunk/boost/python/object/pointer_holder.hpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -127,7 +127,14 @@
     )
         return &this->m_p;
 
- Value* p = get_pointer(this->m_p);
+ Value* p
+# if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+ = static_cast<Value*>( get_pointer(this->m_p) )
+# else
+ = get_pointer(this->m_p)
+# endif
+ ;
+
     if (p == 0)
         return 0;
     

Modified: trunk/boost/python/object_protocol.hpp
==============================================================================
--- trunk/boost/python/object_protocol.hpp (original)
+++ trunk/boost/python/object_protocol.hpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -24,45 +24,45 @@
 # endif
 
 template <class Target, class Key>
-object getattr(Target const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(key))
+object getattr(Target const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key))
 {
     return getattr(object(target), object(key));
 }
 
 template <class Target, class Key, class Default>
-object getattr(Target const& target, Key const& key, Default const& default_ BOOST_PYTHON_NO_ARRAY_ARG(key))
+object getattr(Target const& target, Key const& key, Default const& default_ BOOST_PYTHON_NO_ARRAY_ARG(Key))
 {
     return getattr(object(target), object(key), object(default_));
 }
 
 
 template <class Key, class Value>
-void setattr(object const& target, Key const& key, Value const& value BOOST_PYTHON_NO_ARRAY_ARG(key))
+void setattr(object const& target, Key const& key, Value const& value BOOST_PYTHON_NO_ARRAY_ARG(Key))
 {
     setattr(target, object(key), object(value));
 }
 
 template <class Key>
-void delattr(object const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(key))
+void delattr(object const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key))
 {
     delattr(target, object(key));
 }
 
 template <class Target, class Key>
-object getitem(Target const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(key))
+object getitem(Target const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key))
 {
     return getitem(object(target), object(key));
 }
 
 
 template <class Key, class Value>
-void setitem(object const& target, Key const& key, Value const& value BOOST_PYTHON_NO_ARRAY_ARG(key))
+void setitem(object const& target, Key const& key, Value const& value BOOST_PYTHON_NO_ARRAY_ARG(Key))
 {
     setitem(target, object(key), object(value));
 }
 
 template <class Key>
-void delitem(object const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(key))
+void delitem(object const& target, Key const& key BOOST_PYTHON_NO_ARRAY_ARG(Key))
 {
     delitem(target, object(key));
 }

Modified: trunk/boost/python/object_slices.hpp
==============================================================================
--- trunk/boost/python/object_slices.hpp (original)
+++ trunk/boost/python/object_slices.hpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -27,6 +27,12 @@
     static void del(object const& target, key_type const& key);
 };
 
+template <class T, class U>
+inline slice_policies::key_type slice_key(T x, U y)
+{
+ return slice_policies::key_type(handle<>(x), handle<>(y));
+}
+
 //
 // implementation
 //
@@ -35,7 +41,7 @@
 object_operators<U>::slice(object_cref start, object_cref finish)
 {
     object_cref2 x = *static_cast<U*>(this);
- return object_slice(x, std::make_pair(borrowed(start.ptr()), borrowed(finish.ptr())));
+ return object_slice(x, api::slice_key(borrowed(start.ptr()), borrowed(finish.ptr())));
 }
 
 template <class U>
@@ -43,7 +49,7 @@
 object_operators<U>::slice(object_cref start, object_cref finish) const
 {
     object_cref2 x = *static_cast<U const*>(this);
- return const_object_slice(x, std::make_pair(borrowed(start.ptr()), borrowed(finish.ptr())));
+ return const_object_slice(x, api::slice_key(borrowed(start.ptr()), borrowed(finish.ptr())));
 }
 
 template <class U>
@@ -51,7 +57,7 @@
 object_operators<U>::slice(slice_nil, object_cref finish)
 {
     object_cref2 x = *static_cast<U*>(this);
- return object_slice(x, std::make_pair(allow_null((PyObject*)0), borrowed(finish.ptr())));
+ return object_slice(x, api::slice_key(allow_null((PyObject*)0), borrowed(finish.ptr())));
 }
 
 template <class U>
@@ -59,7 +65,7 @@
 object_operators<U>::slice(slice_nil, object_cref finish) const
 {
     object_cref2 x = *static_cast<U const*>(this);
- return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), borrowed(finish.ptr())));
+ return const_object_slice(x, api::slice_key(allow_null((PyObject*)0), borrowed(finish.ptr())));
 }
 
 template <class U>
@@ -67,7 +73,7 @@
 object_operators<U>::slice(slice_nil, slice_nil)
 {
     object_cref2 x = *static_cast<U*>(this);
- return object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0)));
+ return object_slice(x, api::slice_key(allow_null((PyObject*)0), allow_null((PyObject*)0)));
 }
 
 template <class U>
@@ -75,7 +81,7 @@
 object_operators<U>::slice(slice_nil, slice_nil) const
 {
     object_cref2 x = *static_cast<U const*>(this);
- return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0)));
+ return const_object_slice(x, api::slice_key(allow_null((PyObject*)0), allow_null((PyObject*)0)));
 }
 
 template <class U>
@@ -83,7 +89,7 @@
 object_operators<U>::slice(object_cref start, slice_nil)
 {
     object_cref2 x = *static_cast<U*>(this);
- return object_slice(x, std::make_pair(borrowed(start.ptr()), allow_null((PyObject*)0)));
+ return object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0)));
 }
 
 template <class U>
@@ -91,7 +97,7 @@
 object_operators<U>::slice(object_cref start, slice_nil) const
 {
     object_cref2 x = *static_cast<U const*>(this);
- return const_object_slice(x, std::make_pair(borrowed(start.ptr()), allow_null((PyObject*)0)));
+ return const_object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0)));
 }
 # if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
 template <class U>

Modified: trunk/libs/python/src/dict.cpp
==============================================================================
--- trunk/libs/python/src/dict.cpp (original)
+++ trunk/libs/python/src/dict.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -29,7 +29,7 @@
 detail::new_reference dict_base::call(object const& arg_)
 {
     return (detail::new_reference)PyObject_CallFunction(
- (PyObject*)&PyDict_Type, "(O)",
+ (PyObject*)&PyDict_Type, const_cast<char*>("(O)"),
         arg_.ptr());
 }
 

Modified: trunk/libs/python/src/exec.cpp
==============================================================================
--- trunk/libs/python/src/exec.cpp (original)
+++ trunk/libs/python/src/exec.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -39,7 +39,7 @@
   // should be 'char const *' but older python versions don't use 'const' yet.
   char *f = python::extract<char *>(filename);
   // Let python open the file to avoid potential binary incompatibilities.
- PyObject *pyfile = PyFile_FromString(f, "r");
+ PyObject *pyfile = PyFile_FromString(f, const_cast<char*>("r"));
   if (!pyfile) throw std::invalid_argument(std::string(f) + " : no such file");
   python::handle<> file(pyfile);
   PyObject* result = PyRun_File(PyFile_AsFile(file.get()),

Modified: trunk/libs/python/src/list.cpp
==============================================================================
--- trunk/libs/python/src/list.cpp (original)
+++ trunk/libs/python/src/list.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -13,7 +13,7 @@
     return (detail::new_non_null_reference)
         (expect_non_null)(
             PyObject_CallFunction(
- (PyObject*)&PyList_Type, "(O)",
+ (PyObject*)&PyList_Type, const_cast<char*>("(O)"),
                 arg_.ptr()));
 }
 

Modified: trunk/libs/python/src/long.cpp
==============================================================================
--- trunk/libs/python/src/long.cpp (original)
+++ trunk/libs/python/src/long.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -9,21 +9,21 @@
 new_non_null_reference long_base::call(object const& arg_)
 {
     return (detail::new_non_null_reference)PyObject_CallFunction(
- (PyObject*)&PyLong_Type, "(O)",
+ (PyObject*)&PyLong_Type, const_cast<char*>("(O)"),
         arg_.ptr());
 }
 
 new_non_null_reference long_base::call(object const& arg_, object const& base)
 {
     return (detail::new_non_null_reference)PyObject_CallFunction(
- (PyObject*)&PyLong_Type, "(OO)",
+ (PyObject*)&PyLong_Type, const_cast<char*>("(OO)"),
         arg_.ptr(), base.ptr());
 }
 
 long_base::long_base()
     : object(
         detail::new_reference(
- PyObject_CallFunction((PyObject*)&PyLong_Type, "()"))
+ PyObject_CallFunction((PyObject*)&PyLong_Type, const_cast<char*>("()")))
         )
 {}
 

Modified: trunk/libs/python/src/object/class.cpp
==============================================================================
--- trunk/libs/python/src/object/class.cpp (original)
+++ trunk/libs/python/src/object/class.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -74,7 +74,7 @@
   {
       propertyobject *gs = (propertyobject *)self;
 
- return PyObject_CallFunction(gs->prop_get, "()");
+ return PyObject_CallFunction(gs->prop_get, const_cast<char*>("()"));
   }
 
   static int
@@ -95,9 +95,9 @@
           return -1;
       }
       if (value == NULL)
- res = PyObject_CallFunction(func, "()");
+ res = PyObject_CallFunction(func, const_cast<char*>("()"));
       else
- res = PyObject_CallFunction(func, "(O)", value);
+ res = PyObject_CallFunction(func, const_cast<char*>("(O)"), value);
       if (res == NULL)
           return -1;
       Py_DECREF(res);
@@ -108,7 +108,7 @@
 static PyTypeObject static_data_object = {
     PyObject_HEAD_INIT(0)//&PyType_Type)
     0,
- "Boost.Python.StaticProperty",
+ const_cast<char*>("Boost.Python.StaticProperty"),
     PyType_Type.tp_basicsize,
     0,
     0, /* tp_dealloc */
@@ -212,7 +212,7 @@
 static PyTypeObject class_metatype_object = {
     PyObject_HEAD_INIT(0)//&PyType_Type)
     0,
- "Boost.Python.class",
+ const_cast<char*>("Boost.Python.class"),
     PyType_Type.tp_basicsize,
     0,
     0, /* tp_dealloc */
@@ -316,7 +316,7 @@
       {
           // Attempt to find the __instance_size__ attribute. If not present, no problem.
           PyObject* d = type_->tp_dict;
- PyObject* instance_size_obj = PyObject_GetAttrString(d, "__instance_size__");
+ PyObject* instance_size_obj = PyObject_GetAttrString(d, const_cast<char*>("__instance_size__"));
 
           long instance_size = instance_size_obj ? PyInt_AsLong(instance_size_obj) : 0;
           
@@ -357,20 +357,20 @@
 
 
   static PyGetSetDef instance_getsets[] = {
- {"__dict__", instance_get_dict, instance_set_dict, NULL, 0},
+ {const_cast<char*>("__dict__"), instance_get_dict, instance_set_dict, NULL, 0},
       {0, 0, 0, 0, 0}
   };
 
   
   static PyMemberDef instance_members[] = {
- {"__weakref__", T_OBJECT, offsetof(instance<>, weakrefs), 0, 0},
+ {const_cast<char*>("__weakref__"), T_OBJECT, offsetof(instance<>, weakrefs), 0, 0},
       {0, 0, 0, 0, 0}
   };
 
   static PyTypeObject class_type_object = {
       PyObject_HEAD_INIT(0) //&class_metatype_object)
       0,
- "Boost.Python.instance",
+ const_cast<char*>("Boost.Python.instance"),
       offsetof(instance<>,storage), /* tp_basicsize */
       1, /* tp_itemsize */
       instance_dealloc, /* tp_dealloc */
@@ -572,7 +572,7 @@
   {
       object property(
           (python::detail::new_reference)
- PyObject_CallFunction((PyObject*)&PyProperty_Type, "Osss", fget.ptr(), 0, 0, docstr));
+ PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast<char*>("Osss"), fget.ptr(), 0, 0, docstr));
       
       this->setattr(name, property);
   }
@@ -582,7 +582,7 @@
   {
       object property(
           (python::detail::new_reference)
- PyObject_CallFunction((PyObject*)&PyProperty_Type, "OOss", fget.ptr(), fset.ptr(), 0, docstr));
+ PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast<char*>("OOss"), fget.ptr(), fset.ptr(), 0, docstr));
       
       this->setattr(name, property);
   }
@@ -591,7 +591,7 @@
   {
       object property(
           (python::detail::new_reference)
- PyObject_CallFunction(static_data(), "O", fget.ptr()));
+ PyObject_CallFunction(static_data(), const_cast<char*>("O"), fget.ptr()));
       
       this->setattr(name, property);
   }
@@ -600,7 +600,7 @@
   {
       object property(
           (python::detail::new_reference)
- PyObject_CallFunction(static_data(), "OO", fget.ptr(), fset.ptr()));
+ PyObject_CallFunction(static_data(), const_cast<char*>("OO"), fget.ptr(), fset.ptr()));
       
       this->setattr(name, property);
   }
@@ -615,13 +615,13 @@
   {
     extern "C" PyObject* no_init(PyObject*, PyObject*)
     {
- ::PyErr_SetString(::PyExc_RuntimeError, "This class cannot be instantiated from Python");
+ ::PyErr_SetString(::PyExc_RuntimeError, const_cast<char*>("This class cannot be instantiated from Python"));
         return NULL;
     }
     static ::PyMethodDef no_init_def = {
- "__init__", no_init, METH_VARARGS,
- "Raises an exception\n"
- "This class cannot be instantiated from Python\n"
+ const_cast<char*>("__init__"), no_init, METH_VARARGS,
+ const_cast<char*>("Raises an exception\n"
+ "This class cannot be instantiated from Python\n")
     };
   }
   
@@ -650,7 +650,7 @@
 
         ::PyErr_Format(
             PyExc_TypeError
- , "staticmethod expects callable object; got an object of type %s, which is not callable"
+ , const_cast<char*>("staticmethod expects callable object; got an object of type %s, which is not callable")
             , callable->ob_type->tp_name
             );
         

Modified: trunk/libs/python/src/object/enum.cpp
==============================================================================
--- trunk/libs/python/src/object/enum.cpp (original)
+++ trunk/libs/python/src/object/enum.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -23,7 +23,7 @@
 };
 
 static PyMemberDef enum_members[] = {
- {"name", T_OBJECT_EX, offsetof(enum_object,name),READONLY, 0},
+ {const_cast<char*>("name"), T_OBJECT_EX, offsetof(enum_object,name),READONLY, 0},
     {0, 0, 0, 0, 0}
 };
 
@@ -32,7 +32,7 @@
 {
     static PyObject* enum_repr(PyObject* self_)
     {
- const char *mod = PyString_AsString(PyObject_GetAttrString( self_, "__module__"));
+ const char *mod = PyString_AsString(PyObject_GetAttrString( self_, const_cast<char*>("__module__")));
         enum_object* self = downcast<enum_object>(self_);
         if (!self->name)
         {
@@ -65,7 +65,7 @@
 static PyTypeObject enum_type_object = {
     PyObject_HEAD_INIT(0) // &PyType_Type
     0,
- "Boost.Python.enum",
+ const_cast<char*>("Boost.Python.enum"),
     sizeof(enum_object), /* tp_basicsize */
     0, /* tp_itemsize */
     0, /* tp_dealloc */

Modified: trunk/libs/python/src/object/function.cpp
==============================================================================
--- trunk/libs/python/src/object/function.cpp (original)
+++ trunk/libs/python/src/object/function.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -297,7 +297,7 @@
 void function::argument_error(PyObject* args, PyObject* /*keywords*/) const
 {
     static handle<> exception(
- PyErr_NewException("Boost.Python.ArgumentError", PyExc_TypeError, 0));
+ PyErr_NewException(const_cast<char*>("Boost.Python.ArgumentError"), PyExc_TypeError, 0));
 
     object message = "Python argument types in\n %s.%s("
         % make_tuple(this->m_namespace, this->m_name);
@@ -440,7 +440,7 @@
         else if (PyType_Check(ns))
             dict = ((PyTypeObject*)ns)->tp_dict;
         else
- dict = PyObject_GetAttrString(ns, "__dict__");
+ dict = PyObject_GetAttrString(ns, const_cast<char*>("__dict__"));
 
         if (dict == 0)
             throw_error_already_set();
@@ -487,7 +487,7 @@
             new_func->m_name = name;
 
         handle<> name_space_name(
- allow_null(::PyObject_GetAttrString(name_space.ptr(), "__name__")));
+ allow_null(::PyObject_GetAttrString(name_space.ptr(), const_cast<char*>("__name__"))));
         
         if (name_space_name)
             new_func->m_namespace = object(name_space_name);
@@ -661,18 +661,18 @@
 }
 
 static PyGetSetDef function_getsetlist[] = {
- {"__name__", (getter)function_get_name, 0, 0, 0 },
- {"func_name", (getter)function_get_name, 0, 0, 0 },
- {"__class__", (getter)function_get_class, 0, 0, 0 }, // see note above
- {"__doc__", (getter)function_get_doc, (setter)function_set_doc, 0, 0},
- {"func_doc", (getter)function_get_doc, (setter)function_set_doc, 0, 0},
+ {const_cast<char*>("__name__"), (getter)function_get_name, 0, 0, 0 },
+ {const_cast<char*>("func_name"), (getter)function_get_name, 0, 0, 0 },
+ {const_cast<char*>("__class__"), (getter)function_get_class, 0, 0, 0 }, // see note above
+ {const_cast<char*>("__doc__"), (getter)function_get_doc, (setter)function_set_doc, 0, 0},
+ {const_cast<char*>("func_doc"), (getter)function_get_doc, (setter)function_set_doc, 0, 0},
     {NULL, 0, 0, 0, 0} /* Sentinel */
 };
 
 PyTypeObject function_type = {
     PyObject_HEAD_INIT(0)
     0,
- "Boost.Python.function",
+ const_cast<char*>("Boost.Python.function"),
     sizeof(function),
     0,
     (destructor)function_dealloc, /* tp_dealloc */
@@ -758,7 +758,8 @@
   }
   void BOOST_PYTHON_DECL pure_virtual_called()
   {
- PyErr_SetString(PyExc_RuntimeError, "Pure virtual function called");
+ PyErr_SetString(
+ PyExc_RuntimeError, const_cast<char*>("Pure virtual function called"));
       throw_error_already_set();
   }
 }

Modified: trunk/libs/python/src/object/life_support.cpp
==============================================================================
--- trunk/libs/python/src/object/life_support.cpp (original)
+++ trunk/libs/python/src/object/life_support.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -38,7 +38,7 @@
 PyTypeObject life_support_type = {
     PyObject_HEAD_INIT(0)//(&PyType_Type)
     0,
- "Boost.Python.life_support",
+ const_cast<char*>("Boost.Python.life_support"),
     sizeof(life_support),
     0,
     life_support_dealloc, /* tp_dealloc */

Modified: trunk/libs/python/src/str.cpp
==============================================================================
--- trunk/libs/python/src/str.cpp (original)
+++ trunk/libs/python/src/str.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -10,7 +10,7 @@
 detail::new_reference str_base::call(object const& arg_)
 {
     return (detail::new_reference)PyObject_CallFunction(
- (PyObject*)&PyString_Type, "(O)",
+ (PyObject*)&PyString_Type, const_cast<char*>("(O)"),
         arg_.ptr());
 }
 
@@ -68,8 +68,9 @@
     return str(new_reference( \
        expect_non_null( \
            PyObject_CallMethod( \
- this->ptr(), #name, \
- "(" BOOST_PP_REPEAT(arity, BOOST_PYTHON_FORMAT_OBJECT, _) ")" \
+ this->ptr(), const_cast<char*>( #name ), \
+ const_cast<char*>( \
+ "(" BOOST_PP_REPEAT(arity, BOOST_PYTHON_FORMAT_OBJECT, _) ")") \
                BOOST_PP_REPEAT_1(arity, BOOST_PYTHON_OBJECT_PTR, _))))); \
 }
 

Modified: trunk/libs/python/src/tuple.cpp
==============================================================================
--- trunk/libs/python/src/tuple.cpp (original)
+++ trunk/libs/python/src/tuple.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -9,7 +9,7 @@
 detail::new_reference tuple_base::call(object const& arg_)
 {
     return (detail::new_reference)PyObject_CallFunction(
- (PyObject*)&PyTuple_Type, "(O)",
+ (PyObject*)&PyTuple_Type, const_cast<char*>("(O)"),
         arg_.ptr());
 }
     

Modified: trunk/libs/python/test/Jamfile.v2
==============================================================================
--- trunk/libs/python/test/Jamfile.v2 (original)
+++ trunk/libs/python/test/Jamfile.v2 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -39,7 +39,7 @@
   :
 
   [
- run exec.cpp ../build//boost_python/<link>static $(PY)
+ run exec.cpp /boost/python//boost_python/<link>static $(PY)
       : # program args
       : exec.py # input files
       : # requirements
@@ -168,7 +168,8 @@
     /boost/python//boost_python ]
 [ bpl-test
     map_indexing_suite : map_indexing_suite.py map_indexing_suite_ext ]
-[ py-run import_.cpp : import_.py ]
+
+[ run import_.cpp /boost/python//boost_python $(PY) : : import_.py ]
 
 # if $(TEST_BIENSTMAN_NON_BUGS)
 # {

Modified: trunk/libs/python/test/andreas_beyer.cpp
==============================================================================
--- trunk/libs/python/test/andreas_beyer.cpp (original)
+++ trunk/libs/python/test/andreas_beyer.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -25,8 +25,8 @@
     B() {
        a = A::A_ptr(new A());
     }
- void set(A::A_ptr a) {
- this->a = a;
+ void set(A::A_ptr _a) {
+ this->a = _a;
     }
     A::A_ptr get() {
        return a;

Modified: trunk/libs/python/test/back_reference.cpp
==============================================================================
--- trunk/libs/python/test/back_reference.cpp (original)
+++ trunk/libs/python/test/back_reference.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -27,7 +27,7 @@
     X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; }
     virtual ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; }
 
- void set(int x) { BOOST_ASSERT(magic == 7654321); this->x = x; }
+ void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; }
     int value() const { BOOST_ASSERT(magic == 7654321); return x; }
     static int count() { return counter; }
  private:

Modified: trunk/libs/python/test/callbacks.cpp
==============================================================================
--- trunk/libs/python/test/callbacks.cpp (original)
+++ trunk/libs/python/test/callbacks.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -34,7 +34,7 @@
     X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; }
     ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; }
 
- void set(int x) { BOOST_ASSERT(magic == 7654321); this->x = x; }
+ void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; }
     int value() const { BOOST_ASSERT(magic == 7654321); return x; }
     static int count() { return counter; }
  private:

Modified: trunk/libs/python/test/complicated.hpp
==============================================================================
--- trunk/libs/python/test/complicated.hpp (original)
+++ trunk/libs/python/test/complicated.hpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -19,10 +19,10 @@
     int n;
 };
 
-inline complicated::complicated(simple const&s, int n)
- : s(s.s), n(n)
+inline complicated::complicated(simple const&s, int _n)
+ : s(s.s), n(_n)
 {
- std::cout << "constructing complicated: " << this->s << ", " << n << std::endl;
+ std::cout << "constructing complicated: " << this->s << ", " << _n << std::endl;
 }
 
 inline complicated::~complicated()

Modified: trunk/libs/python/test/exec.cpp
==============================================================================
--- trunk/libs/python/test/exec.cpp (original)
+++ trunk/libs/python/test/exec.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -59,7 +59,7 @@
 void exec_test()
 {
   // Register the module with the interpreter
- if (PyImport_AppendInittab("embedded_hello", initembedded_hello) == -1)
+ if (PyImport_AppendInittab(const_cast<char*>("embedded_hello"), initembedded_hello) == -1)
     throw std::runtime_error("Failed to add embedded_hello to the interpreter's "
                  "builtin modules");
   // Retrieve the main module

Modified: trunk/libs/python/test/m1.cpp
==============================================================================
--- trunk/libs/python/test/m1.cpp (original)
+++ trunk/libs/python/test/m1.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -34,7 +34,7 @@
 PyTypeObject NoddyType = {
     PyObject_HEAD_INIT(NULL)
     0,
- "Noddy",
+ const_cast<char*>("Noddy"),
     sizeof(NoddyObject),
     0,
     dealloc, /* tp_dealloc */
@@ -106,7 +106,7 @@
 PyTypeObject SimpleType = {
     PyObject_HEAD_INIT(NULL)
     0,
- "Simple",
+ const_cast<char*>("Simple"),
     sizeof(SimpleObject),
     0,
     dealloc, /* tp_dealloc */
@@ -159,7 +159,7 @@
 PyObject* new_simple()
 {
     SimpleObject* simple = PyObject_New(SimpleObject, &SimpleType);
- simple->x.s = "hello, world";
+ simple->x.s = const_cast<char*>("hello, world");
     return (PyObject*)simple;
 }
 

Modified: trunk/libs/python/test/numpy.cpp
==============================================================================
--- trunk/libs/python/test/numpy.cpp (original)
+++ trunk/libs/python/test/numpy.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -12,7 +12,7 @@
 using namespace boost::python;
 
 #if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
-# define make_tuple boost::python::make_tuple
+# define make_tuple ::boost::python::make_tuple
 #endif
 
 // See if we can invoke array() from C++
@@ -51,7 +51,7 @@
       str format("exception type: %sn");
       format += "exception value: %sn";
       format += "traceback:n%s" ;
- object ret = format % boost::python::make_tuple(ty, v, tr);
+ object ret = format % make_tuple(ty, v, tr);
       return ret;
   }
 }

Modified: trunk/libs/python/test/pickle1.cpp
==============================================================================
--- trunk/libs/python/test/pickle1.cpp (original)
+++ trunk/libs/python/test/pickle1.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -27,8 +27,8 @@
     private:
       std::string country;
     public:
- world(const std::string& country) {
- this->country = country;
+ world(const std::string& _country) {
+ this->country = _country;
       }
       std::string greet() const { return "Hello from " + country + "!"; }
       std::string get_country() const { return country; }

Modified: trunk/libs/python/test/pickle2.cpp
==============================================================================
--- trunk/libs/python/test/pickle2.cpp (original)
+++ trunk/libs/python/test/pickle2.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -34,8 +34,8 @@
   class world
   {
     public:
- world(const std::string& country) : secret_number(0) {
- this->country = country;
+ world(const std::string& _country) : secret_number(0) {
+ this->country = _country;
       }
       std::string greet() const { return "Hello from " + country + "!"; }
       std::string get_country() const { return country; }

Modified: trunk/libs/python/test/pickle3.cpp
==============================================================================
--- trunk/libs/python/test/pickle3.cpp (original)
+++ trunk/libs/python/test/pickle3.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -35,8 +35,8 @@
   class world
   {
     public:
- world(const std::string& country) : secret_number(0) {
- this->country = country;
+ world(const std::string& _country) : secret_number(0) {
+ this->country = _country;
       }
       std::string greet() const { return "Hello from " + country + "!"; }
       std::string get_country() const { return country; }

Modified: trunk/libs/python/test/pickle4.cpp
==============================================================================
--- trunk/libs/python/test/pickle4.cpp (original)
+++ trunk/libs/python/test/pickle4.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -23,8 +23,8 @@
     private:
       std::string country;
     public:
- world(const std::string& country) {
- this->country = country;
+ world(const std::string& _country) {
+ this->country = _country;
       }
       std::string greet() const { return "Hello from " + country + "!"; }
       std::string get_country() const { return country; }

Modified: trunk/libs/python/test/slice.cpp
==============================================================================
--- trunk/libs/python/test/slice.cpp (original)
+++ trunk/libs/python/test/slice.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -100,7 +100,11 @@
     || BOOST_WORKAROUND( BOOST_INTEL_WIN, == 710)
 int check_slice_get_indicies(slice index);
 #endif
-int check_slice_get_indicies(const slice index)
+int check_slice_get_indicies(
+#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+ const
+#endif
+ slice index)
 {
     // A vector of integers from [-5, 5].
     std::vector<int> coll(11);

Modified: trunk/libs/python/test/staticmethod.cpp
==============================================================================
--- trunk/libs/python/test/staticmethod.cpp (original)
+++ trunk/libs/python/test/staticmethod.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -20,7 +20,7 @@
     X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; }
     virtual ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; }
 
- void set(int x) { BOOST_ASSERT(magic == 7654321); this->x = x; }
+ void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; }
     int value() const { BOOST_ASSERT(magic == 7654321); return x; }
     static int count() { return counter; }
  private:

Modified: trunk/libs/python/test/test_class.hpp
==============================================================================
--- trunk/libs/python/test/test_class.hpp (original)
+++ trunk/libs/python/test/test_class.hpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -13,7 +13,7 @@
     test_class(test_class const& rhs) : x(rhs.x), magic(7654321 + n) { ++counter; }
     virtual ~test_class() { BOOST_TEST(magic == 7654321 + n); magic = 6666666; x = 9999; --counter; }
 
- void set(int x) { BOOST_TEST(magic == 7654321 + n); this->x = x; }
+ void set(int _x) { BOOST_TEST(magic == 7654321 + n); this->x = _x; }
     int value() const { BOOST_TEST(magic == 7654321 + n); return x; }
     operator int() const { return x; }
     static int count() { return counter; }

Modified: trunk/libs/python/test/test_pointer_adoption.cpp
==============================================================================
--- trunk/libs/python/test/test_pointer_adoption.cpp (original)
+++ trunk/libs/python/test/test_pointer_adoption.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -65,7 +65,7 @@
     B() : x(0) {}
     B(A* x_) : x(x_) {}
 
- inner const* adopt(A* x) { this->x = x; return &x->get_inner(); }
+ inner const* adopt(A* _x) { this->x = _x; return &_x->get_inner(); }
 
     std::string a_content()
     {

Modified: trunk/libs/python/test/virtual_functions.cpp
==============================================================================
--- trunk/libs/python/test/virtual_functions.cpp (original)
+++ trunk/libs/python/test/virtual_functions.cpp 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -22,7 +22,7 @@
     X(X const& rhs) : x(rhs.x), magic(7654321) { ++counter; }
     virtual ~X() { BOOST_ASSERT(magic == 7654321); magic = 6666666; x = 9999; --counter; }
 
- void set(int x) { BOOST_ASSERT(magic == 7654321); this->x = x; }
+ void set(int _x) { BOOST_ASSERT(magic == 7654321); this->x = _x; }
     int value() const { BOOST_ASSERT(magic == 7654321); return x; }
     static int count() { return counter; }
  private:

Modified: trunk/tools/build/v2/tools/python.jam
==============================================================================
--- trunk/tools/build/v2/tools/python.jam (original)
+++ trunk/tools/build/v2/tools/python.jam 2007-11-30 21:15:17 EST (Fri, 30 Nov 2007)
@@ -610,13 +610,16 @@
             # appears to duplicate the logic already in gcc.jam, it
             # doesn't as long as we're not forcing <threading>multi.
 
- # Caleb Epstein reports that his python's
+ # On solaris 10,
             # distutils.sysconfig.get_config_var('LIBS') yields
- # -lresolv -lsocket -lnsl -lrt -ldl. However, we're not
- # yet sure that is the right list for extension modules.
- # Being conservative, we add rt and remove pthread, which
- # was causing errors.
- return <library>dl <toolset>gcc:<library>rt ;
+ # '-lresolv -lsocket -lnsl -lrt -ldl'. However, that
+ # doesn't seem to be the right list for extension modules.
+ # For example, on my installation, adding -ldl causes at
+ # least one test to fail because the library can't be
+ # found and removing it causes no failures.
+
+ # Apparently, though, we need to add -lrt for gcc.
+ return <toolset>gcc:<library>rt ;
 
         case osf : return <library>pthread <toolset>gcc:<library>rt ;
 


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