File tree Expand file tree Collapse file tree 5 files changed +15
-12
lines changed
Expand file tree Collapse file tree 5 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -41,17 +41,17 @@ int X::counter;
4141
4242struct Y : X
4343{
44- Y (PyObject* self, int x) : X(x) {};
45- Y (PyObject* self, Y const & rhs) : X(rhs), self(self) {};
44+ Y (PyObject* self, int x) : X(x), self(self) {}
45+ Y (PyObject* self, Y const & rhs) : X(rhs), self(self) {}
4646 private:
4747 Y (Y const &);
4848 PyObject* self;
4949};
5050
5151struct Z : X
5252{
53- Z (PyObject* self, int x) : X(x) {};
54- Z (PyObject* self, Z const & rhs) : X(rhs), self(self) {};
53+ Z (PyObject* self, int x) : X(x), self(self) {}
54+ Z (PyObject* self, Z const & rhs) : X(rhs), self(self) {}
5555 private:
5656 Z (Z const &);
5757 PyObject* self;
Original file line number Diff line number Diff line change @@ -36,20 +36,20 @@ class variable: public basic {
3636
3737class symbol_wrapper : public symbol {
3838public:
39- symbol_wrapper (PyObject* self): symbol() {
39+ symbol_wrapper (PyObject* /* self*/ ): symbol() {
4040 name = " cltree.wrapped_symbol" ;
4141 }
4242};
4343
4444class variable_wrapper : public variable {
4545public:
46- variable_wrapper (PyObject* self): variable() {
46+ variable_wrapper (PyObject* /* self*/ ): variable() {
4747 name = " cltree.wrapped_variable" ;
4848 }
4949
5050 // This constructor is introduced only because cannot use
5151 // boost::noncopyable, see below.
52- variable_wrapper (PyObject* self,variable v): variable(v) {}
52+ variable_wrapper (PyObject* /* self*/ ,variable v): variable(v) {}
5353
5454};
5555
Original file line number Diff line number Diff line change 77
88struct error {};
99
10- void translate (error const & e )
10+ void translate (error const & /* e */ )
1111{
1212 PyErr_SetString (PyExc_RuntimeError, " !!!error!!!" );
1313}
Original file line number Diff line number Diff line change @@ -29,8 +29,9 @@ boost::python::list extract_list(object x)
2929 // Make sure we always have the right idea about whether it's a list
3030 bool is_list_1 = get_list.check ();
3131 bool is_list_2 = PyObject_IsInstance (x.ptr (), (PyObject*)&PyList_Type);
32- assert (is_list_1 == is_list_2);
33-
32+ if (is_list_1 != is_list_2) {
33+ throw std::runtime_error (" is_list_1 == is_list_2 failure." );
34+ }
3435 return get_list ();
3536}
3637
@@ -131,7 +132,9 @@ BOOST_PYTHON_MODULE(extract_ext)
131132
132133 // Get the C++ object out of the Python object
133134 X const & x = extract<X&>(x_obj);
134- assert (x.value () == 3 );
135+ if (x.value () != 3 ) {
136+ throw std::runtime_error (" x.value() == 3 failure." );
137+ }
135138}
136139
137140
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ object new_array()
2323}
2424
2525// test argument conversion
26- void take_array (numeric::array x )
26+ void take_array (numeric::array /* x */ )
2727{
2828}
2929
You can’t perform that action at this time.
0 commit comments