diff --git a/doc/tutorial/doc/html/index.html b/doc/tutorial/doc/html/index.html index 5c65cb68..23d81694 100644 --- a/doc/tutorial/doc/html/index.html +++ b/doc/tutorial/doc/html/index.html @@ -31,7 +31,7 @@
Copyright © 2002-2005 Joel de Guzman, David Abrahams
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt ) @@ -94,7 +94,7 @@ (IDL).
@@ -145,7 +145,7 @@
Last revised: November 07, 2007 at 03:34:24 GMT |
+Last revised: March 24, 2008 at 23:09:39 GMT |
@@ -82,7 +82,7 @@ exe embedded_program # name of the executable <find-library>$(PYTHON_EMBEDDED_LIBRARY) ;
@@ -139,7 +139,7 @@ exe embedded_program # name of the executable automate the process.
@@ -190,7 +190,7 @@ exe embedded_program # name of the executable a phrase that is well-known in programming circles.
@@ -217,7 +217,7 @@ exe embedded_program # name of the executable int five_squared = extract<int>(result);
diff --git a/doc/tutorial/doc/html/python/exposing.html b/doc/tutorial/doc/html/python/exposing.html index 3f28366b..e0f0266c 100644 --- a/doc/tutorial/doc/html/python/exposing.html +++ b/doc/tutorial/doc/html/python/exposing.html @@ -533,7 +533,7 @@
@@ -582,7 +582,7 @@ expressions".
diff --git a/doc/tutorial/doc/html/python/functions.html b/doc/tutorial/doc/html/python/functions.html index 9e230a2b..b044c83e 100644 --- a/doc/tutorial/doc/html/python/functions.html +++ b/doc/tutorial/doc/html/python/functions.html @@ -212,7 +212,7 @@ Namespaces are one honking great idea -- let's do more of those!
@@ -415,7 +415,7 @@ Namespaces are one honking great idea -- let's do more of those!
@@ -445,7 +445,7 @@ Namespaces are one honking great idea -- let's do more of those! def("foo", foo, foo_overloads());
@@ -491,7 +491,7 @@ Namespaces are one honking great idea -- let's do more of those! reference for details.
@@ -565,7 +565,7 @@ Namespaces are one honking great idea -- let's do more of those! (0) arguments and a maximum of 3 arguments.
diff --git a/doc/tutorial/doc/html/python/hello.html b/doc/tutorial/doc/html/python/hello.html index 99c089ec..c6043c5e 100644 --- a/doc/tutorial/doc/html/python/hello.html +++ b/doc/tutorial/doc/html/python/hello.html @@ -26,7 +26,7 @@
@@ -92,7 +92,7 @@ platforms. The complete list of Bjam executables can be found here.
@@ -108,7 +108,7 @@ you going.
@@ -180,6 +180,17 @@ bjam Or something similar. If all is well, you should now have built the DLLs and run the Python program.
+![]() |
+Note | +
|---|---|
+ Starting from Boost 1.35, bjam erases the generated executables (e.g. pyd + file) after the test has concluded to conserve disk space. To keep bjam from + doing that, pass --preserve-test-targets to bjam. + | |
diff --git a/doc/tutorial/doc/html/python/object.html b/doc/tutorial/doc/html/python/object.html index 6f8920ab..4d28996b 100644 --- a/doc/tutorial/doc/html/python/object.html +++ b/doc/tutorial/doc/html/python/object.html @@ -196,7 +196,7 @@ d['whatever'] = 3; // modifies the copy
- + class_<T> as objects
diff --git a/doc/v2/object.html b/doc/v2/object.html index 6fa48fa5..f35fa579 100644 --- a/doc/v2/object.html +++ b/doc/v2/object.html @@ -655,11 +655,6 @@ namespace boost { namespace python { namespace api template <class A0, class A1,...class An> object operator()(A0 const&, A1 const&,...An const&) const; - detail::args_proxy operator* () const; - object operator()(detail::args_proxy const &args) const; - object operator()(detail::args_proxy const &args, - detail::kwds_proxy const &kwds) const; - // truth value testing // typedef unspecified bool_type; @@ -709,25 +704,6 @@ object operator()(A0 const& a1, A1 const& a2,...An const& aN) const; call<object>(object(*static_cast<U*>(this)).ptr(), a1, a2,...aN) - -
-object operator()(detail::args_proxy const &args) const; ---
-- Effects: - call object with arguments given by the tuple
-args -object operator()(detail::args_proxy const &args, - detail::kwds_proxy const &kwds) const; ---
- -- Effects: - call object with arguments given by the tuple
-args , and named - arguments given by the dictionarykwds operator bool_type() const;diff --git a/include/boost/python/call.hpp b/include/boost/python/call.hpp index 5d2d7d23..9a3d974b 100644 --- a/include/boost/python/call.hpp +++ b/include/boost/python/call.hpp @@ -38,10 +38,7 @@ namespace boost { namespace python { # endif // CALL_DWA2002411_HPP -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 +#elif BOOST_PP_ITERATION_DEPTH() == 1 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) # line BOOST_PP_LINE(__LINE__, call.hpp) @@ -79,5 +76,4 @@ call(PyObject* callable # undef N -#endif // BOOST_PP_ITERATION_DEPTH() #endif diff --git a/include/boost/python/call_method.hpp b/include/boost/python/call_method.hpp index 410f6682..0bca0610 100644 --- a/include/boost/python/call_method.hpp +++ b/include/boost/python/call_method.hpp @@ -37,10 +37,7 @@ namespace boost { namespace python { # endif // CALL_METHOD_DWA2002411_HPP -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 +#elif BOOST_PP_ITERATION_DEPTH() == 1 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) # line BOOST_PP_LINE(__LINE__, call_method.hpp) @@ -79,5 +76,4 @@ call_method(PyObject* self, char const* name # undef N -#endif // BOOST_PP_ITERATION_DEPTH() #endif // BOOST_PP_IS_ITERATING diff --git a/include/boost/python/converter/rvalue_from_python_data.hpp b/include/boost/python/converter/rvalue_from_python_data.hpp index 471a5255..7d2b3e07 100644 --- a/include/boost/python/converter/rvalue_from_python_data.hpp +++ b/include/boost/python/converter/rvalue_from_python_data.hpp @@ -117,9 +117,9 @@ struct rvalue_from_python_data : rvalue_from_python_storage// Implementataions // template -inline rvalue_from_python_data ::rvalue_from_python_data(rvalue_from_python_stage1_data const& _stage1) +inline rvalue_from_python_data ::rvalue_from_python_data(rvalue_from_python_stage1_data const& stage1) { - this->stage1 = _stage1; + this->stage1 = stage1; } template diff --git a/include/boost/python/data_members.hpp b/include/boost/python/data_members.hpp index b0851fb1..8cbc0ac3 100644 --- a/include/boost/python/data_members.hpp +++ b/include/boost/python/data_members.hpp @@ -265,8 +265,7 @@ inline object make_getter(D const& d, Policies const& policies) template inline object make_getter(D& x) { - detail::not_specified policy - = detail::not_specified(); // suppress a SunPro warning + detail::not_specified policy; return detail::make_getter(x, policy, is_member_pointer (), 0L); } @@ -274,8 +273,7 @@ inline object make_getter(D& x) template inline object make_getter(D const& d) { - detail::not_specified policy - = detail::not_specified(); // Suppress a SunPro warning + detail::not_specified policy; return detail::make_getter(d, policy, is_member_pointer (), 0L); } # endif diff --git a/include/boost/python/detail/result.hpp b/include/boost/python/detail/result.hpp index 9b8b4864..80e4387f 100644 --- a/include/boost/python/detail/result.hpp +++ b/include/boost/python/detail/result.hpp @@ -86,10 +86,7 @@ result(X const&, short = 0) { return 0; } # endif // RESULT_DWA2002521_HPP /* --------------- function pointers --------------- */ -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) # line BOOST_PP_LINE(__LINE__, result.hpp(function pointers)) @@ -131,5 +128,4 @@ boost::type * result(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q, int = 0) # undef N # undef Q -#endif // BOOST_PP_ITERATION_DEPTH() #endif diff --git a/include/boost/python/detail/target.hpp b/include/boost/python/detail/target.hpp index 137801bb..5079699a 100644 --- a/include/boost/python/detail/target.hpp +++ b/include/boost/python/detail/target.hpp @@ -37,10 +37,7 @@ T& (* target(R (T::*)) )() { return 0; } # endif // TARGET_DWA2002521_HPP /* --------------- function pointers --------------- */ -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) # line BOOST_PP_LINE(__LINE__, target.hpp(function_pointers)) @@ -82,5 +79,4 @@ T& (* target(R (T::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)) Q) )() # undef N # undef Q -#endif // BOOST_PP_ITERATION_DEPTH() #endif diff --git a/include/boost/python/object/class_metadata.hpp b/include/boost/python/object/class_metadata.hpp index 0738bbe3..05740b8e 100644 --- a/include/boost/python/object/class_metadata.hpp +++ b/include/boost/python/object/class_metadata.hpp @@ -236,7 +236,7 @@ struct class_metadata // // Support for converting smart pointers to python // - inline static void maybe_register_pointer_to_python(...) {} + inline static void maybe_register_pointer_to_python(void*,void*,void*) {} #ifndef BOOST_PYTHON_NO_PY_SYGNATURES inline static void maybe_register_pointer_to_python(void*,void*,mpl::true_*) diff --git a/include/boost/python/object/make_holder.hpp b/include/boost/python/object/make_holder.hpp index eb3c603d..9d5de98d 100644 --- a/include/boost/python/object/make_holder.hpp +++ b/include/boost/python/object/make_holder.hpp @@ -47,10 +47,7 @@ template struct make_holder; # endif // MAKE_HOLDER_DWA20011215_HPP -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 +#elif BOOST_PP_ITERATION_DEPTH() == 1 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) # line BOOST_PP_LINE(__LINE__, make_holder.hpp) @@ -105,5 +102,4 @@ struct make_holder # undef N -#endif // BOOST_PP_ITERATION_DEPTH() #endif diff --git a/include/boost/python/object/pointer_holder.hpp b/include/boost/python/object/pointer_holder.hpp index 2dc6dda9..7fad2a25 100644 --- a/include/boost/python/object/pointer_holder.hpp +++ b/include/boost/python/object/pointer_holder.hpp @@ -127,14 +127,7 @@ void* pointer_holder ::holds(type_info dst_t, bool null_ptr_only) ) return &this->m_p; - Value* p -# if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) - = static_cast ( get_pointer(this->m_p) ) -# else - = get_pointer(this->m_p) -# endif - ; - + Value* p = get_pointer(this->m_p); if (p == 0) return 0; @@ -170,10 +163,7 @@ void* pointer_holder_back_reference ::holds(type_info dst_t, bool # endif // POINTER_HOLDER_DWA20011215_HPP /* --------------- pointer_holder --------------- */ -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == 1 +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == 1 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) # line BOOST_PP_LINE(__LINE__, pointer_holder.hpp) @@ -215,5 +205,4 @@ void* pointer_holder_back_reference ::holds(type_info dst_t, bool # undef N -#endif // BOOST_PP_ITERATION_DEPTH() #endif diff --git a/include/boost/python/object/value_holder.hpp b/include/boost/python/object/value_holder.hpp index f4d452ca..e53866a1 100644 --- a/include/boost/python/object/value_holder.hpp +++ b/include/boost/python/object/value_holder.hpp @@ -117,10 +117,7 @@ void* value_holder_back_reference ::holds( // --------------- value_holder --------------- -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == 1 +#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == 1 # if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100) \ && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201))) # line BOOST_PP_LINE(__LINE__, value_holder.hpp(value_holder)) @@ -166,5 +163,4 @@ void* value_holder_back_reference ::holds( # undef N -#endif // BOOST_PP_ITERATION_DEPTH() #endif diff --git a/include/boost/python/object_core.hpp b/include/boost/python/object_core.hpp index 0342ef2e..b4a0ea82 100644 --- a/include/boost/python/object_core.hpp +++ b/include/boost/python/object_core.hpp @@ -42,12 +42,6 @@ namespace boost { namespace python { -namespace detail -{ - class kwds_proxy; - class args_proxy; -} - namespace converter { template struct arg_to_python; @@ -108,11 +102,6 @@ namespace api # define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PYTHON_MAX_ARITY, )) # include BOOST_PP_ITERATE() - - detail::args_proxy operator* () const; - object operator()(detail::args_proxy const &args) const; - object operator()(detail::args_proxy const &args, - detail::kwds_proxy const &kwds) const; // truth value testing // @@ -230,11 +219,11 @@ namespace api inline object_base(object_base const&); inline object_base(PyObject* ptr); - inline object_base& operator=(object_base const& rhs); - inline ~object_base(); + object_base& operator=(object_base const& rhs); + ~object_base(); // Underlying object access -- returns a borrowed reference - inline PyObject* ptr() const; + PyObject* ptr() const; private: PyObject* m_ptr; @@ -404,7 +393,7 @@ namespace api static PyObject* get(T const& x, U) { - return python::incref(get_managed_object(x, boost::python::tag)); + return python::incref(get_managed_object(x, tag)); } }; @@ -427,62 +416,6 @@ template struct extract; // implementation // -namespace detail -{ - -class call_proxy -{ -public: - call_proxy(object target) : m_target(target) {} - operator object() const { return m_target;} - - private: - object m_target; -}; - -class kwds_proxy : public call_proxy -{ -public: - kwds_proxy(object o = object()) : call_proxy(o) {} -}; -class args_proxy : public call_proxy -{ -public: - args_proxy(object o) : call_proxy(o) {} - kwds_proxy operator* () const { return kwds_proxy(*this);} -}; -} - -template -detail::args_proxy api::object_operators::operator* () const -{ - object_cref2 x = *static_cast(this); - return boost::python::detail::args_proxy(x); -} - -template -object api::object_operators::operator()(detail::args_proxy const &args) const -{ - U const& self = *static_cast(this); - PyObject *result = PyObject_Call(get_managed_object(self, boost::python::tag), - args.operator object().ptr(), - 0); - return object(boost::python::detail::new_reference(result)); - -} - -template -object api::object_operators::operator()(detail::args_proxy const &args, - detail::kwds_proxy const &kwds) const -{ - U const& self = *static_cast(this); - PyObject *result = PyObject_Call(get_managed_object(self, boost::python::tag), - args.operator object().ptr(), - kwds.operator object().ptr()); - return object(boost::python::detail::new_reference(result)); - -} - inline object::object() : object_base(python::incref(Py_None)) {} diff --git a/include/boost/python/object_protocol.hpp b/include/boost/python/object_protocol.hpp index 7c1c0283..e8d35866 100644 --- a/include/boost/python/object_protocol.hpp +++ b/include/boost/python/object_protocol.hpp @@ -10,11 +10,9 @@ # include # include -# include - namespace boost { namespace python { namespace api { -# if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) +# if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580) // attempt to use SFINAE to prevent functions accepting T const& from // coming up as ambiguous with the one taking a char const* when a // string literal is passed @@ -24,45 +22,45 @@ namespace boost { namespace python { namespace api { # endif template -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 -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 -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 -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 -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 -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 -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)); } diff --git a/include/boost/python/object_slices.hpp b/include/boost/python/object_slices.hpp index 748c2e95..e70faff7 100644 --- a/include/boost/python/object_slices.hpp +++ b/include/boost/python/object_slices.hpp @@ -27,12 +27,6 @@ struct slice_policies : const_slice_policies static void del(object const& target, key_type const& key); }; -template -inline slice_policies::key_type slice_key(T x, U y) -{ - return slice_policies::key_type(handle<>(x), handle<>(y)); -} - // // implementation // @@ -41,7 +35,7 @@ object_slice object_operators::slice(object_cref start, object_cref finish) { object_cref2 x = *static_cast(this); - return object_slice(x, api::slice_key(borrowed(start.ptr()), borrowed(finish.ptr()))); + return object_slice(x, std::make_pair(borrowed(start.ptr()), borrowed(finish.ptr()))); } template @@ -49,7 +43,7 @@ const_object_slice object_operators::slice(object_cref start, object_cref finish) const { object_cref2 x = *static_cast(this); - return const_object_slice(x, api::slice_key(borrowed(start.ptr()), borrowed(finish.ptr()))); + return const_object_slice(x, std::make_pair(borrowed(start.ptr()), borrowed(finish.ptr()))); } template @@ -57,7 +51,7 @@ object_slice object_operators::slice(slice_nil, object_cref finish) { object_cref2 x = *static_cast(this); - return object_slice(x, api::slice_key(allow_null((PyObject*)0), borrowed(finish.ptr()))); + return object_slice(x, std::make_pair(allow_null((PyObject*)0), borrowed(finish.ptr()))); } template @@ -65,7 +59,7 @@ const_object_slice object_operators::slice(slice_nil, object_cref finish) const { object_cref2 x = *static_cast(this); - return const_object_slice(x, api::slice_key(allow_null((PyObject*)0), borrowed(finish.ptr()))); + return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), borrowed(finish.ptr()))); } template @@ -73,7 +67,7 @@ object_slice object_operators::slice(slice_nil, slice_nil) { object_cref2 x = *static_cast(this); - return object_slice(x, api::slice_key(allow_null((PyObject*)0), allow_null((PyObject*)0))); + return object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0))); } template @@ -81,7 +75,7 @@ const_object_slice object_operators::slice(slice_nil, slice_nil) const { object_cref2 x = *static_cast(this); - return const_object_slice(x, api::slice_key(allow_null((PyObject*)0), allow_null((PyObject*)0))); + return const_object_slice(x, std::make_pair(allow_null((PyObject*)0), allow_null((PyObject*)0))); } template @@ -89,7 +83,7 @@ object_slice object_operators::slice(object_cref start, slice_nil) { object_cref2 x = *static_cast(this); - return object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0))); + return object_slice(x, std::make_pair(borrowed(start.ptr()), allow_null((PyObject*)0))); } template @@ -97,7 +91,7 @@ const_object_slice object_operators::slice(object_cref start, slice_nil) const { object_cref2 x = *static_cast(this); - return const_object_slice(x, api::slice_key(borrowed(start.ptr()), allow_null((PyObject*)0))); + return const_object_slice(x, std::make_pair(borrowed(start.ptr()), allow_null((PyObject*)0))); } # if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 template diff --git a/include/boost/python/signature.hpp b/include/boost/python/signature.hpp index 1bb2b226..c4151814 100644 --- a/include/boost/python/signature.hpp +++ b/include/boost/python/signature.hpp @@ -113,10 +113,7 @@ struct most_derived # endif // SIGNATURE_JDG20020813_HPP -// For gcc 4.4 compatability, we must include the -// BOOST_PP_ITERATION_DEPTH test inside an #else clause. -#else // BOOST_PP_IS_ITERATING -#if BOOST_PP_ITERATION_DEPTH() == 1 // defined(BOOST_PP_IS_ITERATING) +#elif BOOST_PP_ITERATION_DEPTH() == 1 // defined(BOOST_PP_IS_ITERATING) # define N BOOST_PP_ITERATION() @@ -179,5 +176,4 @@ get_signature( # undef Q # undef N -#endif // BOOST_PP_ITERATION_DEPTH() #endif // !defined(BOOST_PP_IS_ITERATING) diff --git a/src/dict.cpp b/src/dict.cpp index 441b0257..ee2ee29f 100644 --- a/src/dict.cpp +++ b/src/dict.cpp @@ -29,7 +29,7 @@ namespace detail::new_reference dict_base::call(object const& arg_) { return (detail::new_reference)PyObject_CallFunction( - (PyObject*)&PyDict_Type, const_cast ("(O)"), + (PyObject*)&PyDict_Type, "(O)", arg_.ptr()); } diff --git a/src/exec.cpp b/src/exec.cpp index 6c30797a..050cc63e 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -39,7 +39,7 @@ object BOOST_PYTHON_DECL exec_file(str filename, object global, object local) // should be 'char const *' but older python versions don't use 'const' yet. char *f = python::extract (filename); // Let python open the file to avoid potential binary incompatibilities. - PyObject *pyfile = PyFile_FromString(f, const_cast ("r")); + PyObject *pyfile = PyFile_FromString(f, "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()), diff --git a/src/list.cpp b/src/list.cpp index 2c29251b..3c26950e 100644 --- a/src/list.cpp +++ b/src/list.cpp @@ -13,7 +13,7 @@ detail::new_non_null_reference list_base::call(object const& arg_) return (detail::new_non_null_reference) (expect_non_null)( PyObject_CallFunction( - (PyObject*)&PyList_Type, const_cast ("(O)"), + (PyObject*)&PyList_Type, "(O)", arg_.ptr())); } diff --git a/src/long.cpp b/src/long.cpp index 1ec8ebc0..a534bf29 100644 --- a/src/long.cpp +++ b/src/long.cpp @@ -9,21 +9,21 @@ namespace boost { namespace python { namespace detail { new_non_null_reference long_base::call(object const& arg_) { return (detail::new_non_null_reference)PyObject_CallFunction( - (PyObject*)&PyLong_Type, const_cast ("(O)"), + (PyObject*)&PyLong_Type, "(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, const_cast ("(OO)"), + (PyObject*)&PyLong_Type, "(OO)", arg_.ptr(), base.ptr()); } long_base::long_base() : object( detail::new_reference( - PyObject_CallFunction((PyObject*)&PyLong_Type, const_cast ("()"))) + PyObject_CallFunction((PyObject*)&PyLong_Type, "()")) ) {} diff --git a/src/object/class.cpp b/src/object/class.cpp index a05851ef..9daf42b7 100644 --- a/src/object/class.cpp +++ b/src/object/class.cpp @@ -74,7 +74,7 @@ extern "C" { propertyobject *gs = (propertyobject *)self; - return PyObject_CallFunction(gs->prop_get, const_cast ("()")); + return PyObject_CallFunction(gs->prop_get, "()"); } static int @@ -95,9 +95,9 @@ extern "C" return -1; } if (value == NULL) - res = PyObject_CallFunction(func, const_cast ("()")); + res = PyObject_CallFunction(func, "()"); else - res = PyObject_CallFunction(func, const_cast ("(O)"), value); + res = PyObject_CallFunction(func, "(O)", value); if (res == NULL) return -1; Py_DECREF(res); @@ -108,7 +108,7 @@ extern "C" static PyTypeObject static_data_object = { PyObject_HEAD_INIT(0)//&PyType_Type) 0, - const_cast ("Boost.Python.StaticProperty"), + "Boost.Python.StaticProperty", PyType_Type.tp_basicsize, 0, 0, /* tp_dealloc */ @@ -212,7 +212,7 @@ extern "C" static PyTypeObject class_metatype_object = { PyObject_HEAD_INIT(0)//&PyType_Type) 0, - const_cast ("Boost.Python.class"), + "Boost.Python.class", PyType_Type.tp_basicsize, 0, 0, /* tp_dealloc */ @@ -316,7 +316,7 @@ namespace objects { // Attempt to find the __instance_size__ attribute. If not present, no problem. PyObject* d = type_->tp_dict; - PyObject* instance_size_obj = PyObject_GetAttrString(d, const_cast ("__instance_size__")); + PyObject* instance_size_obj = PyObject_GetAttrString(d, "__instance_size__"); long instance_size = instance_size_obj ? PyInt_AsLong(instance_size_obj) : 0; @@ -357,20 +357,20 @@ namespace objects static PyGetSetDef instance_getsets[] = { - {const_cast ("__dict__"), instance_get_dict, instance_set_dict, NULL, 0}, + {"__dict__", instance_get_dict, instance_set_dict, NULL, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef instance_members[] = { - {const_cast ("__weakref__"), T_OBJECT, offsetof(instance<>, weakrefs), 0, 0}, + {"__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, - const_cast ("Boost.Python.instance"), + "Boost.Python.instance", offsetof(instance<>,storage), /* tp_basicsize */ 1, /* tp_itemsize */ instance_dealloc, /* tp_dealloc */ @@ -572,7 +572,7 @@ namespace objects { object property( (python::detail::new_reference) - PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast ("Osss"), fget.ptr(), 0, 0, docstr)); + PyObject_CallFunction((PyObject*)&PyProperty_Type, "Osss", fget.ptr(), 0, 0, docstr)); this->setattr(name, property); } @@ -582,7 +582,7 @@ namespace objects { object property( (python::detail::new_reference) - PyObject_CallFunction((PyObject*)&PyProperty_Type, const_cast ("OOss"), fget.ptr(), fset.ptr(), 0, docstr)); + PyObject_CallFunction((PyObject*)&PyProperty_Type, "OOss", fget.ptr(), fset.ptr(), 0, docstr)); this->setattr(name, property); } @@ -591,7 +591,7 @@ namespace objects { object property( (python::detail::new_reference) - PyObject_CallFunction(static_data(), const_cast ("O"), fget.ptr())); + PyObject_CallFunction(static_data(), "O", fget.ptr())); this->setattr(name, property); } @@ -600,7 +600,7 @@ namespace objects { object property( (python::detail::new_reference) - PyObject_CallFunction(static_data(), const_cast ("OO"), fget.ptr(), fset.ptr())); + PyObject_CallFunction(static_data(), "OO", fget.ptr(), fset.ptr())); this->setattr(name, property); } @@ -615,13 +615,13 @@ namespace objects { extern "C" PyObject* no_init(PyObject*, PyObject*) { - ::PyErr_SetString(::PyExc_RuntimeError, const_cast ("This class cannot be instantiated from Python")); + ::PyErr_SetString(::PyExc_RuntimeError, "This class cannot be instantiated from Python"); return NULL; } static ::PyMethodDef no_init_def = { - const_cast ("__init__"), no_init, METH_VARARGS, - const_cast ("Raises an exception\n" - "This class cannot be instantiated from Python\n") + "__init__", no_init, METH_VARARGS, + "Raises an exception\n" + "This class cannot be instantiated from Python\n" }; } @@ -650,7 +650,7 @@ namespace objects ::PyErr_Format( PyExc_TypeError - , const_cast ("staticmethod expects callable object; got an object of type %s, which is not callable") + , "staticmethod expects callable object; got an object of type %s, which is not callable" , callable->ob_type->tp_name ); diff --git a/src/object/enum.cpp b/src/object/enum.cpp index f95dba03..2fb215ca 100644 --- a/src/object/enum.cpp +++ b/src/object/enum.cpp @@ -23,7 +23,7 @@ struct enum_object }; static PyMemberDef enum_members[] = { - {const_cast ("name"), T_OBJECT_EX, offsetof(enum_object,name),READONLY, 0}, + {"name", T_OBJECT_EX, offsetof(enum_object,name),READONLY, 0}, {0, 0, 0, 0, 0} }; @@ -32,7 +32,7 @@ extern "C" { static PyObject* enum_repr(PyObject* self_) { - const char *mod = PyString_AsString(PyObject_GetAttrString( self_, const_cast ("__module__"))); + const char *mod = PyString_AsString(PyObject_GetAttrString( self_, "__module__")); enum_object* self = downcast (self_); if (!self->name) { @@ -65,7 +65,7 @@ extern "C" static PyTypeObject enum_type_object = { PyObject_HEAD_INIT(0) // &PyType_Type 0, - const_cast ("Boost.Python.enum"), + "Boost.Python.enum", sizeof(enum_object), /* tp_basicsize */ 0, /* tp_itemsize */ 0, /* tp_dealloc */ diff --git a/src/object/function.cpp b/src/object/function.cpp index 64dc3846..2285ae10 100644 --- a/src/object/function.cpp +++ b/src/object/function.cpp @@ -297,7 +297,7 @@ object function::signatures(bool show_return_type) const void function::argument_error(PyObject* args, PyObject* /*keywords*/) const { static handle<> exception( - PyErr_NewException(const_cast ("Boost.Python.ArgumentError"), PyExc_TypeError, 0)); + PyErr_NewException("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 @@ void function::add_to_namespace( else if (PyType_Check(ns)) dict = ((PyTypeObject*)ns)->tp_dict; else - dict = PyObject_GetAttrString(ns, const_cast ("__dict__")); + dict = PyObject_GetAttrString(ns, "__dict__"); if (dict == 0) throw_error_already_set(); @@ -487,7 +487,7 @@ void function::add_to_namespace( new_func->m_name = name; handle<> name_space_name( - allow_null(::PyObject_GetAttrString(name_space.ptr(), const_cast ("__name__")))); + allow_null(::PyObject_GetAttrString(name_space.ptr(), "__name__"))); if (name_space_name) new_func->m_namespace = object(name_space_name); @@ -656,18 +656,18 @@ extern "C" } static PyGetSetDef function_getsetlist[] = { - {const_cast ("__name__"), (getter)function_get_name, 0, 0, 0 }, - {const_cast ("func_name"), (getter)function_get_name, 0, 0, 0 }, - {const_cast ("__class__"), (getter)function_get_class, 0, 0, 0 }, // see note above - {const_cast ("__doc__"), (getter)function_get_doc, (setter)function_set_doc, 0, 0}, - {const_cast ("func_doc"), (getter)function_get_doc, (setter)function_set_doc, 0, 0}, + {"__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}, {NULL, 0, 0, 0, 0} /* Sentinel */ }; PyTypeObject function_type = { PyObject_HEAD_INIT(0) 0, - const_cast ("Boost.Python.function"), + "Boost.Python.function", sizeof(function), 0, (destructor)function_dealloc, /* tp_dealloc */ @@ -753,8 +753,7 @@ namespace detail } void BOOST_PYTHON_DECL pure_virtual_called() { - PyErr_SetString( - PyExc_RuntimeError, const_cast ("Pure virtual function called")); + PyErr_SetString(PyExc_RuntimeError, "Pure virtual function called"); throw_error_already_set(); } } diff --git a/src/object/life_support.cpp b/src/object/life_support.cpp index 013253b5..a1768cba 100644 --- a/src/object/life_support.cpp +++ b/src/object/life_support.cpp @@ -38,7 +38,7 @@ extern "C" PyTypeObject life_support_type = { PyObject_HEAD_INIT(0)//(&PyType_Type) 0, - const_cast ("Boost.Python.life_support"), + "Boost.Python.life_support", sizeof(life_support), 0, life_support_dealloc, /* tp_dealloc */ diff --git a/src/object/stl_iterator.cpp b/src/object/stl_iterator.cpp index e32d3214..e2b66cea 100644 --- a/src/object/stl_iterator.cpp +++ b/src/object/stl_iterator.cpp @@ -2,10 +2,6 @@ // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// -// Credits: -// Andreas Kl\:ockner for fixing increment() to handle -// error conditions. #include #include @@ -31,8 +27,6 @@ void stl_input_iterator_impl::increment() { this->ob_ = boost::python::handle<>( boost::python::allow_null(PyIter_Next(this->it_.ptr()))); - if (PyErr_Occurred()) - throw boost::python::error_already_set(); } bool stl_input_iterator_impl::equal(stl_input_iterator_impl const &that) const diff --git a/src/str.cpp b/src/str.cpp index a7646866..7ee748a3 100644 --- a/src/str.cpp +++ b/src/str.cpp @@ -10,7 +10,7 @@ namespace boost { namespace python { namespace detail { detail::new_reference str_base::call(object const& arg_) { return (detail::new_reference)PyObject_CallFunction( - (PyObject*)&PyString_Type, const_cast ("(O)"), + (PyObject*)&PyString_Type, "(O)", arg_.ptr()); } @@ -68,9 +68,8 @@ str str_base:: name ( BOOST_PP_ENUM_PARAMS(arity, object_cref x) ) const return str(new_reference( \ expect_non_null( \ PyObject_CallMethod( \ - this->ptr(), const_cast ( #name ), \ - const_cast ( \ - "(" BOOST_PP_REPEAT(arity, BOOST_PYTHON_FORMAT_OBJECT, _) ")") \ + this->ptr(), #name, \ + "(" BOOST_PP_REPEAT(arity, BOOST_PYTHON_FORMAT_OBJECT, _) ")" \ BOOST_PP_REPEAT_1(arity, BOOST_PYTHON_OBJECT_PTR, _))))); \ } diff --git a/src/tuple.cpp b/src/tuple.cpp index 6719713b..b5696504 100644 --- a/src/tuple.cpp +++ b/src/tuple.cpp @@ -9,7 +9,7 @@ namespace boost { namespace python { namespace detail { detail::new_reference tuple_base::call(object const& arg_) { return (detail::new_reference)PyObject_CallFunction( - (PyObject*)&PyTuple_Type, const_cast ("(O)"), + (PyObject*)&PyTuple_Type, "(O)", arg_.ptr()); } diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 4e1479b4..3e4f3cc1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -42,7 +42,7 @@ test-suite python : [ - run exec.cpp /boost/python//boost_python/static $(PY) + run exec.cpp ../build//boost_python/static $(PY) : # program args : exec.py # input files : # requirements @@ -171,8 +171,7 @@ bpl-test crossmod_opaque /boost/python//boost_python ] [ bpl-test map_indexing_suite : map_indexing_suite.py map_indexing_suite_ext ] - -[ run import_.cpp /boost/python//boost_python $(PY) : : import_.py ] +[ py-run import_.cpp : import_.py ] # if $(TEST_BIENSTMAN_NON_BUGS) # { diff --git a/test/andreas_beyer.cpp b/test/andreas_beyer.cpp index b28b1566..da3aa751 100644 --- a/test/andreas_beyer.cpp +++ b/test/andreas_beyer.cpp @@ -25,8 +25,8 @@ class B { 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; diff --git a/test/back_reference.cpp b/test/back_reference.cpp index 266ed291..b5d1378c 100644 --- a/test/back_reference.cpp +++ b/test/back_reference.cpp @@ -27,7 +27,7 @@ struct X 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: diff --git a/test/callbacks.cpp b/test/callbacks.cpp index 66bd3524..255ed1b7 100644 --- a/test/callbacks.cpp +++ b/test/callbacks.cpp @@ -34,7 +34,7 @@ struct X 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: diff --git a/test/complicated.hpp b/test/complicated.hpp index 5ff19aea..5c15e80a 100644 --- a/test/complicated.hpp +++ b/test/complicated.hpp @@ -19,10 +19,10 @@ struct complicated 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() diff --git a/test/exec.cpp b/test/exec.cpp index 31883d89..bad33c6f 100644 --- a/test/exec.cpp +++ b/test/exec.cpp @@ -59,7 +59,7 @@ void eval_test() void exec_test() { // Register the module with the interpreter - if (PyImport_AppendInittab(const_cast ("embedded_hello"), initembedded_hello) == -1) + if (PyImport_AppendInittab("embedded_hello", initembedded_hello) == -1) throw std::runtime_error("Failed to add embedded_hello to the interpreter's " "builtin modules"); // Retrieve the main module diff --git a/test/m1.cpp b/test/m1.cpp index ff075076..407924fe 100644 --- a/test/m1.cpp +++ b/test/m1.cpp @@ -34,7 +34,7 @@ struct NoddyObject : PyObject PyTypeObject NoddyType = { PyObject_HEAD_INIT(NULL) 0, - const_cast ("Noddy"), + "Noddy", sizeof(NoddyObject), 0, dealloc, /* tp_dealloc */ @@ -106,7 +106,7 @@ struct extract_simple_object PyTypeObject SimpleType = { PyObject_HEAD_INIT(NULL) 0, - const_cast ("Simple"), + "Simple", sizeof(SimpleObject), 0, dealloc, /* tp_dealloc */ @@ -159,7 +159,7 @@ PyTypeObject SimpleType = { PyObject* new_simple() { SimpleObject* simple = PyObject_New(SimpleObject, &SimpleType); - simple->x.s = const_cast ("hello, world"); + simple->x.s = "hello, world"; return (PyObject*)simple; } diff --git a/test/object.cpp b/test/object.cpp index b1f01518..04afe841 100644 --- a/test/object.cpp +++ b/test/object.cpp @@ -187,11 +187,6 @@ bool check_string_slice() return s.slice(2,-1).slice(1,-1) == "lo, wor"; } -object test_call(object c, object args, object kwds) -{ - return c(*args, **kwds); -} - bool check_binary_operators() { int y; @@ -382,7 +377,6 @@ BOOST_PYTHON_MODULE(object_ext) def("test_item", test_item); def("test_not_item", test_not_item); - def("test_call", test_call); def("check_binary_operators", check_binary_operators); def("check_inplace", check_inplace); def("check_string_slice", check_string_slice); diff --git a/test/object.py b/test/object.py index 84972e64..82634082 100644 --- a/test/object.py +++ b/test/object.py @@ -134,12 +134,7 @@ Operators ->>> def print_args(*args, **kwds): -... print args, kwds ->>> test_call(print_args, (0, 1, 2, 3), {'a':'A'}) -(0, 1, 2, 3) {'a': 'A'} - - + >>> assert check_binary_operators() >>> class X: pass diff --git a/test/pickle1.cpp b/test/pickle1.cpp index 7988f211..28845fc9 100644 --- a/test/pickle1.cpp +++ b/test/pickle1.cpp @@ -27,8 +27,8 @@ namespace boost_python_test { 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; } diff --git a/test/pickle2.cpp b/test/pickle2.cpp index 7cdf05f0..1c08cbd0 100644 --- a/test/pickle2.cpp +++ b/test/pickle2.cpp @@ -34,8 +34,8 @@ namespace boost_python_test { 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; } diff --git a/test/pickle3.cpp b/test/pickle3.cpp index 14b0dbdd..6472def8 100644 --- a/test/pickle3.cpp +++ b/test/pickle3.cpp @@ -35,8 +35,8 @@ namespace boost_python_test { 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; } diff --git a/test/pickle4.cpp b/test/pickle4.cpp index 1374cc7d..d9758c28 100644 --- a/test/pickle4.cpp +++ b/test/pickle4.cpp @@ -23,8 +23,8 @@ namespace boost_python_test { 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; } diff --git a/test/slice.cpp b/test/slice.cpp index 032bf7cf..8b1d1bf5 100644 --- a/test/slice.cpp +++ b/test/slice.cpp @@ -100,11 +100,7 @@ bool accept_slice( slice) { return true; } || BOOST_WORKAROUND( BOOST_INTEL_WIN, == 710) int check_slice_get_indicies(slice index); #endif -int check_slice_get_indicies( -#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) - const -#endif - slice index) +int check_slice_get_indicies(const slice index) { // A vector of integers from [-5, 5]. std::vector coll(11); diff --git a/test/staticmethod.cpp b/test/staticmethod.cpp index dcd75ca8..5947e538 100644 --- a/test/staticmethod.cpp +++ b/test/staticmethod.cpp @@ -20,7 +20,7 @@ struct X 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: diff --git a/test/stl_iterator.py b/test/stl_iterator.py index 2c324c0a..c044e85a 100644 --- a/test/stl_iterator.py +++ b/test/stl_iterator.py @@ -12,16 +12,6 @@ 3 4 5 ->>> def generator(): -... yield 1 -... yield 2 -... raise RuntimeError, "oops" ->>> try: -... x.assign(iter(generator())) -... print "NOT OK" -... except RuntimeError: -... print "OK" -OK ''' def run(args = None): import sys diff --git a/test/test_class.hpp b/test/test_class.hpp index 5404fdba..6eb5e1e4 100644 --- a/test/test_class.hpp +++ b/test/test_class.hpp @@ -13,7 +13,7 @@ struct test_class 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; } diff --git a/test/test_pointer_adoption.cpp b/test/test_pointer_adoption.cpp index a4e14af5..eeda8a9b 100644 --- a/test/test_pointer_adoption.cpp +++ b/test/test_pointer_adoption.cpp @@ -65,7 +65,7 @@ struct B 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() { diff --git a/test/virtual_functions.cpp b/test/virtual_functions.cpp index 774b11b1..d871192a 100644 --- a/test/virtual_functions.cpp +++ b/test/virtual_functions.cpp @@ -22,7 +22,7 @@ struct X 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: