Skip to content

Commit b211f8a

Browse files
committed
Modified Files:
index.htm - fixed reference to CVS repository libs/python/build/Jamfile - first stab at metrowerks Pro7 support status/Jamfile - added RUN_ALL_TESTS variables to force tests to run tools/build/boost-build.jam - fix BOOST_BUILD_INSTALLATION setting tools/build/metrowerks-tools.jam - command file support tools/build/msvc-tools.jam - permanent command file support tools/build/intel-win32-tools.jam - made it an extension of msvc-tools.jam tools/build/gcc-tools.jam - made FINDLIBS change submitted by Toon Knapen tools/build/jam_src/variable.c - changed command-line/env. variable interpretation so that surrounding them with quotes causes no breaking at spaces. These files were converted from tabs to spaces: boost/python/conversions.hpp boost/python/reference.hpp boost/python/detail/base_object.hpp boost/python/detail/functions.hpp boost/python/detail/wrap_python.hpp libs/python/test/comprehensive.cpp tools/build/boost-base.jam tools/build/como-tools.jam [SVN r11652]
1 parent b4a1a6c commit b211f8a

File tree

7 files changed

+84
-79
lines changed

7 files changed

+84
-79
lines changed

build/Jamfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ rule boost-python
132132
# standard requirements
133133
$(BOOST_PYTHON_INCLUDES)
134134
<msvc><*><library-path>$(PYTHON_LIB_PATH)
135+
<metrowerks><*><library-file>$(PYTHON_LIB_PATH)/python22.lib
135136
<gcc><*><library-file>$(PYTHON_LIBS)
136137
$(PYTHON_PROPERTIES)
137138

include/boost/python/conversions.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ inline void xdecref_impl(PyObject* p) { Py_XDECREF(p); }
7474
template <class T>
7575
inline void decref(T* p)
7676
{
77-
char* const raw_p = reinterpret_cast<char*>(p);
78-
char* const p_base = raw_p - offsetof(PyObject, ob_refcnt);
79-
decref_impl(reinterpret_cast<PyObject*>(p_base));
77+
char* const raw_p = reinterpret_cast<char*>(p);
78+
char* const p_base = raw_p - offsetof(PyObject, ob_refcnt);
79+
decref_impl(reinterpret_cast<PyObject*>(p_base));
8080
}
8181

8282
template <class T>
8383
inline void xdecref(T* p)
8484
{
85-
char* const raw_p = reinterpret_cast<char*>(p);
86-
char* const p_base = raw_p - offsetof(PyObject, ob_refcnt);
87-
xdecref_impl(reinterpret_cast<PyObject*>(p_base));
85+
char* const raw_p = reinterpret_cast<char*>(p);
86+
char* const p_base = raw_p - offsetof(PyObject, ob_refcnt);
87+
xdecref_impl(reinterpret_cast<PyObject*>(p_base));
8888
}
8989

9090
namespace detail {
@@ -294,22 +294,22 @@ inline PyObject* to_python(float f)
294294

295295
inline PyObject* to_python(long l)
296296
{
297-
return PyInt_FromLong(l);
297+
return PyInt_FromLong(l);
298298
}
299299

300300
inline PyObject* to_python(int x)
301301
{
302-
return PyInt_FromLong(x);
302+
return PyInt_FromLong(x);
303303
}
304304

305305
inline PyObject* to_python(short x)
306306
{
307-
return PyInt_FromLong(x);
307+
return PyInt_FromLong(x);
308308
}
309309

310310
inline PyObject* to_python(bool b)
311311
{
312-
return PyInt_FromLong(b);
312+
return PyInt_FromLong(b);
313313
}
314314

315315
inline PyObject* to_python(void)
@@ -319,7 +319,7 @@ inline PyObject* to_python(void)
319319

320320
inline PyObject* to_python(const char* s)
321321
{
322-
return PyString_FromString(s);
322+
return PyString_FromString(s);
323323
}
324324

325325
inline std::string from_python(PyObject* p, boost::python::type<const std::string&>)

include/boost/python/detail/base_object.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ base_object<PythonType>::base_object(PyTypeObject* type_obj)
4848
#if !defined(_MSC_VER) || defined(__STLPORT)
4949
std::
5050
#endif
51-
memset(bp, 0, sizeof(base_python_type));
51+
memset(bp, 0, sizeof(base_python_type));
5252
Py_INCREF(type_obj);
5353
PyObject_INIT(bp, type_obj);
5454
}

include/boost/python/detail/functions.hpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ class function : public python_object
5959
template <class R, class F>
6060
struct wrapped_function_pointer : function
6161
{
62-
typedef F ptr_fun; // pointer-to--function or pointer-to-member-function
63-
64-
wrapped_function_pointer(ptr_fun pf)
62+
typedef F ptr_fun; // pointer-to--function or pointer-to-member-function
63+
64+
wrapped_function_pointer(ptr_fun pf)
6565
: m_pf(pf) {}
6666

6767
private:
68-
PyObject* do_call(PyObject* args, PyObject* keywords) const
68+
PyObject* do_call(PyObject* args, PyObject* keywords) const
6969
{
7070
// This is where the boundary between the uniform Python function
7171
// interface and the statically-checked C++ function interface is
@@ -77,7 +77,7 @@ struct wrapped_function_pointer : function
7777
{ return typeid(F).name(); }
7878

7979
private:
80-
const ptr_fun m_pf;
80+
const ptr_fun m_pf;
8181
};
8282

8383
// raw_arguments_function
@@ -87,13 +87,13 @@ struct wrapped_function_pointer : function
8787
template <class Ret, class Args, class Keywords>
8888
struct raw_arguments_function : function
8989
{
90-
typedef Ret (*ptr_fun)(Args, Keywords);
91-
92-
raw_arguments_function(ptr_fun pf)
90+
typedef Ret (*ptr_fun)(Args, Keywords);
91+
92+
raw_arguments_function(ptr_fun pf)
9393
: m_pf(pf) {}
9494

9595
private:
96-
PyObject* do_call(PyObject* args, PyObject* keywords) const
96+
PyObject* do_call(PyObject* args, PyObject* keywords) const
9797
{
9898
ref dict(keywords ?
9999
ref(keywords, ref::increment_count) :
@@ -108,7 +108,7 @@ struct raw_arguments_function : function
108108
{ return typeid(ptr_fun).name(); }
109109

110110
private:
111-
const ptr_fun m_pf;
111+
const ptr_fun m_pf;
112112
};
113113

114114
// virtual_function<> --
@@ -127,19 +127,19 @@ template <class T, class R, class V, class D>
127127
class virtual_function : public function
128128
{
129129
public:
130-
virtual_function(V virtual_function_ptr, D default_implementation)
130+
virtual_function(V virtual_function_ptr, D default_implementation)
131131
: m_virtual_function_ptr(virtual_function_ptr),
132132
m_default_implementation(default_implementation)
133133
{}
134134

135135
private:
136-
PyObject* do_call(PyObject* args, PyObject* keywords) const;
136+
PyObject* do_call(PyObject* args, PyObject* keywords) const;
137137

138138
const char* description() const
139139
{ return typeid(V).name(); }
140140

141141
private:
142-
const V m_virtual_function_ptr;
142+
const V m_virtual_function_ptr;
143143
const D m_default_implementation;
144144
};
145145

@@ -160,7 +160,7 @@ template <class F>
160160
inline function* new_wrapped_function(F pmf)
161161
{
162162
// Deduce the return type and pass it off to the helper function above
163-
return new_wrapped_function_aux(return_value(pmf), pmf);
163+
return new_wrapped_function_aux(return_value(pmf), pmf);
164164
}
165165

166166
template <class R, class Args, class keywords>
@@ -220,7 +220,7 @@ class bound_function : public python_object
220220
private: // data members for allocation/deallocation optimization
221221
bound_function* m_free_list_link;
222222

223-
static bound_function* free_list;
223+
static bound_function* free_list;
224224
};
225225

226226
// Special functions designed to access data members of a wrapped C++ object.

include/boost/python/detail/wrap_python.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,9 @@ typedef int pid_t;
9090

9191
#if !defined(PY_MAJOR_VERSION) || PY_MAJOR_VERSION < 2
9292
# define PyObject_INIT(op, typeobj) \
93-
( (op)->ob_type = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
93+
( (op)->ob_type = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
94+
#endif
95+
96+
#ifdef __MWERKS__
97+
# pragma warn_possunwant off
9498
#endif

include/boost/python/reference.hpp

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,31 @@ BOOST_PYTHON_IMPORT_CONVERSION(py_ptr_conversions);
4242

4343
template <class T>
4444
class reference
45-
: public py_ptr_conversions<reference<T>, T>
45+
: public py_ptr_conversions<reference<T>, T>
4646
{
4747
public:
4848
typedef T value_type;
4949

50-
reference(const reference& rhs)
51-
: m_p(rhs.m_p)
52-
{
53-
Py_XINCREF(object());
54-
}
50+
reference(const reference& rhs)
51+
: m_p(rhs.m_p)
52+
{
53+
Py_XINCREF(object());
54+
}
5555

5656
#if !defined(BOOST_MSVC6_OR_EARLIER)
57-
template <class T2>
58-
reference(const reference<T2>& rhs)
59-
: m_p(rhs.object())
60-
{
61-
Py_XINCREF(object());
62-
}
57+
template <class T2>
58+
reference(const reference<T2>& rhs)
59+
: m_p(rhs.object())
60+
{
61+
Py_XINCREF(object());
62+
}
6363
#endif
6464

65-
reference() : m_p(0) {}
65+
reference() : m_p(0) {}
6666

6767
// These are two ways of spelling the same thing, that we need to increment
6868
// the reference count on the pointer when we're initialized.
69-
enum increment_count_t { increment_count };
69+
enum increment_count_t { increment_count };
7070

7171
enum allow_null { null_ok };
7272

@@ -77,57 +77,57 @@ class reference
7777
template <class T2>
7878
reference(T2* x, increment_count_t)
7979
: m_p(expect_non_null(x)) { Py_INCREF(object()); }
80-
80+
8181
template <class T2>
8282
reference(T2* x, allow_null)
8383
: m_p(x) {}
8484

8585
template <class T2>
8686
reference(T2* x, allow_null, increment_count_t)
8787
: m_p(x) { Py_XINCREF(object()); }
88-
88+
8989
template <class T2>
9090
reference(T2* x, increment_count_t, allow_null)
9191
: m_p(x) { Py_XINCREF(object()); }
92-
92+
9393
#if !defined(BOOST_MSVC6_OR_EARLIER)
94-
template <class T2>
95-
reference& operator=(const reference<T2>& rhs)
96-
{
97-
Py_XDECREF(object());
98-
m_p = rhs.m_p;
99-
Py_XINCREF(object());
100-
return *this;
101-
}
94+
template <class T2>
95+
reference& operator=(const reference<T2>& rhs)
96+
{
97+
Py_XDECREF(object());
98+
m_p = rhs.m_p;
99+
Py_XINCREF(object());
100+
return *this;
101+
}
102102
#endif
103103

104-
reference& operator=(const reference& rhs)
105-
{
106-
Py_XINCREF(static_cast<PyObject*>(rhs.m_p));
107-
Py_XDECREF(object());
108-
m_p = rhs.m_p;
109-
return *this;
110-
}
111-
112-
~reference()
113-
{
114-
Py_XDECREF(m_p);
115-
}
116-
117-
T& operator*() const { return *m_p; }
104+
reference& operator=(const reference& rhs)
105+
{
106+
Py_XINCREF(static_cast<PyObject*>(rhs.m_p));
107+
Py_XDECREF(object());
108+
m_p = rhs.m_p;
109+
return *this;
110+
}
111+
112+
~reference()
113+
{
114+
Py_XDECREF(m_p);
115+
}
116+
117+
T& operator*() const { return *m_p; }
118118

119119
// MSVC doesn't like boost::dereferencable unless T has a default
120120
// constructor, so operator-> must be defined by hand :(
121121
T* operator->() const { return &**this; }
122122

123-
T* get() const { return m_p; }
123+
T* get() const { return m_p; }
124124

125-
T* release()
126-
{
127-
T* p = m_p;
128-
m_p = 0;
129-
return p;
130-
}
125+
T* release()
126+
{
127+
T* p = m_p;
128+
m_p = 0;
129+
return p;
130+
}
131131

132132
void reset()
133133
{ Py_XDECREF(m_p); m_p = 0; }
@@ -139,19 +139,19 @@ class reference
139139
template <class T2>
140140
void reset(T2* x, increment_count_t)
141141
{ Py_XDECREF(m_p); m_p = expect_non_null(x); Py_INCREF(object()); }
142-
142+
143143
template <class T2>
144144
void reset(T2* x, allow_null)
145145
{ Py_XDECREF(m_p); m_p = x;}
146146

147147
template <class T2>
148148
void reset(T2* x, allow_null, increment_count_t)
149149
{ Py_XDECREF(m_p); m_p = x; Py_XINCREF(object()); }
150-
150+
151151
template <class T2>
152152
void reset(T2* x, increment_count_t, allow_null)
153153
{ Py_XDECREF(m_p); m_p = x; Py_XINCREF(object()); }
154-
154+
155155
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
156156
private:
157157
template<typename Y> friend class shared_ptr;
@@ -160,7 +160,7 @@ class reference
160160
inline PyObject* object() const
161161
{ return as_object(m_p); }
162162

163-
T* m_p;
163+
T* m_p;
164164
};
165165

166166
typedef reference<PyObject> ref;

test/comprehensive.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ int IntPairPythonClass::getattr(const IntPair& p, const std::string& s)
157157
PyErr_SetString(PyExc_AttributeError, s.c_str());
158158
throw boost::python::error_already_set();
159159
}
160-
#if defined(__MWERKS__) && __MWERKS__ <= 0x2400
160+
#if defined(__MWERKS__) && __MWERKS__ <= 0x2405
161161
return 0;
162162
#endif
163163
}

0 commit comments

Comments
 (0)