Skip to content

Commit 0519d54

Browse files
author
Ralf W. Grosse-Kunstleve
committed
avoid g++ -Wall -W "unused parameter" warnings
[SVN r32373]
1 parent c181874 commit 0519d54

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

test/back_reference.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ int X::counter;
4141

4242
struct 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

5151
struct 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;

test/cltree.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ class variable: public basic {
3636

3737
class symbol_wrapper: public symbol {
3838
public:
39-
symbol_wrapper(PyObject* self): symbol() {
39+
symbol_wrapper(PyObject* /*self*/): symbol() {
4040
name = "cltree.wrapped_symbol";
4141
}
4242
};
4343

4444
class variable_wrapper: public variable {
4545
public:
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

test/exception_translator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
struct error {};
99

10-
void translate(error const& e)
10+
void translate(error const& /*e*/)
1111
{
1212
PyErr_SetString(PyExc_RuntimeError, "!!!error!!!");
1313
}

test/extract.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff 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

test/numpy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)