From 3b5636cb3306002a99487679408edf2b9faa124c Mon Sep 17 00:00:00 2001 From: nobody Date: Thu, 7 Jun 2007 20:53:46 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create tag 'merged_to_RC_1_34_0'. [SVN r37938] --- build/Jamfile | 7 +- build/Jamfile.v2 | 4 - doc/PyConDC_2003/bpl.html | 6 - doc/PyConDC_2003/bpl.txt | 4 - doc/PyConDC_2003/bpl_mods.txt | 4 - doc/PyConDC_2003/default.css | 2 - doc/boost.css | 4 - doc/building.html | 3 - doc/index.html | 3 - doc/polymorphism.txt | 5 - doc/projects.html | 5 +- doc/support.html | 3 - doc/tutorial/doc/Jamfile.v2 | 3 - doc/tutorial/doc/html/boostbook.css | 221 ++++++------------ doc/tutorial/doc/html/index.html | 9 +- doc/tutorial/doc/html/python/embedding.html | 76 +++--- doc/tutorial/doc/html/python/exception.html | 3 - doc/tutorial/doc/html/python/exposing.html | 52 +++-- doc/tutorial/doc/html/python/functions.html | 27 ++- doc/tutorial/doc/html/python/hello.html | 39 ++-- doc/tutorial/doc/html/python/iterators.html | 3 - doc/tutorial/doc/html/python/object.html | 30 +-- doc/tutorial/doc/html/python/techniques.html | 40 ++-- doc/tutorial/doc/tutorial.qbk | 2 +- doc/tutorial/index.html | 9 +- doc/v2/Apr2002.html | 3 - doc/v2/CallPolicies.html | 3 - doc/v2/Dereferenceable.html | 3 - doc/v2/Extractor.html | 3 - doc/v2/HolderGenerator.html | 3 - doc/v2/Jun2002.html | 3 - doc/v2/Mar2002.html | 3 - doc/v2/May2002.html | 3 - doc/v2/ObjectWrapper.html | 3 - doc/v2/ResultConverter.html | 3 - doc/v2/acknowledgments.html | 3 - doc/v2/args.html | 3 - doc/v2/call.html | 3 - doc/v2/call_method.html | 3 - doc/v2/callbacks.html | 3 - doc/v2/callbacks.txt | 4 - doc/v2/class.html | 3 - doc/v2/configuration.html | 3 - doc/v2/copy_const_reference.html | 3 - doc/v2/copy_non_const_reference.html | 3 - doc/v2/data_members.html | 3 - doc/v2/def.html | 3 - doc/v2/def_visitor.html | 4 +- doc/v2/default_call_policies.html | 6 +- doc/v2/definitions.html | 3 - doc/v2/dict.html | 3 - doc/v2/docstring_options.html | 3 - doc/v2/enum.html | 3 - doc/v2/errors.html | 3 - doc/v2/exception_translator.html | 3 - doc/v2/exec.html | 3 - doc/v2/extract.html | 3 - doc/v2/faq.html | 3 - doc/v2/feb2002.html | 7 +- doc/v2/handle.html | 3 - doc/v2/has_back_reference.html | 3 - doc/v2/implicit.html | 3 - doc/v2/import.html | 3 - doc/v2/index.html | 3 - doc/v2/indexing.html | 3 - doc/v2/init.html | 3 - doc/v2/instance_holder.html | 3 - doc/v2/iterator.html | 3 - doc/v2/list.html | 3 - doc/v2/long.html | 3 - doc/v2/lvalue_from_pytype.html | 3 - doc/v2/make_function.html | 3 - doc/v2/manage_new_object.html | 3 - doc/v2/module.html | 4 +- doc/v2/opaque_pointer_converter.html | 142 +++++++++++ doc/v2/operators.html | 15 -- doc/v2/overloads.html | 3 - doc/v2/pickle.html | 8 +- doc/v2/platforms.html | 3 - doc/v2/pointee.html | 5 +- doc/v2/progress_reports.html | 3 - doc/v2/ptr.html | 4 +- doc/v2/python.html | 3 - doc/v2/raw_function.html | 3 - doc/v2/reference.html | 10 - doc/v2/reference_existing_object.html | 3 - doc/v2/register_ptr_to_python.html | 3 - doc/v2/return_arg.html | 3 - doc/v2/return_by_value.html | 3 - doc/v2/return_internal_reference.html | 3 - doc/v2/return_value_policy.html | 3 - doc/v2/scope.html | 3 - doc/v2/slice.html | 3 - doc/v2/ssize_t.html | 96 -------- doc/v2/stl_iterator.html | 3 - doc/v2/str.html | 3 - doc/v2/to_python_converter.html | 3 - doc/v2/to_python_indirect.html | 4 +- doc/v2/to_python_value.html | 4 +- doc/v2/tuple.html | 3 - doc/v2/type_id.html | 4 +- doc/v2/with_custodian_and_ward.html | 3 - doc/v2/wrapper.html | 4 +- example/Jamfile | 5 +- example/Jamroot | 40 ++++ example/README | 19 +- example/boost-build.jam | 4 +- example/tutorial/Jamroot | 18 ++ .../python/converter/builtin_converters.hpp | 5 +- include/boost/python/converter/implicit.hpp | 6 +- .../boost/python/converter/registrations.hpp | 1 - include/boost/python/detail/config.hpp | 20 ++ include/boost/python/detail/operator_id.hpp | 3 +- include/boost/python/detail/python22_fixed.h | 2 - .../boost/python/detail/unwrap_wrapper.hpp | 30 ++- include/boost/python/detail/wrap_python.hpp | 2 +- include/boost/python/docstring_options.hpp | 2 +- include/boost/python/list.hpp | 9 +- include/boost/python/numeric.hpp | 2 +- include/boost/python/object.hpp | 6 +- .../boost/python/object/pointer_holder.hpp | 2 +- include/boost/python/operators.hpp | 20 +- include/boost/python/ssize_t.hpp | 29 --- .../python/suite/indexing/indexing_suite.hpp | 2 +- include/boost/python/type_id.hpp | 2 +- .../boost/python/with_custodian_and_ward.hpp | 2 +- index.html | 3 - pyste/NEWS | 4 - pyste/README | 4 - pyste/TODO | 4 - pyste/dist/create_build.py | 4 - pyste/dist/setup.py | 4 - pyste/doc/adding_new_methods.html | 7 +- pyste/doc/exporting_an_entire_header.html | 7 +- pyste/doc/global_variables.html | 7 +- pyste/doc/inserting_code.html | 7 +- pyste/doc/introduction.html | 7 +- pyste/doc/policies.html | 7 +- pyste/doc/pyste.txt | 5 - pyste/doc/renaming_and_excluding.html | 7 +- pyste/doc/running_pyste.html | 7 +- pyste/doc/smart_pointers.html | 7 +- pyste/doc/templates.html | 7 +- pyste/doc/the_interface_files.html | 7 +- pyste/doc/theme/style.css | 8 - pyste/doc/wrappers.html | 7 +- pyste/index.html | 7 +- pyste/install/pyste.py | 4 - pyste/install/setup.py | 4 +- release_notes.txt | 6 - src/converter/registry.cpp | 18 -- src/converter/type_id.cpp | 14 +- src/exec.cpp | 6 +- src/list.cpp | 5 +- src/object/class.cpp | 11 +- src/object/function.cpp | 9 +- src/object/pickle_support.cpp | 17 -- src/object_protocol.cpp | 5 +- src/str.cpp | 22 +- test/andreas_beyer.cpp | 3 - test/args.py | 2 - test/crossmod_exception.py | 9 +- test/exec.cpp | 2 +- test/exec.py | 4 - test/keywords.cpp | 1 - test/keywords_test.py | 2 - test/map_indexing_suite.cpp | 68 ------ test/map_indexing_suite.py | 13 -- test/module_tail.cpp | 2 +- test/operators_wrapper.cpp | 42 ---- test/operators_wrapper.py | 11 - test/pickle1.cpp | 5 - test/pickle1.py | 5 - test/pointer_vector.cpp | 3 - test/vector_indexing_suite.cpp | 5 - test/vector_indexing_suite.py | 8 - test/voidptr.cpp | 16 +- 177 files changed, 606 insertions(+), 1145 deletions(-) create mode 100644 doc/v2/opaque_pointer_converter.html delete mode 100644 doc/v2/ssize_t.html create mode 100755 example/Jamroot create mode 100755 example/tutorial/Jamroot delete mode 100644 include/boost/python/ssize_t.hpp delete mode 100644 test/operators_wrapper.cpp delete mode 100644 test/operators_wrapper.py diff --git a/build/Jamfile b/build/Jamfile index 92f715c2..f4293c0d 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -1,6 +1,7 @@ -# Copyright David Abrahams 2001-2006. 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) +# (C) Copyright David Abrahams 2001. Permission to copy, use, modify, sell and +# distribute this software is granted provided this copyright notice appears +# in all copies. This software is provided "as is" without express or implied +# warranty, and with no claim as to its suitability for any purpose. # # Boost.Python library Jamfile diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 3987bb15..dbf0df00 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -1,7 +1,3 @@ -# Copyright David Abrahams 2001-2006. 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) - import os ; import modules ; diff --git a/doc/PyConDC_2003/bpl.html b/doc/PyConDC_2003/bpl.html index 32b655bd..4ee77260 100755 --- a/doc/PyConDC_2003/bpl.html +++ b/doc/PyConDC_2003/bpl.html @@ -1,11 +1,5 @@ - - - - - - - - - - - - - - - The SourceForge cctbx project is organized in modules to facilitate use in non-crystallographic applications. The scitbx module implements a general purpose array family for scientific applications and pure C++ - ports of FFTPACK and the L-BFGS quasi-Newton minimizer.

+ ports of FFTPACK and the LBFGS conjugate gradient minimizer.

EMSolve
diff --git a/doc/support.html b/doc/support.html index a71e9ecd..3a24c4aa 100644 --- a/doc/support.html +++ b/doc/support.html @@ -1,8 +1,5 @@ - - - - - @@ -34,7 +31,7 @@
-

+

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 ) @@ -97,7 +94,7 @@ (IDL).

- + Hello World

@@ -142,7 +139,7 @@

- +

Last revised: August 31, 2006 at 05:59:58 GMT

Last revised: February 14, 2006 at 02:23:06 GMT


diff --git a/doc/tutorial/doc/html/python/embedding.html b/doc/tutorial/doc/html/python/embedding.html index 79971d82..26eaff1e 100644 --- a/doc/tutorial/doc/html/python/embedding.html +++ b/doc/tutorial/doc/html/python/embedding.html @@ -1,6 +1,3 @@ - - - @@ -43,7 +40,7 @@ Python/C API at all. So stay tuned... smiley

- + Building embedded programs

@@ -87,7 +84,7 @@ exe embedded_program # name of the executable <find-library>$(PYTHON_EMBEDDED_LIBRARY) ;

- + Getting started

@@ -96,7 +93,9 @@ exe embedded_program # name of the executable

  1. - #include <boost/python.hpp>

    + +#include +  <boost/python.hpp>

  2. Call Py_Initialize() @@ -132,7 +131,7 @@ exe embedded_program # name of the executable automate the process.

    - + Reference-counting handles and objects

    @@ -166,17 +165,20 @@ exe embedded_program # name of the executable a new reference is PyRun_String which we'll discuss in the next section.

    -

    - note Handle is a class template, - so why haven't we been using any template parameters?

    - handle has a single template parameter specifying the - type of the managed object. This type is PyObject 99% - of the time, so the parameter was defaulted to PyObject - for convenience. Therefore we can use the shorthand handle<> - instead of the longer, but equivalent, handle<PyObject>. -

    +
    + + +
    note Handle is a class + template, so why haven't we been using any template + parameters?

    handle has a + single template parameter specifying the type of the managed object. + This type is PyObject 99% of the time, so the parameter + was defaulted to PyObject for convenience. Therefore + we can use the shorthand handle<> instead + of the longer, but equivalent, handle<PyObject>. +

    - + Running Python code

    @@ -199,7 +201,7 @@ exe embedded_program # name of the executable

    - + Start symbols

    @@ -272,16 +274,18 @@ exe embedded_program # name of the executable This should create a file called 'hello.txt' in the current directory containing a phrase that is well-known in programming circles.

    -

    - note Note that we wrap - the return value of PyRun_String - in a (nameless) handle even though we are not interested - in it. If we didn't do this, the the returned object would be kept alive - unnecessarily. Unless you want to be a Dr. Frankenstein, always wrap PyObject*s - in handles. -

    +
    + + +
    note Note that + we wrap the return value of PyRun_String + in a (nameless) handle even though we are not interested + in it. If we didn't do this, the the returned object would be kept + alive unnecessarily. Unless you want to be a Dr. Frankenstein, always + wrap PyObject*s in handles. +

    - + Beyond handles

    @@ -327,15 +331,17 @@ exe embedded_program # name of the executable int five_squared = extract<int>(result); -

    - note Note that object's - member function to return the wrapped PyObject* is called - ptr instead of get. This makes sense - if you take into account the different functions that object - and handle perform. -

    +
    + + +
    note Note that + object's member function to return the wrapped + PyObject* is called ptr instead + of get. This makes sense if you take into account + the different functions that object and handle + perform.

    - + Exception handling

    diff --git a/doc/tutorial/doc/html/python/exception.html b/doc/tutorial/doc/html/python/exception.html index 04033f03..d443959b 100644 --- a/doc/tutorial/doc/html/python/exception.html +++ b/doc/tutorial/doc/html/python/exception.html @@ -1,6 +1,3 @@ - - - diff --git a/doc/tutorial/doc/html/python/exposing.html b/doc/tutorial/doc/html/python/exposing.html index 42f188f3..fa5c1096 100644 --- a/doc/tutorial/doc/html/python/exposing.html +++ b/doc/tutorial/doc/html/python/exposing.html @@ -1,6 +1,3 @@ - - - @@ -382,10 +379,13 @@ The wrapper template makes the job of wrapping classes that are meant to overridden in Python, easier.

    -

    - alert MSVC6/7 Workaround
    -
    If you are using Microsoft Visual C++ 6 or 7, you have to write f as:

    return call<int>(this->get_override("f").ptr());. -

    +
    + + +
    alert MSVC6/7 Workaround
    +
    If you are using Microsoft Visual C++ 6 or 7, you have to write + f as:

    + return call<int>(this->get_override("f").ptr());.

    BaseWrap's overridden virtual member function f in effect calls the corresponding method of the Python object through get_override. @@ -403,10 +403,14 @@ that the function f is a pure virtual function.

    -

    - note member function and methods
    -
    Python, like many object oriented languages uses the term methods. Methods correspond roughly to C++'s member functions -

    +
    + + +
    note member function and + methods

    Python, like many object oriented languages + uses the term methods. Methods correspond + roughly to C++'s member functions +

@@ -460,11 +464,12 @@ we have to check if there is an override for f. If none, then we call Base::f().

-

- alert MSVC6/7 Workaround
-
If you are using Microsoft Visual C++ 6 or 7, you have to rewrite - the line with the *note* as:

return call<char const*>(f.ptr());. -

+
+ + +
alert MSVC6/7 Workaround
+
If you are using Microsoft Visual C++ 6 or 7, you have to rewrite + the line with the *note* as:

return call<char const*>(f.ptr());.

Finally, exposing:

@@ -511,7 +516,7 @@

Class Operators/Special Functions

- + Python Operators

@@ -560,7 +565,7 @@ expressions".

- + Special Methods

@@ -588,12 +593,11 @@

Need we say more?

-

- note What is the business of operator<<? Well, the method str - requires the operator<< - to do its work (i.e. operator<< is used by the method defined by - def(str(self)). -

+
+ + +
note What is the business of operator<<? Well, the method str requires the operator<< to do its work (i.e. operator<< + is used by the method defined by def(str(self)).
diff --git a/doc/tutorial/doc/html/python/functions.html b/doc/tutorial/doc/html/python/functions.html index 3a9b53b3..81bf8263 100644 --- a/doc/tutorial/doc/html/python/functions.html +++ b/doc/tutorial/doc/html/python/functions.html @@ -1,6 +1,3 @@ - - - @@ -209,7 +206,7 @@ Namespaces are one honking great idea -- let's do more of those!
  • BOOM!
  • - + Call Policies

    @@ -290,11 +287,13 @@ Namespaces are one honking great idea -- let's do more of those! and hold the instance -

    - smiley Remember the Zen, Luke:
    -
    "Explicit is better than implicit"
    "In the face - of ambiguity, refuse the temptation to guess"
    -

    +
    + + +
    smiley Remember the Zen, Luke:
    +
    "Explicit is better than implicit"
    "In + the face of ambiguity, refuse the temptation to guess"
    +

    @@ -405,7 +404,7 @@ Namespaces are one honking great idea -- let's do more of those!

    - + BOOST_PYTHON_FUNCTION_OVERLOADS

    @@ -435,7 +434,7 @@ Namespaces are one honking great idea -- let's do more of those! def("foo", foo, foo_overloads());

    - + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS

    @@ -481,7 +480,7 @@ Namespaces are one honking great idea -- let's do more of those! reference for details.

    - + init and optional

    @@ -548,14 +547,14 @@ Namespaces are one honking great idea -- let's do more of those! Then...

    -.def("foo", (void(*)(bool, int, char))0, foo_overloads());
    +.def("foo", foo, foo_overloads());
     

    Notice though that we have a situation now where we have a minimum of zero (0) arguments and a maximum of 3 arguments.

    - + Manual Wrapping

    diff --git a/doc/tutorial/doc/html/python/hello.html b/doc/tutorial/doc/html/python/hello.html index efdba8c2..fe93c26b 100644 --- a/doc/tutorial/doc/html/python/hello.html +++ b/doc/tutorial/doc/html/python/hello.html @@ -1,6 +1,3 @@ - - - @@ -29,7 +26,7 @@

    Building Hello World

    - + From Start To Finish

    @@ -38,16 +35,17 @@ necessary to achieve that. We shall use the build tool that comes bundled with every boost distribution: bjam.

    -

    - note Building without bjam
    -
    Besides bjam, there are of course other ways to get your module built. - What's written here should not be taken as "the one and only way". - There are of course other build tools apart from bjam.
    -
    Take note however that the preferred build tool for Boost.Python is - bjam. There are so many ways to set up the build incorrectly. Experience shows - that 90% of the "I can't build Boost.Python" problems come from people - who had to use a different tool. -

    +
    + + +
    note Building without bjam
    +
    Besides bjam, there are of course other ways to get your module + built. What's written here should not be taken as "the one and only + way". There are of course other build tools apart from bjam.
    +
    Take note however that the preferred build tool for Boost.Python + is bjam. There are so many ways to set up the build incorrectly. Experience + shows that 90% of the "I can't build Boost.Python" problems + come from people who had to use a different tool.

    We shall skip over the details. Our objective will be to simply create the hello world module and run it in Python. For a complete reference to building @@ -101,7 +99,7 @@ platforms. The complete list of Bjam executables can be found here.

    - + Let's Jam!

    @@ -152,7 +150,7 @@ extension hello # Declare a Python extension called hello The last part tells BJam that we are depending on the Boost Python Library.

    - + Running bjam

    @@ -180,10 +178,11 @@ set PYTHON_VERSION=2.2 The above assumes that the Python installation is in c:/dev/tools/python and that we are using Python version 2.2. You'll have to tweak these appropriately.

    -

    - tip Be sure not to include a third number, e.g. not "2.2.1", even if that's the version you - have. -

    +
    + + +
    tip Be sure not to include a third number, e.g. not "2.2.1", even if that's the version + you have.

    Take note that you may also do that through the Jamrules file we put in our project as detailed above. The file has detailed diff --git a/doc/tutorial/doc/html/python/iterators.html b/doc/tutorial/doc/html/python/iterators.html index bbe42b0f..4abaa075 100644 --- a/doc/tutorial/doc/html/python/iterators.html +++ b/doc/tutorial/doc/html/python/iterators.html @@ -1,6 +1,3 @@ - - - diff --git a/doc/tutorial/doc/html/python/object.html b/doc/tutorial/doc/html/python/object.html index 583a4779..50a11036 100644 --- a/doc/tutorial/doc/html/python/object.html +++ b/doc/tutorial/doc/html/python/object.html @@ -1,6 +1,3 @@ - - - @@ -179,11 +176,12 @@ % x,y,z in Python, which is useful since there's no easy way to do that in std C++.

    -

    - alert Beware the common - pitfall of forgetting that the constructors of most of Python's mutable types - make copies, just as in Python. -

    +
    + + +
    alert Beware the + common pitfall of forgetting that the constructors of most of Python's + mutable types make copies, just as in Python.

    Python:

    @@ -199,7 +197,7 @@ d['whatever'] = 3; // modifies the copy

    - + class_<T> as objects

    @@ -297,12 +295,14 @@ above creates a Python class derived from Python's int type which is associated with the C++ type passed as its first parameter.

    -

    - note what is a scope?
    -
    The scope is a class that has an associated global Python object which - controls the Python namespace in which new extension classes and wrapped - functions will be defined as attributes. Details can be found here. -

    +
    + + +
    note what is a scope?
    +
    The scope is a class that has an associated global Python object + which controls the Python namespace in which new extension classes + and wrapped functions will be defined as attributes. Details can be + found here.

    You can access those values in Python as

    diff --git a/doc/tutorial/doc/html/python/techniques.html b/doc/tutorial/doc/html/python/techniques.html index a60b7278..4f57d5b4 100644 --- a/doc/tutorial/doc/html/python/techniques.html +++ b/doc/tutorial/doc/html/python/techniques.html @@ -1,6 +1,3 @@ - - - @@ -99,12 +96,13 @@ Compiling these files will generate the following Python extensions: core.pyd, io.pyd and filters.pyd.

    -

    - note The extension .pyd is used for python - extension modules, which are just shared libraries. Using the default for - your system, like .so for Unix and .dll - for Windows, works just as well. -

    +
    + + +
    note The extension .pyd is used + for python extension modules, which are just shared libraries. Using + the default for your system, like .so for Unix and + .dll for Windows, works just as well.

    Now, we create this directory structure for our Python package:

    @@ -427,17 +425,19 @@ exporting it to Python at the same time: changes in a class will only demand the compilation of a single cpp, instead of the entire wrapper code.

    -

    - note If you're exporting your classes with Pyste, - take a look at the --multiple option, that generates the - wrappers in various files as demonstrated here. -

    -

    - note This method is useful too if you are getting the error - message "fatal error C1204:Compiler limit:internal structure - overflow" when compiling a large source file, as explained - in the FAQ. -

    +
    + + +
    note If you're exporting your classes with Pyste, + take a look at the --multiple option, that generates + the wrappers in various files as demonstrated here.
    +
    + + +
    note This method is useful too if you are getting the + error message "fatal error C1204:Compiler limit:internal + structure overflow" when compiling a large source file, + as explained in the FAQ.
    diff --git a/doc/tutorial/doc/tutorial.qbk b/doc/tutorial/doc/tutorial.qbk index c90db572..0c49dee7 100644 --- a/doc/tutorial/doc/tutorial.qbk +++ b/doc/tutorial/doc/tutorial.qbk @@ -1100,7 +1100,7 @@ overloaded functions in one-shot: Then... - .def("foo", (void(*)(bool, int, char))0, foo_overloads()); + .def("foo", foo, foo_overloads()); Notice though that we have a situation now where we have a minimum of zero (0) arguments and a maximum of 3 arguments. diff --git a/doc/tutorial/index.html b/doc/tutorial/index.html index c2a2aab5..82daf6df 100644 --- a/doc/tutorial/index.html +++ b/doc/tutorial/index.html @@ -8,6 +8,11 @@ Automatic redirection failed, click this - link + link  
    +

    © Copyright Beman Dawes, 2001

    +

    Distributed under the Boost Software License, Version 1.0. (See + accompanying file + LICENSE_1_0.txt or copy at + www.boost.org/LICENSE_1_0.txt)

    - + \ No newline at end of file diff --git a/doc/v2/Apr2002.html b/doc/v2/Apr2002.html index 4b26cb93..125c7b75 100644 --- a/doc/v2/Apr2002.html +++ b/doc/v2/Apr2002.html @@ -1,6 +1,3 @@ - - - diff --git a/doc/v2/CallPolicies.html b/doc/v2/CallPolicies.html index 5efbdcdb..946296a9 100644 --- a/doc/v2/CallPolicies.html +++ b/doc/v2/CallPolicies.html @@ -1,8 +1,5 @@ - - - - - diff --git a/doc/v2/Extractor.html b/doc/v2/Extractor.html index 72915f84..d09f7e12 100755 --- a/doc/v2/Extractor.html +++ b/doc/v2/Extractor.html @@ -1,6 +1,3 @@ - - - diff --git a/doc/v2/HolderGenerator.html b/doc/v2/HolderGenerator.html index e904b115..9443c73a 100755 --- a/doc/v2/HolderGenerator.html +++ b/doc/v2/HolderGenerator.html @@ -1,6 +1,3 @@ - - - diff --git a/doc/v2/Jun2002.html b/doc/v2/Jun2002.html index d3d61d49..6521e79a 100644 --- a/doc/v2/Jun2002.html +++ b/doc/v2/Jun2002.html @@ -1,6 +1,3 @@ - - - diff --git a/doc/v2/Mar2002.html b/doc/v2/Mar2002.html index 60a2f720..a815f358 100644 --- a/doc/v2/Mar2002.html +++ b/doc/v2/Mar2002.html @@ -1,6 +1,3 @@ - - - diff --git a/doc/v2/May2002.html b/doc/v2/May2002.html index 764b7d9e..b89f82e1 100644 --- a/doc/v2/May2002.html +++ b/doc/v2/May2002.html @@ -1,6 +1,3 @@ - - - diff --git a/doc/v2/ObjectWrapper.html b/doc/v2/ObjectWrapper.html index 3b8d797c..9949173d 100644 --- a/doc/v2/ObjectWrapper.html +++ b/doc/v2/ObjectWrapper.html @@ -1,8 +1,5 @@ - - - - - diff --git a/doc/v2/acknowledgments.html b/doc/v2/acknowledgments.html index 4d9894e7..0391c5d1 100644 --- a/doc/v2/acknowledgments.html +++ b/doc/v2/acknowledgments.html @@ -1,8 +1,5 @@ - - - - - - - - diff --git a/doc/v2/call_method.html b/doc/v2/call_method.html index 0965002f..50eb6e3e 100644 --- a/doc/v2/call_method.html +++ b/doc/v2/call_method.html @@ -1,8 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - -

    © Copyright Joel de Guzman 2003. 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) +

    © Copyright Joel de Guzman 2003. \ No newline at end of file diff --git a/doc/v2/default_call_policies.html b/doc/v2/default_call_policies.html index 772b5c63..2998769a 100644 --- a/doc/v2/default_call_policies.html +++ b/doc/v2/default_call_policies.html @@ -165,8 +165,6 @@ struct return_value_policy : Base -

    © Copyright Dave - Abrahams 2002. 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)

    +

    © Copyright Dave + Abrahams 2002. diff --git a/doc/v2/definitions.html b/doc/v2/definitions.html index c534aa01..372632bf 100644 --- a/doc/v2/definitions.html +++ b/doc/v2/definitions.html @@ -1,8 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/v2/extract.html b/doc/v2/extract.html index dc63b9e6..10c21ef3 100644 --- a/doc/v2/extract.html +++ b/doc/v2/extract.html @@ -1,8 +1,5 @@ - - - - - - -

    © Copyright Dave Abrahams 2002. 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)

    +

    © Copyright Dave Abrahams + 2002. diff --git a/doc/v2/handle.html b/doc/v2/handle.html index 34eb46fa..0b806833 100644 --- a/doc/v2/handle.html +++ b/doc/v2/handle.html @@ -1,8 +1,5 @@ - - - - - - - - - - - - diff --git a/doc/v2/index.html b/doc/v2/index.html index 92593d06..0d5ace16 100644 --- a/doc/v2/index.html +++ b/doc/v2/index.html @@ -1,8 +1,5 @@ - - - - - - - - - - - - diff --git a/doc/v2/iterator.html b/doc/v2/iterator.html index 8d0ab613..fa53faa2 100644 --- a/doc/v2/iterator.html +++ b/doc/v2/iterator.html @@ -1,8 +1,5 @@ - - - - - - - - - - - - - - - - - - © Copyright Dave - Abrahams 2002. 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)

    + Abrahams 2002. diff --git a/doc/v2/opaque_pointer_converter.html b/doc/v2/opaque_pointer_converter.html new file mode 100644 index 00000000..5c979999 --- /dev/null +++ b/doc/v2/opaque_pointer_converter.html @@ -0,0 +1,142 @@ + + + + + + + + Boost.Python - <boost/python/opaque_pointer_converter.hpp> + + + +
    + + + + + +
    +

    C++ Boost

    +
    +

    Boost.Python

    + +

    Header + <boost/python/opaque_pointer_converter.hpp>

    +
    +
    + +

    Contents

    + +
    +
    Classes
    + +
    +
    +
    Class template + opaque_pointer_converter<P>
    + +
    +
    +
    Class template + opaque_pointer_converter synopsis
    +
    +
    +
    +
    + +
    Macros
    +
    +
    +
    Macro + BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID
    +
    +
    + +
    Example
    + +
    See Also
    +
    +
    + +

    Classes

    + +

    Class template + opaque_pointer_converter<P>

    + +

    opaque_pointer_converter<> is derived from + + to_python_converter + and registers itself as an + + lvalue_from_pytype converter from Python objects + into pointers to undefined types. + Thus it may be used as a converter from opaque pointers into + Python objects and vice versa.

    + +

    Class template + opaque_pointer_converter synopsis

    +
    +namespace boost { namespace python
    +{
    +    template<class Pointer>
    +    struct opaque_pointer_converter
    +        : to_python_converter<
    +          Pointer, opaque_pointer_converter<Pointer> >
    +    {
    +        explicit opaque_pointer_converter(char const* name);
    +    };
    +}}
    +
    + +

    Class template + opaque_pointer_converter constructor

    +
    +explicit opaque_pointer_converter(char const* name);
    +
    + +
    +
    Effects: +

    Registers the instance as a + + lvalue_from_pytype converter from Python objects + into opaque pointers.

    +

    The name is used for the type of the Python Objects created; + it should be printable but needn't be an + ntbs because the object type is + not supposed to be user constructible within python scripts.

    +
    +
    + +

    Macros

    + +

    + Macro BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee)

    +

    This macro must be used to define specializations of the + type_id function + which can't be instantiated for incomplete types.

    +

    Note

    +

    In order for this to work in a cross-module environment the macro must + be invoked in every translation unit which uses the + opaque_pointer_converter.

    + +

    Example

    + + please see example for + return_opaque_pointer. + +

    See Also

    +

    + return_opaque_pointer +

    + +

    Revised + 10 March, 2003 +

    + +

    © Copyright 2003 Haufe Mediengruppe. All Rights + Reserved.

    + + + diff --git a/doc/v2/operators.html b/doc/v2/operators.html index 10e566ec..b4d91bb8 100755 --- a/doc/v2/operators.html +++ b/doc/v2/operators.html @@ -1,8 +1,5 @@ - - - operator_<unspecified> str(self_t); - operator_<unspecified> repr(self_t); - }}}; The tables below describe the methods generated when the results of the @@ -768,15 +762,6 @@ namespace boost { namespace python { namespace self_ns { lexical_cast<std::string>(x) - - - repr - - __repr__ - - lexical_cast<std::string>(x) -

    Class Template other

    diff --git a/doc/v2/overloads.html b/doc/v2/overloads.html index 226cab6e..0b00e7af 100644 --- a/doc/v2/overloads.html +++ b/doc/v2/overloads.html @@ -1,8 +1,5 @@ - - - -© Copyright Ralf W. Grosse-Kunstleve 2001-2004. 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) +© Copyright Ralf W. Grosse-Kunstleve 2001-2004. Permission to copy, +use, modify, sell and distribute this document is granted provided this +copyright notice appears in all copies. This document is provided "as +is" without express or implied warranty, and with no claim as to its +suitability for any purpose.

    Updated: Feb 2004. diff --git a/doc/v2/platforms.html b/doc/v2/platforms.html index e81f0c48..9893ee8d 100644 --- a/doc/v2/platforms.html +++ b/doc/v2/platforms.html @@ -1,8 +1,5 @@ - - - © Copyright Dave - Abrahams 2002. 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)

    - + Abrahams 2002. diff --git a/doc/v2/progress_reports.html b/doc/v2/progress_reports.html index ea764a2a..37045c92 100644 --- a/doc/v2/progress_reports.html +++ b/doc/v2/progress_reports.html @@ -1,6 +1,3 @@ - - - diff --git a/doc/v2/ptr.html b/doc/v2/ptr.html index 05305893..39d7fc8f 100644 --- a/doc/v2/ptr.html +++ b/doc/v2/ptr.html @@ -259,7 +259,5 @@ void pass_as_arg(expensive_to_copy* x, PyObject* f)

    © Copyright Dave - Abrahams 2002. 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)

    + Abrahams 2002. diff --git a/doc/v2/python.html b/doc/v2/python.html index 1e50f88d..9895fb53 100644 --- a/doc/v2/python.html +++ b/doc/v2/python.html @@ -1,8 +1,5 @@ - - - - - - - -
    ssize_t.hpp
    - -
    -
    -
    Typedefs
    - -
    Constants
    -
    -

    Topics

    diff --git a/doc/v2/reference_existing_object.html b/doc/v2/reference_existing_object.html index 1bb95d49..9297917a 100644 --- a/doc/v2/reference_existing_object.html +++ b/doc/v2/reference_existing_object.html @@ -1,8 +1,5 @@ - - - - - diff --git a/doc/v2/return_arg.html b/doc/v2/return_arg.html index 3ecfc898..d9500011 100755 --- a/doc/v2/return_arg.html +++ b/doc/v2/return_arg.html @@ -1,8 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Boost.Python - <boost/python/ssize_t.hpp> - - - - - - - - - -
    -

    C++ Boost

    -
    -

    Boost.Python

    - -

    Header - <boost/python/ssize_t.hpp>

    -
    -
    - -

    Contents

    - -
    -
    Introduction
    - -
    Typedef
    - -
    Constants
    -
    -
    - -

    Introduction

    - -

    Python 2.5 introduces a new Py_ssize_t typedef and - two related macros (PEP 353). The - <boost/python/ssize_t.hpp> header imports these - definitions into the boost::python namespace as - ssize_t, ssize_t_max, and ssize_t_min. - Appropriate definitions are provided for backward compatibility - with previous Python versions.

    - -

    Typedefs

    Imports - Py_ssize_t into the boost::python namespace if - available, or provides an appropriate typedef for backward - compatibility: -
    -#if PY_VERSION_HEX >= 0x02050000
    -typedef Py_ssize_t ssize_t;
    -#else
    -typedef int ssize_t;
    -#endif
    -
    - -

    Constants

    Imports - PY_SSIZE_T_MAX and PY_SSIZE_T_MIN as constants - into the boost::python namespace if available, or - provides appropriate constants for backward compatibility: -
    -#if PY_VERSION_HEX >= 0x02050000
    -ssize_t const ssize_t_max = PY_SSIZE_T_MAX;
    -ssize_t const ssize_t_min = PY_SSIZE_T_MIN;
    -#else
    -ssize_t const ssize_t_max = INT_MAX;
    -ssize_t const ssize_t_min = INT_MIN;
    -#endif
    -
    - -

    Revised - - 25 September, 2006 -

    - -

    © Copyright Ralf W. - Grosse-Kunstleve 2006.

    - - diff --git a/doc/v2/stl_iterator.html b/doc/v2/stl_iterator.html index ef197b0f..8ef2857a 100755 --- a/doc/v2/stl_iterator.html +++ b/doc/v2/stl_iterator.html @@ -1,8 +1,5 @@ - - - diff --git a/doc/v2/str.html b/doc/v2/str.html index 382a3707..037d5401 100644 --- a/doc/v2/str.html +++ b/doc/v2/str.html @@ -1,8 +1,5 @@ - - - - - - © Copyright Dave - Abrahams 2002. 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)

    + Abrahams 2002. diff --git a/doc/v2/to_python_value.html b/doc/v2/to_python_value.html index 9df49319..ccd9b5d3 100644 --- a/doc/v2/to_python_value.html +++ b/doc/v2/to_python_value.html @@ -97,7 +97,5 @@ PyObject* operator()(argument_type x) const;

    © Copyright Dave - Abrahams 2002. 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)

    + Abrahams 2002. diff --git a/doc/v2/tuple.html b/doc/v2/tuple.html index 488b8cc4..aabcd10c 100644 --- a/doc/v2/tuple.html +++ b/doc/v2/tuple.html @@ -1,8 +1,5 @@ - - -

    © Copyright Dave Abrahams 2002. 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)< + "../../../../people/dave_abrahams.htm">Dave Abrahams 2002.

    diff --git a/doc/v2/with_custodian_and_ward.html b/doc/v2/with_custodian_and_ward.html index 8d4686bb..8859c29c 100644 --- a/doc/v2/with_custodian_and_ward.html +++ b/doc/v2/with_custodian_and_ward.html @@ -1,7 +1,4 @@ - - - © Copyright Dave - Abrahams 2004 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)

    + Abrahams 2004 diff --git a/example/Jamfile b/example/Jamfile index 24303a6b..10fe384e 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -1,6 +1,5 @@ -# Copyright David Abrahams 2003-2006. 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) +# Copyright David Abrahams 2003. See accompanying LICENSE for terms +# and conditions of use. # This is the top of our own project tree project-root ; diff --git a/example/Jamroot b/example/Jamroot new file mode 100755 index 00000000..48c6e444 --- /dev/null +++ b/example/Jamroot @@ -0,0 +1,40 @@ +# Copyright David Abrahams 2006. 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) + +# Specify the path to the Boost project. If you move this project, +# adjust this path to refer to the Boost root directory. +use-project boost + : ../../.. ; + +# Set up the project-wide requirements that everything uses the +# boost_python library from the project whose global ID is +# /boost/python. +project + : requirements /boost/python//boost_python ; + +# Declare the three extension modules. You can specify multiple +# source files after the colon separated by spaces. +python-extension getting_started1 : getting_started1.cpp ; +python-extension getting_started2 : getting_started2.cpp ; +python-extension std_pair_ext : std_pair.cpp ; + +# A little "rule" (function) to clean up the syntax of declaring tests +# of these extension modules. +local rule run-test ( test-name : sources + ) +{ + import testing ; + testing.make-test run-pyd : $(sources) : : $(test-name) ; +} + +# Declare test targets +run-test test1 : getting_started1 test_getting_started1.py ; +run-test test2 : getting_started2 test_getting_started2.py ; +run-test test3 : std_pair_ext test_std_pair.py ; + +# A target that runs all the tests +alias test : test1 test2 test3 ; + +# Don't run tests by default +explicit test test1 test2 test3 ; + diff --git a/example/README b/example/README index a9bd7941..29a94f67 100644 --- a/example/README +++ b/example/README @@ -3,21 +3,14 @@ .. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) To get started with the Boost Python Library, use the examples -getting_started1.cpp and getting_started2.cpp. +getting_started1.cpp and getting_started2.cpp. Invoking - bjam -sTOOLS=your-toolset test + bjam --toolset=your-toolset test -in this directory will build and run the examples. - -Other configuration variables may need to be set as described in -http://www.boost.org/libs/python/doc/building.html. These can be -supplied by the environment, on the command-line with - - -sVARIABLENAME=value - -or in the local Jamrules file. +in this directory will build and run the examples. See +http://www.boost.org/more/getting_started.html for details about the +--toolset= option. If you move this example from its place in the Boost development tree -you'll need to edit at least one line in Jamrules and one line in +you'll need to edit the two lines indicated in Jamroot and boost-build.jam. - diff --git a/example/boost-build.jam b/example/boost-build.jam index 2075a00f..b7220e2c 100755 --- a/example/boost-build.jam +++ b/example/boost-build.jam @@ -2,6 +2,6 @@ # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -# Edit this path to point at the tools/build/v1 subdirectory of your +# Edit this path to point at the tools/build/v2 subdirectory of your # Boost installation. Absolute paths work, too. -boost-build ../../../tools/build/v1 ; +boost-build ../../../tools/build/v2 ; diff --git a/example/tutorial/Jamroot b/example/tutorial/Jamroot new file mode 100755 index 00000000..06522873 --- /dev/null +++ b/example/tutorial/Jamroot @@ -0,0 +1,18 @@ +# Copyright David Abrahams 2006. 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) + +# Specify the path to the Boost project. If you move this project, +# adjust this path to refer to the Boost root directory. +use-project boost + : ../../../.. ; + +# Set up the project-wide requirements that everything uses the +# boost_python library from the project whose global ID is +# /boost/python. +project + : requirements /boost/python//boost_python ; + +# Declare a Python extension called hello. +python-extension hello : hello.cpp ; + diff --git a/include/boost/python/converter/builtin_converters.hpp b/include/boost/python/converter/builtin_converters.hpp index dddb154c..3ae45c37 100644 --- a/include/boost/python/converter/builtin_converters.hpp +++ b/include/boost/python/converter/builtin_converters.hpp @@ -7,7 +7,6 @@ # include # include # include -# include # include # include # include @@ -116,9 +115,9 @@ BOOST_PYTHON_TO_PYTHON_BY_VALUE(unsigned BOOST_PYTHON_LONG_LONG, ::PyLong_FromUn BOOST_PYTHON_TO_PYTHON_BY_VALUE(char, converter::do_return_to_python(x)) BOOST_PYTHON_TO_PYTHON_BY_VALUE(char const*, converter::do_return_to_python(x)) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::string, ::PyString_FromStringAndSize(x.data(),implicit_cast(x.size()))) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::string, ::PyString_FromStringAndSize(x.data(),implicit_cast(x.size()))) #if defined(Py_USING_UNICODE) && !defined(BOOST_NO_STD_WSTRING) -BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::wstring, ::PyUnicode_FromWideChar(x.data(),implicit_cast(x.size()))) +BOOST_PYTHON_TO_PYTHON_BY_VALUE(std::wstring, ::PyUnicode_FromWideChar(x.data(),implicit_cast(x.size()))) # endif BOOST_PYTHON_TO_PYTHON_BY_VALUE(float, ::PyFloat_FromDouble(x)) BOOST_PYTHON_TO_PYTHON_BY_VALUE(double, ::PyFloat_FromDouble(x)) diff --git a/include/boost/python/converter/implicit.hpp b/include/boost/python/converter/implicit.hpp index cf5d8fa6..190bab32 100644 --- a/include/boost/python/converter/implicit.hpp +++ b/include/boost/python/converter/implicit.hpp @@ -29,12 +29,8 @@ struct implicit static void construct(PyObject* obj, rvalue_from_python_stage1_data* data) { void* storage = ((rvalue_from_python_storage*)data)->storage.bytes; - - arg_from_python get_source(obj); - bool convertible = get_source.convertible(); - BOOST_ASSERT(convertible); - new (storage) Target(get_source()); + new (storage) Target(extract(obj)()); // record successful construction data->convertible = storage; diff --git a/include/boost/python/converter/registrations.hpp b/include/boost/python/converter/registrations.hpp index 0f335f95..d71401de 100644 --- a/include/boost/python/converter/registrations.hpp +++ b/include/boost/python/converter/registrations.hpp @@ -34,7 +34,6 @@ struct BOOST_PYTHON_DECL registration { public: // member functions explicit registration(type_info target, bool is_shared_ptr = false); - ~registration(); // Convert the appropriately-typed data to Python PyObject* to_python(void const volatile*) const; diff --git a/include/boost/python/detail/config.hpp b/include/boost/python/detail/config.hpp index 3f2a19eb..cfd762b9 100644 --- a/include/boost/python/detail/config.hpp +++ b/include/boost/python/detail/config.hpp @@ -114,4 +114,24 @@ # define BOOST_PYTHON_OFFSETOF offsetof #endif +// enable automatic library variant selection ------------------------------// + +#if !defined(BOOST_PYTHON_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_PYTHON_NO_LIB) +// +// Set the name of our library, this will get undef'ed by auto_link.hpp +// once it's done with it: +// +#define BOOST_LIB_NAME boost_python +// +// If we're importing code from a dll, then tell auto_link.hpp about it: +// +#ifdef BOOST_PYTHON_DYNAMIC_LIB +# define BOOST_DYN_LINK +#endif +// +// And include the header that does the work: +// +#include +#endif // auto-linking disabled + #endif // CONFIG_DWA052200_H_ diff --git a/include/boost/python/detail/operator_id.hpp b/include/boost/python/detail/operator_id.hpp index 4a2785ed..f2cd404e 100755 --- a/include/boost/python/detail/operator_id.hpp +++ b/include/boost/python/detail/operator_id.hpp @@ -47,8 +47,7 @@ enum operator_id op_ixor, op_ior, op_complex, - op_nonzero, - op_repr + op_nonzero }; }}} // namespace boost::python::detail diff --git a/include/boost/python/detail/python22_fixed.h b/include/boost/python/detail/python22_fixed.h index 32bf941f..e236c2b0 100644 --- a/include/boost/python/detail/python22_fixed.h +++ b/include/boost/python/detail/python22_fixed.h @@ -4,8 +4,6 @@ // Copyright (c) 2001, 2002 Python Software Foundation; All Rights // Reserved // -// boostinspect:nolicense (don't complain about the lack of a Boost license) -// // Changes from the original: // 1. #includes for Python 2.2.1 // 2. Provides missing extern "C" wrapper for "iterobject.h" and "descrobject.h". diff --git a/include/boost/python/detail/unwrap_wrapper.hpp b/include/boost/python/detail/unwrap_wrapper.hpp index 95bc233a..a0f6a65a 100755 --- a/include/boost/python/detail/unwrap_wrapper.hpp +++ b/include/boost/python/detail/unwrap_wrapper.hpp @@ -6,29 +6,43 @@ # include # include -# include -# include +# if defined(BOOST_PYTHON_NO_SFINAE) +# include +# include +# else +# include +# endif namespace boost { namespace python { namespace detail { +# if defined(BOOST_PYTHON_NO_SFINAE) template struct unwrap_wrapper_helper { typedef typename T::_wrapper_wrapped_type_ type; }; - + template -struct unwrap_wrapper_ - : mpl::eval_if,unwrap_wrapper_helper,mpl::identity > -{}; - +typename mpl::eval_if,unwrap_wrapper_helper,mpl::identity >::type* +unwrap_wrapper(T*) +{ + return 0; +} +# else template -typename unwrap_wrapper_::type* +typename disable_if_ret,T*>::type unwrap_wrapper(T*) { return 0; } +template +T* unwrap_wrapper(wrapper*) +{ + return 0; +} +# endif + }}} // namespace boost::python::detail #endif // UNWRAP_WRAPPER_DWA2004723_HPP diff --git a/include/boost/python/detail/wrap_python.hpp b/include/boost/python/detail/wrap_python.hpp index 88597b58..cce01868 100644 --- a/include/boost/python/detail/wrap_python.hpp +++ b/include/boost/python/detail/wrap_python.hpp @@ -48,7 +48,7 @@ #endif # include -# if defined(_SGI_COMPILER_VERSION) && _SGI_COMPILER_VERSION >= 740 +# if defined(_SGI_COMPILER_VERSION) && _SGI_COMPILER_VERSION == 741 # undef _POSIX_C_SOURCE # undef _XOPEN_SOURCE # endif diff --git a/include/boost/python/docstring_options.hpp b/include/boost/python/docstring_options.hpp index 507a4c5d..08346ebc 100755 --- a/include/boost/python/docstring_options.hpp +++ b/include/boost/python/docstring_options.hpp @@ -62,7 +62,7 @@ class BOOST_PYTHON_DECL docstring_options : boost::noncopyable show_signatures_ = true; } - friend struct objects::function; + friend class objects::function; private: static volatile bool show_user_defined_; diff --git a/include/boost/python/list.hpp b/include/boost/python/list.hpp index 0f6d1e8e..793cd08a 100644 --- a/include/boost/python/list.hpp +++ b/include/boost/python/list.hpp @@ -9,7 +9,6 @@ # include # include -# include namespace boost { namespace python { @@ -25,11 +24,11 @@ namespace detail long index(object_cref value) const; // return index of first occurrence of value - void insert(ssize_t index, object_cref); // insert object before index + void insert(int index, object_cref); // insert object before index void insert(object const& index, object_cref); object pop(); // remove and return item at index (default last) - object pop(ssize_t index); + object pop(long index); object pop(object const& index); void remove(object_cref value); // remove first occurrence of value @@ -87,7 +86,7 @@ class list : public detail::list_base } template - void insert(ssize_t index, T const& x) // insert object before index + void insert(int index, T const& x) // insert object before index { base::insert(index, object(x)); } @@ -99,7 +98,7 @@ class list : public detail::list_base } object pop() { return base::pop(); } - object pop(ssize_t index) { return base::pop(index); } + object pop(long index) { return base::pop(index); } template object pop(T const& index) diff --git a/include/boost/python/numeric.hpp b/include/boost/python/numeric.hpp index 66fde676..3868154b 100644 --- a/include/boost/python/numeric.hpp +++ b/include/boost/python/numeric.hpp @@ -17,7 +17,7 @@ namespace boost { namespace python { namespace numeric { -class array; +struct array; namespace aux { diff --git a/include/boost/python/object.hpp b/include/boost/python/object.hpp index 9adec90f..677ffb42 100755 --- a/include/boost/python/object.hpp +++ b/include/boost/python/object.hpp @@ -5,7 +5,7 @@ #ifndef OBJECT_DWA2002612_HPP # define OBJECT_DWA2002612_HPP -# include +# include # include # include # include @@ -15,9 +15,9 @@ namespace boost { namespace python { - inline ssize_t len(object const& obj) + inline long len(object const& obj) { - ssize_t result = PyObject_Length(obj.ptr()); + long result = PyObject_Length(obj.ptr()); if (PyErr_Occurred()) throw_error_already_set(); return result; } diff --git a/include/boost/python/object/pointer_holder.hpp b/include/boost/python/object/pointer_holder.hpp index 7fad2a25..569c9d4e 100644 --- a/include/boost/python/object/pointer_holder.hpp +++ b/include/boost/python/object/pointer_holder.hpp @@ -179,7 +179,7 @@ void* pointer_holder_back_reference::holds(type_info dst_t, bool BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) )) { - python::detail::initialize_wrapper(self, get_pointer(this->m_p)); + python::detail::initialize_wrapper(self, &*this->m_p); } # undef N diff --git a/include/boost/python/operators.hpp b/include/boost/python/operators.hpp index e929779e..d10a0094 100644 --- a/include/boost/python/operators.hpp +++ b/include/boost/python/operators.hpp @@ -18,7 +18,6 @@ # include # include # include -# include # include # include @@ -170,9 +169,7 @@ namespace detail \ template \ struct apply \ { \ - typedef typename unwrap_wrapper_::type lhs; \ - typedef typename unwrap_wrapper_::type rhs; \ - static PyObject* execute(lhs& l, rhs const& r) \ + static inline PyObject* execute(L& l, R const& r) \ { \ return detail::convert_result(expr); \ } \ @@ -186,9 +183,7 @@ namespace detail \ template \ struct apply \ { \ - typedef typename unwrap_wrapper_::type lhs; \ - typedef typename unwrap_wrapper_::type rhs; \ - static PyObject* execute(rhs& r, lhs const& l) \ + static inline PyObject* execute(R& r, L const& l) \ { \ return detail::convert_result(expr); \ } \ @@ -276,10 +271,8 @@ namespace detail \ template \ struct apply \ { \ - typedef typename unwrap_wrapper_::type lhs; \ - typedef typename unwrap_wrapper_::type rhs; \ - static PyObject* \ - execute(back_reference l, rhs const& r) \ + static inline PyObject* \ + execute(back_reference l, R const& r) \ { \ l.get() op r; \ return python::incref(l.source().ptr()); \ @@ -318,8 +311,7 @@ namespace detail \ template \ struct apply \ { \ - typedef typename unwrap_wrapper_::type self_t; \ - static PyObject* execute(self_t& x) \ + static PyObject* execute(T& x) \ { \ return detail::convert_result(op(x)); \ } \ @@ -347,7 +339,6 @@ BOOST_PYTHON_UNARY_OPERATOR(long, PyLong_FromLong, long_) BOOST_PYTHON_UNARY_OPERATOR(float, double, float_) BOOST_PYTHON_UNARY_OPERATOR(complex, std::complex, complex_) BOOST_PYTHON_UNARY_OPERATOR(str, lexical_cast, str) -BOOST_PYTHON_UNARY_OPERATOR(repr, lexical_cast, repr) # undef BOOST_PYTHON_UNARY_OPERATOR }} // namespace boost::python @@ -359,7 +350,6 @@ using boost::python::self_ns::long_; using boost::python::self_ns::float_; using boost::python::self_ns::complex_; using boost::python::self_ns::str; -using boost::python::self_ns::repr; using boost::python::self_ns::pow; # endif diff --git a/include/boost/python/ssize_t.hpp b/include/boost/python/ssize_t.hpp deleted file mode 100644 index e8a2d92f..00000000 --- a/include/boost/python/ssize_t.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright Ralf W. Grosse-Kunstleve & David Abrahams 2006. -// 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) - -#ifndef BOOST_PYTHON_SSIZE_T_RWGK20060924_HPP -# define BOOST_PYTHON_SSIZE_T_RWGK20060924_HPP - -# include - -namespace boost { namespace python { - -#if PY_VERSION_HEX >= 0x02050000 - -typedef Py_ssize_t ssize_t; -ssize_t const ssize_t_max = PY_SSIZE_T_MAX; -ssize_t const ssize_t_min = PY_SSIZE_T_MIN; - -#else - -typedef int ssize_t; -ssize_t const ssize_t_max = INT_MAX; -ssize_t const ssize_t_min = INT_MIN; - -#endif - -}} // namespace boost::python - -#endif // BOOST_PYTHON_SSIZE_T_RWGK20060924_HPP diff --git a/include/boost/python/suite/indexing/indexing_suite.hpp b/include/boost/python/suite/indexing/indexing_suite.hpp index 0ebb755a..61e3593c 100644 --- a/include/boost/python/suite/indexing/indexing_suite.hpp +++ b/include/boost/python/suite/indexing/indexing_suite.hpp @@ -18,7 +18,7 @@ namespace boost { namespace python { - // indexing_suite class. This class is the facade class for + // indexing_suite class. This class is the protocol class for // the management of C++ containers intended to be integrated // to Python. The objective is make a C++ container look and // feel and behave exactly as we'd expect a Python container. diff --git a/include/boost/python/type_id.hpp b/include/boost/python/type_id.hpp index 559a38b5..fecf8b8d 100755 --- a/include/boost/python/type_id.hpp +++ b/include/boost/python/type_id.hpp @@ -89,7 +89,7 @@ inline type_info type_id(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) } # if (defined(__EDG_VERSION__) && __EDG_VERSION__ < 245) \ - || (defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 744) + || (defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 741) // Older EDG-based compilers seems to mistakenly distinguish "int" from // "signed int", etc., but only in typeid() expressions. However // though int == signed int, the "signed" decoration is propagated diff --git a/include/boost/python/with_custodian_and_ward.hpp b/include/boost/python/with_custodian_and_ward.hpp index 906de6d7..11ee79d1 100644 --- a/include/boost/python/with_custodian_and_ward.hpp +++ b/include/boost/python/with_custodian_and_ward.hpp @@ -90,7 +90,7 @@ struct with_custodian_and_ward_postcall : BasePolicy_ // check if either custodian or ward exceeds the arity // (this weird formulation avoids "always false" warnings // for arity_ = 0) - if ( (std::max)(custodian, ward) > arity_ ) + if ( std::max(custodian, ward) > arity_ ) #endif { PyErr_SetString( diff --git a/index.html b/index.html index 9c6acc88..40f1ae14 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,3 @@ - - - diff --git a/pyste/NEWS b/pyste/NEWS index 31a5ceba..aaa8e3b3 100644 --- a/pyste/NEWS +++ b/pyste/NEWS @@ -1,7 +1,3 @@ -.. Copyright Bruno da Silva de Oliveira 2006. 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) - 25 April 2005 - Fixed bug where the code for wrappers of member functions were defined outside the pyste namespace. Reported by Dan Haffey. diff --git a/pyste/README b/pyste/README index c378f391..e4e3734e 100644 --- a/pyste/README +++ b/pyste/README @@ -1,7 +1,3 @@ -.. Copyright Bruno da Silva de Oliveira 2006. 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) - Pyste - Python Semi-Automatic Exporter ====================================== diff --git a/pyste/TODO b/pyste/TODO index 0b3c9024..e0ff578b 100644 --- a/pyste/TODO +++ b/pyste/TODO @@ -1,7 +1,3 @@ -.. Copyright Bruno da Silva de Oliveira 2006. 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) - - Make Pyste accept already-generated xml files - throw() declaration in virtual wrapper's member functions diff --git a/pyste/dist/create_build.py b/pyste/dist/create_build.py index a6836995..506426f0 100644 --- a/pyste/dist/create_build.py +++ b/pyste/dist/create_build.py @@ -1,7 +1,3 @@ -# Copyright Bruno da Silva de Oliveira 2006. 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) - import os import sys import shutil diff --git a/pyste/dist/setup.py b/pyste/dist/setup.py index fc7c74e2..eea2751f 100644 --- a/pyste/dist/setup.py +++ b/pyste/dist/setup.py @@ -1,7 +1,3 @@ -# Copyright Bruno da Silva de Oliveira 2006. 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) - from distutils.core import setup import py2exe import sys diff --git a/pyste/doc/adding_new_methods.html b/pyste/doc/adding_new_methods.html index afa772bc..9cd603e4 100644 --- a/pyste/doc/adding_new_methods.html +++ b/pyste/doc/adding_new_methods.html @@ -72,8 +72,9 @@ Now from Python:



    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/exporting_an_entire_header.html b/pyste/doc/exporting_an_entire_header.html index db25325c..d1f22e1e 100644 --- a/pyste/doc/exporting_an_entire_header.html +++ b/pyste/doc/exporting_an_entire_header.html @@ -78,8 +78,9 @@ use at you own risk.

    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/global_variables.html b/pyste/doc/global_variables.html index 0efd2950..2170e4e8 100644 --- a/pyste/doc/global_variables.html +++ b/pyste/doc/global_variables.html @@ -42,8 +42,9 @@ functions, and export those.



    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/inserting_code.html b/pyste/doc/inserting_code.html index 97eb70f3..866e5bad 100644 --- a/pyste/doc/inserting_code.html +++ b/pyste/doc/inserting_code.html @@ -65,8 +65,9 @@ Will generate:



    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/introduction.html b/pyste/doc/introduction.html index 94388493..352aed2e 100644 --- a/pyste/doc/introduction.html +++ b/pyste/doc/introduction.html @@ -66,8 +66,9 @@ Pyste supports the following features:



    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/policies.html b/pyste/doc/policies.html index 3628093b..8061f9b1 100644 --- a/pyste/doc/policies.html +++ b/pyste/doc/policies.html @@ -83,8 +83,9 @@ to, though.

    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/pyste.txt b/pyste/doc/pyste.txt index 186a31cb..08eda4aa 100644 --- a/pyste/doc/pyste.txt +++ b/pyste/doc/pyste.txt @@ -1,10 +1,5 @@ [doc Pyste Documentation] -[/ Copyright 2003 Bruno da Silva de Oliveira and Joel de Guzman. -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) ] - [def GCCXML [@http://www.gccxml.org GCCXML]] [def Boost.Python [@../../index.html Boost.Python]] diff --git a/pyste/doc/renaming_and_excluding.html b/pyste/doc/renaming_and_excluding.html index ce6654c4..185b8d7e 100644 --- a/pyste/doc/renaming_and_excluding.html +++ b/pyste/doc/renaming_and_excluding.html @@ -80,8 +80,9 @@ C::foo that way.



    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/running_pyste.html b/pyste/doc/running_pyste.html index 9bd9a3ae..5f72e603 100644 --- a/pyste/doc/running_pyste.html +++ b/pyste/doc/running_pyste.html @@ -193,8 +193,9 @@ created again, but no code will be generated.



    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/smart_pointers.html b/pyste/doc/smart_pointers.html index cddc96f2..095d2482 100644 --- a/pyste/doc/smart_pointers.html +++ b/pyste/doc/smart_pointers.html @@ -77,8 +77,9 @@ specify the smart pointer as the holder for a class, use the functions

    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/templates.html b/pyste/doc/templates.html index a1c1cfef..f2b978bb 100644 --- a/pyste/doc/templates.html +++ b/pyste/doc/templates.html @@ -95,8 +95,9 @@ either a string with the types separated by whitespace, or a list of strings

    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/the_interface_files.html b/pyste/doc/the_interface_files.html index 9c020043..117301b4 100644 --- a/pyste/doc/the_interface_files.html +++ b/pyste/doc/the_interface_files.html @@ -95,8 +95,9 @@ Note that we specify that B needs to know about A to be proper

    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/doc/theme/style.css b/pyste/doc/theme/style.css index 643df02a..53a6205e 100644 --- a/pyste/doc/theme/style.css +++ b/pyste/doc/theme/style.css @@ -1,11 +1,3 @@ -/*============================================================================= - Copyright (c) 2003 Bruno da Silva de Oliveira - - Use, modification and distribution is subject to 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) -=============================================================================*/ - body { background-image: url(bkd.gif); diff --git a/pyste/doc/wrappers.html b/pyste/doc/wrappers.html index 534ae552..0943c0c5 100644 --- a/pyste/doc/wrappers.html +++ b/pyste/doc/wrappers.html @@ -117,8 +117,9 @@ code to compile when you set a wrapper for a virtual member function.

    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/index.html b/pyste/index.html index 953b37c1..55b7d39f 100644 --- a/pyste/index.html +++ b/pyste/index.html @@ -83,8 +83,9 @@

    +Permission to copy, use, modify, sell and distribute this document + is granted provided this copyright notice appears in all copies. This document + is provided "as is" without express or implied warranty, and with + no claim as to its suitability for any purpose.

    diff --git a/pyste/install/pyste.py b/pyste/install/pyste.py index da926235..9547d5f7 100644 --- a/pyste/install/pyste.py +++ b/pyste/install/pyste.py @@ -1,8 +1,4 @@ #!/usr/bin/env python -# Copyright Bruno da Silva de Oliveira 2006. 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) - from Pyste import pyste pyste.main() diff --git a/pyste/install/setup.py b/pyste/install/setup.py index c1703981..6c156536 100644 --- a/pyste/install/setup.py +++ b/pyste/install/setup.py @@ -1,6 +1,4 @@ -# Copyright Prabhu Ramachandran 2006. 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) +# contributed by Prabhu Ramachandran from distutils.core import setup import sys diff --git a/release_notes.txt b/release_notes.txt index 1fd0f1b1..8932a0aa 100644 --- a/release_notes.txt +++ b/release_notes.txt @@ -1,9 +1,3 @@ -.. Copyright David Abrahams 2006. 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) - -These are old release notes for Boost.Python v1 - 2000-11-22 10:00 Ullrich fixed bug in operator_dispatcher. diff --git a/src/converter/registry.cpp b/src/converter/registry.cpp index 179111c6..50da37d5 100644 --- a/src/converter/registry.cpp +++ b/src/converter/registry.cpp @@ -57,24 +57,6 @@ BOOST_PYTHON_DECL PyObject* registration::to_python(void const volatile* source) : this->m_to_python(const_cast(source)); } -namespace -{ - template< typename T > - void delete_node( T* node ) - { - if( !!node && !!node->next ) - delete_node( node->next ); - delete node; - } -} - -registration::~registration() -{ - delete_node(lvalue_chain); - delete_node(rvalue_chain); -} - - namespace // { typedef registration entry; diff --git a/src/converter/type_id.cpp b/src/converter/type_id.cpp index c6a8bf7a..738cfd11 100644 --- a/src/converter/type_id.cpp +++ b/src/converter/type_id.cpp @@ -14,7 +14,7 @@ #if defined(__QNXNTO__) # include -#else /* defined(__QNXNTO__) */ +#else /* defined(__QNXNTO__) */ #if !defined(__GNUC__) || __GNUC__ >= 3 || __SGI_STL_PORT || __EDG_VERSION__ # include @@ -35,7 +35,7 @@ class __class_type_info; # include # endif # endif -#endif /* defined(__QNXNTO__) */ +#endif /* defined(__QNXNTO__) */ namespace boost { namespace python { @@ -45,7 +45,7 @@ namespace boost { namespace python { namespace cxxabi { extern "C" char* __cxa_demangle(char const*, char*, std::size_t*, int*); } -# else /* defined(__QNXNTO__) */ +# else /* defined(__QNXNTO__) */ # ifdef __GNUC__ # if __GNUC__ < 3 @@ -61,10 +61,10 @@ namespace abi { extern "C" char* __cxa_demangle(char const*, char*, std::size_t*, int*); } -# endif /* __GNUC__ == 3 && __GNUC_MINOR__ == 0 */ -# endif /* __GNUC__ < 3 */ -# endif /* __GNUC__ */ -# endif /* defined(__QNXNTO__) */ +# endif /* __GNUC__ == 3 && __GNUC_MINOR__ == 0 */ +# endif /* __GNUC__ < 3 */ +# endif /* __GNUC__ */ +# endif /* defined(__QNXNTO__) */ namespace { diff --git a/src/exec.cpp b/src/exec.cpp index 5d20bd82..0981f8b1 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -34,9 +34,9 @@ object exec_file(str filename, object global, object local) if (!pyfile) throw std::invalid_argument(std::string(f) + " : no such file"); python::handle<> file(pyfile); PyObject* result = PyRun_File(PyFile_AsFile(file.get()), - f, - Py_file_input, - global.ptr(), local.ptr()); + f, + Py_file_input, + global.ptr(), local.ptr()); if (!result) throw_error_already_set(); return object(detail::new_reference(result)); } diff --git a/src/list.cpp b/src/list.cpp index b8f31fb8..79f758a9 100644 --- a/src/list.cpp +++ b/src/list.cpp @@ -3,7 +3,6 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include -#include namespace boost { namespace python { namespace detail { @@ -54,7 +53,7 @@ long list_base::index(object_cref value) const return result; } -void list_base::insert(ssize_t index, object_cref item) +void list_base::insert(int index, object_cref item) { if (PyList_CheckExact(this->ptr())) { @@ -80,7 +79,7 @@ object list_base::pop() return this->attr("pop")(); } -object list_base::pop(ssize_t index) +object list_base::pop(long index) { return this->pop(object(index)); } diff --git a/src/object/class.cpp b/src/object/class.cpp index 9daf42b7..efc492c6 100644 --- a/src/object/class.cpp +++ b/src/object/class.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -507,14 +506,13 @@ namespace objects // were declared, we'll use our class_type() as the single base // class. std::size_t const num_bases = (std::max)(num_types - 1, static_cast(1)); - assert(num_bases <= ssize_t_max); - handle<> bases(PyTuple_New(static_cast(num_bases))); + handle<> bases(PyTuple_New(num_bases)); for (std::size_t i = 1; i <= num_bases; ++i) { type_handle c = (i >= num_types) ? class_type() : get_class(types[i]); // PyTuple_SET_ITEM steals this reference - PyTuple_SET_ITEM(bases.get(), static_cast(i - 1), upcast(c.release())); + PyTuple_SET_ITEM(bases.get(), i - 1, upcast(c.release())); } // Call the class metatype to create a new class @@ -532,10 +530,6 @@ namespace objects if (scope().ptr() != Py_None) scope().attr(name) = result; - // For pickle. Will lead to informative error messages if pickling - // is not enabled. - result.attr("__reduce__") = object(make_instance_reduce_function()); - return result; } } @@ -633,6 +627,7 @@ namespace objects void class_base::enable_pickling_(bool getstate_manages_dict) { + setattr("__reduce__", object(make_instance_reduce_function())); setattr("__safe_for_unpickling__", object(true)); if (getstate_manages_dict) diff --git a/src/object/function.cpp b/src/object/function.cpp index 1f094f42..653343b9 100644 --- a/src/object/function.cpp +++ b/src/object/function.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -65,7 +64,7 @@ function::function( = max_arity > num_keywords ? max_arity - num_keywords : 0; - ssize_t tuple_size = num_keywords ? max_arity : 0; + unsigned tuple_size = num_keywords ? max_arity : 0; m_arg_names = object(handle<>(PyTuple_New(tuple_size))); if (num_keywords != 0) @@ -159,9 +158,7 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const else { // build a new arg tuple, will adjust its size later - assert(max_arity <= ssize_t_max); - inner_args = handle<>( - PyTuple_New(static_cast(max_arity))); + inner_args = handle<>(PyTuple_New(max_arity)); // Fill in the positional arguments for (std::size_t i = 0; i < n_unnamed_actual; ++i) @@ -296,7 +293,7 @@ void function::argument_error(PyObject* args, PyObject* /*keywords*/) const % make_tuple(this->m_namespace, this->m_name); list actual_args; - for (ssize_t i = 0; i < PyTuple_Size(args); ++i) + for (int i = 0; i < PyTuple_Size(args); ++i) { char const* name = PyTuple_GetItem(args, i)->ob_type->tp_name; actual_args.append(str(name)); diff --git a/src/object/pickle_support.cpp b/src/object/pickle_support.cpp index f70eb17f..897ee633 100644 --- a/src/object/pickle_support.cpp +++ b/src/object/pickle_support.cpp @@ -8,7 +8,6 @@ #include #include #include -#include namespace boost { namespace python { @@ -20,22 +19,6 @@ namespace { object instance_class(instance_obj.attr("__class__")); result.append(instance_class); object none; - if (!getattr(instance_obj, "__safe_for_unpickling__", none)) - { - str type_name(getattr(instance_class, "__name__")); - str module_name(getattr(instance_class, "__module__", object(""))); - if (module_name) - module_name += "."; - - PyErr_SetObject( - PyExc_RuntimeError, - ( "Pickling of \"%s\" instances is not enabled" - " (http://www.boost.org/libs/python/doc/v2/pickle.html)" - % (module_name+type_name)).ptr() - ); - - throw_error_already_set(); - } object getinitargs = getattr(instance_obj, "__getinitargs__", none); tuple initargs; if (getinitargs.ptr() != none.ptr()) { diff --git a/src/object_protocol.cpp b/src/object_protocol.cpp index 8606fa2b..c23b8bb3 100755 --- a/src/object_protocol.cpp +++ b/src/object_protocol.cpp @@ -6,7 +6,6 @@ #include #include #include -#include namespace boost { namespace python { namespace api { @@ -107,7 +106,7 @@ namespace // slicing code copied directly out of the Python implementation PySequenceMethods *sq = tp->tp_as_sequence; if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) { - ssize_t ilow = 0, ihigh = ssize_t_max; + int ilow = 0, ihigh = INT_MAX; if (!_PyEval_SliceIndex(v, &ilow)) return NULL; if (!_PyEval_SliceIndex(w, &ihigh)) @@ -134,7 +133,7 @@ namespace // slicing code copied directly out of the Python implementation PySequenceMethods *sq = tp->tp_as_sequence; if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) { - ssize_t ilow = 0, ihigh = ssize_t_max; + int ilow = 0, ihigh = INT_MAX; if (!_PyEval_SliceIndex(v, &ilow)) return -1; if (!_PyEval_SliceIndex(w, &ihigh)) diff --git a/src/str.cpp b/src/str.cpp index 5216cf54..c452a285 100644 --- a/src/str.cpp +++ b/src/str.cpp @@ -3,7 +3,6 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include -#include namespace boost { namespace python { namespace detail { @@ -22,25 +21,10 @@ str_base::str_base(const char* s) : object(detail::new_reference(::PyString_FromString(s))) {} -namespace { - - ssize_t str_size_as_py_ssize_t(std::size_t n) - { - if (n > ssize_t_max) - { - throw std::range_error("str size > ssize_t_max"); - } - return static_cast(n); - } - -} // namespace - str_base::str_base(char const* start, char const* finish) : object( detail::new_reference( - ::PyString_FromStringAndSize( - start, str_size_as_py_ssize_t(finish - start) - ) + ::PyString_FromStringAndSize(start, finish - start) ) ) {} @@ -48,9 +32,7 @@ str_base::str_base(char const* start, char const* finish) str_base::str_base(char const* start, std::size_t length) // new str : object( detail::new_reference( - ::PyString_FromStringAndSize( - start, str_size_as_py_ssize_t(length) - ) + ::PyString_FromStringAndSize(start, length) ) ) {} diff --git a/test/andreas_beyer.cpp b/test/andreas_beyer.cpp index da3aa751..a39e9f04 100755 --- a/test/andreas_beyer.cpp +++ b/test/andreas_beyer.cpp @@ -1,6 +1,3 @@ -// Copyright David Abrahams 2006. 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) #include #include #include diff --git a/test/args.py b/test/args.py index 695a07dc..cff6a7b8 100644 --- a/test/args.py +++ b/test/args.py @@ -84,8 +84,6 @@ (2, 4.25, 'wow') >>> q.f1() (1, 4.25, 'wow') ->>> q.f2.__doc__.splitlines()[-3] -"f2's docstring" >>> X.f.__doc__.splitlines()[:2] ["This is X.f's docstring", 'C++ signature:'] diff --git a/test/crossmod_exception.py b/test/crossmod_exception.py index dd50dae2..c8430849 100644 --- a/test/crossmod_exception.py +++ b/test/crossmod_exception.py @@ -1,6 +1,9 @@ -# Copyright (C) 2003 Rational Discovery LLC. 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) +# Copyright (C) 2003 Rational Discovery LLC +# Permission to copy, use, modify, sell and distribute this software +# is granted provided this copyright notice appears in all +# copies. This software is provided "as is" without express or +# implied warranty, and with no claim as to its suitability for any +# purpose. print "running..." diff --git a/test/exec.cpp b/test/exec.cpp index 1843d183..889a5324 100644 --- a/test/exec.cpp +++ b/test/exec.cpp @@ -54,7 +54,7 @@ void exec_test() // Register the module with the interpreter if (PyImport_AppendInittab("embedded_hello", initembedded_hello) == -1) throw std::runtime_error("Failed to add embedded_hello to the interpreter's " - "builtin modules"); + "builtin modules"); // Retrieve the main module python::object main = python::import("__main__"); diff --git a/test/exec.py b/test/exec.py index 5a8faf79..5c1ad592 100644 --- a/test/exec.py +++ b/test/exec.py @@ -1,6 +1,2 @@ -# Copyright Stefan Seefeld 2006. 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) - print 'Hello World !' number = 42 diff --git a/test/keywords.cpp b/test/keywords.cpp index 39bac062..599f98d8 100755 --- a/test/keywords.cpp +++ b/test/keywords.cpp @@ -103,7 +103,6 @@ BOOST_PYTHON_MODULE(keywords) , init >() ) .def("set", &Bar::set, bar_set()) - .def("set2", &Bar::set, bar_set("set2's docstring")) .def("seta", &Bar::seta, arg("a")) .def("a", &Bar::geta) diff --git a/test/keywords_test.py b/test/keywords_test.py index aa31b76b..ff4d8014 100644 --- a/test/keywords_test.py +++ b/test/keywords_test.py @@ -80,8 +80,6 @@ >>> f.set(1,1.0,"1") >>> f.a(), f.b(), f.n() (1, 1.0, '1') ->>> f.set2.__doc__.splitlines()[-3] -"set2's docstring" ''' diff --git a/test/map_indexing_suite.cpp b/test/map_indexing_suite.cpp index 8b5e3b6e..1a548d31 100644 --- a/test/map_indexing_suite.cpp +++ b/test/map_indexing_suite.cpp @@ -26,62 +26,6 @@ std::string x_value(X const& x) return "gotya " + x.s; } -struct A -{ - int value; - A() : value(0){}; - A(int v) : value(v) {}; -}; - -bool operator==(const A& v1, const A& v2) -{ - return (v1.value == v2.value); -} - -struct B -{ - A a; -}; - -// Converter from A to python int -struct AToPython -{ - static PyObject* convert(const A& s) - { - return boost::python::incref(boost::python::object((int)s.value).ptr()); - } -}; - -// Conversion from python int to A -struct AFromPython -{ - AFromPython() - { - boost::python::converter::registry::push_back( - &convertible, - &construct, - boost::python::type_id< A >()); - } - - static void* convertible(PyObject* obj_ptr) - { - if (!PyInt_Check(obj_ptr)) return 0; - return obj_ptr; - } - - static void construct( - PyObject* obj_ptr, - boost::python::converter::rvalue_from_python_stage1_data* data) - { - void* storage = ( - (boost::python::converter::rvalue_from_python_storage< A >*) - data)-> storage.bytes; - - new (storage) A((int)PyInt_AsLong(obj_ptr)); - data->convertible = storage; - } -}; - BOOST_PYTHON_MODULE(map_indexing_suite_ext) { class_("X") @@ -114,18 +58,6 @@ BOOST_PYTHON_MODULE(map_indexing_suite_ext) class_ > >("TestMap") .def(map_indexing_suite >, true>()) ; - - to_python_converter< A , AToPython >(); - AFromPython(); - - class_< std::map >("AMap") - .def(map_indexing_suite, true >()) - ; - - class_< B >("B") - .add_property("a", make_getter(&B::a, return_value_policy()), - make_setter(&B::a, return_value_policy())) - ; } #include "module_tail.cpp" diff --git a/test/map_indexing_suite.py b/test/map_indexing_suite.py index 01fa943d..646f6194 100644 --- a/test/map_indexing_suite.py +++ b/test/map_indexing_suite.py @@ -11,7 +11,6 @@ >>> assert "map_indexing_suite_IntMap_entry" in dir() >>> assert "map_indexing_suite_TestMap_entry" in dir() >>> assert "map_indexing_suite_XMap_entry" in dir() ->>> assert "map_indexing_suite_AMap_entry" in dir() >>> x = X('hi') >>> x hi @@ -202,18 +201,6 @@ kiwi ... dom = el.data() joel kimpo -##################################################################### -# Test custom converter... -##################################################################### - ->>> am = AMap() ->>> am[3] = 4 ->>> am[3] -4 ->>> for i in am: -... i.data() -4 - ##################################################################### # END.... ##################################################################### diff --git a/test/module_tail.cpp b/test/module_tail.cpp index 02cfc6a3..594949ef 100644 --- a/test/module_tail.cpp +++ b/test/module_tail.cpp @@ -32,7 +32,7 @@ extern "C" void (*old_translator)(unsigned, EXCEPTION_POINTERS*) #include struct test_failure : std::exception { - test_failure(char const* expr, char const* /*function*/, char const* file, unsigned line) + test_failure(char const* expr, char const* function, char const* file, unsigned line) : msg(file + boost::python::str(":%s:") % line + ": Boost.Python assertion failure: " + expr) {} diff --git a/test/operators_wrapper.cpp b/test/operators_wrapper.cpp deleted file mode 100644 index f00aa2b4..00000000 --- a/test/operators_wrapper.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "boost/python.hpp" -#include - -struct vector -{ - virtual ~vector() {} - - vector operator+( const vector& x ) const - { return vector(); } - - vector& operator+=( const vector& x ) - { return *this; } - - vector operator-() const - { return *this; } -}; - -struct dvector : vector -{}; - -using namespace boost::python; - -struct vector_wrapper - : vector, wrapper< vector > -{ - vector_wrapper(vector const&) {} - vector_wrapper() {} -}; - -BOOST_PYTHON_MODULE( operators_wrapper_ext ) -{ - class_< vector_wrapper >( "vector" ) - .def( self + self ) - .def( self += self ) - .def( -self ) - ; - - scope().attr("v") = vector(); - std::auto_ptr dp(new dvector); - register_ptr_to_python< std::auto_ptr >(); - scope().attr("d") = dp; -} diff --git a/test/operators_wrapper.py b/test/operators_wrapper.py deleted file mode 100644 index 6c889b0a..00000000 --- a/test/operators_wrapper.py +++ /dev/null @@ -1,11 +0,0 @@ -from operators_wrapper_ext import * - -class D2(vector): pass -d2 = D2() - -for lhs in (v,d,d2): - -lhs - for rhs in (v,d,d2): - lhs + rhs - lhs += rhs - diff --git a/test/pickle1.cpp b/test/pickle1.cpp index c1f8c805..bcdb2633 100644 --- a/test/pickle1.cpp +++ b/test/pickle1.cpp @@ -45,8 +45,6 @@ namespace { } }; - // To support test of "pickling not enabled" error message. - struct noop {}; } BOOST_PYTHON_MODULE(pickle1_ext) @@ -56,7 +54,4 @@ BOOST_PYTHON_MODULE(pickle1_ext) .def("greet", &world::greet) .def_pickle(world_pickle_suite()) ; - - // To support test of "pickling not enabled" error message. - class_("noop"); } diff --git a/test/pickle1.py b/test/pickle1.py index 8369768d..bb66b31b 100644 --- a/test/pickle1.py +++ b/test/pickle1.py @@ -18,11 +18,6 @@ r'''>>> import pickle1_ext Hello from California! >>> print wl.greet() Hello from California! - - >>> noop = pickle1_ext.noop() - >>> try: pickle.dumps(noop) - ... except RuntimeError, e: print str(e)[:55] - Pickling of "pickle1_ext.noop" instances is not enabled ''' def run(args = None): diff --git a/test/pointer_vector.cpp b/test/pointer_vector.cpp index c1f7dbd4..4c446d1a 100644 --- a/test/pointer_vector.cpp +++ b/test/pointer_vector.cpp @@ -1,6 +1,3 @@ -// Copyright Joel de Guzman 2005-2006. 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) #include #include #include diff --git a/test/vector_indexing_suite.cpp b/test/vector_indexing_suite.cpp index 0f9cd74c..a2dd1403 100644 --- a/test/vector_indexing_suite.cpp +++ b/test/vector_indexing_suite.cpp @@ -53,10 +53,5 @@ BOOST_PYTHON_MODULE(vector_indexing_suite_ext) class_ >("BoolVec") .def(vector_indexing_suite >()) ; - - // vector of strings - class_ >("StringVec") - .def(vector_indexing_suite >()) - ; } diff --git a/test/vector_indexing_suite.py b/test/vector_indexing_suite.py index 9bb75700..302fc67c 100644 --- a/test/vector_indexing_suite.py +++ b/test/vector_indexing_suite.py @@ -321,14 +321,6 @@ e >>> print_xvec(v) [ a b c d e f g h i j ] -##################################################################### -# vector of strings -##################################################################### ->>> sv = StringVec() ->>> sv.append('a') ->>> print sv[0] -a - ##################################################################### # END.... ##################################################################### diff --git a/test/voidptr.cpp b/test/voidptr.cpp index 82e412be..9acc5b18 100755 --- a/test/voidptr.cpp +++ b/test/voidptr.cpp @@ -12,23 +12,23 @@ static void *test=(void *) 78; void *get() { - return test; + return test; } void *getnull() { - return 0; + return 0; } void use(void *a) { - if(a!=test) + if(a!=test) throw std::runtime_error(std::string("failed")); } int useany(void *a) { - return a ? 1 : 0; + return a ? 1 : 0; } @@ -36,8 +36,8 @@ namespace bpl = boost::python; BOOST_PYTHON_MODULE(voidptr_ext) { - bpl::def("get", &::get, bpl::return_value_policy()); - bpl::def("getnull", &::getnull, bpl::return_value_policy()); - bpl::def("use", &::use); - bpl::def("useany", &::useany); + bpl::def("get", &::get, bpl::return_value_policy()); + bpl::def("getnull", &::getnull, bpl::return_value_policy()); + bpl::def("use", &::use); + bpl::def("useany", &::useany); }