Fix -Wextra warnings
This commit is contained in:
1 parent
0cea54ded6
commit
9f3a4be4ab
4 files changed
+13
-8
No files matched your search
+4
-1
@@ -9,16 +9,19 @@ struct D *DCreate (void)
|
||||
void DDoA (struct D *d)
|
||||
{
|
||||
std::cout << "DDoA" << std::endl;
|
||||
d++;
|
||||
}
|
||||
void DDoB (struct D &d)
|
||||
{
|
||||
std::cout << "DDoB" << std::endl;
|
||||
d.d++;
|
||||
}
|
||||
void DDoC (const struct D &d)
|
||||
{
|
||||
std::cout << "DDoC" << std::endl;
|
||||
std::cout << "DDoC: " << d.d << std::endl;
|
||||
}
|
||||
void DDestroy (struct D *d)
|
||||
{
|
||||
std::cout << "DDestroy" << std::endl;
|
||||
d++;
|
||||
}
|
||||
@@ -1872,7 +1872,7 @@ static void
|
||||
def _generate_tp_richcompare(self, code_sink):
|
||||
tp_richcompare_function_name = "_wrap_%s__tp_richcompare" % (self.pystruct,)
|
||||
|
||||
code_sink.writeln("static PyObject*\n%s (%s *self, %s *other, int opid)"
|
||||
code_sink.writeln("static PyObject*\n%s (%s *PYBINDGEN_UNUSED(self), %s *other, int opid)"
|
||||
% (tp_richcompare_function_name, self.pystruct, self.pystruct))
|
||||
code_sink.writeln("{")
|
||||
code_sink.indent()
|
||||
|
||||
@@ -148,10 +148,12 @@ class PyNumberMethods(object):
|
||||
' (binaryfunc) %(nb_true_divide)s,\n'
|
||||
' (binaryfunc) %(nb_inplace_floor_divide)s,\n'
|
||||
' (binaryfunc) %(nb_inplace_true_divide)s,\n'
|
||||
#'\n'
|
||||
#' /* Added in release 2.5 */\n'
|
||||
#' (unaryfunc) %(nb_index)s,\n'
|
||||
'\n'
|
||||
'#if PY_VERSION_HEX >= 0x020500F0\n'
|
||||
' /* Added in release 2.5 */\n'
|
||||
' (unaryfunc) %(nb_index)s,\n'
|
||||
'\n'
|
||||
'#endif\n'
|
||||
'};\n'
|
||||
)
|
||||
|
||||
@@ -203,7 +205,7 @@ class PyNumberMethods(object):
|
||||
slots.setdefault('nb_true_divide', 'NULL')
|
||||
slots.setdefault('nb_inplace_floor_divide', 'NULL')
|
||||
slots.setdefault('nb_inplace_true_divide', 'NULL')
|
||||
#slots.setdefault('nb_index', 'NULL')
|
||||
slots.setdefault('nb_index', 'NULL')
|
||||
|
||||
code_sink.writeln(self.TEMPLATE % slots)
|
||||
|
||||
+2
-2
@@ -54,7 +54,7 @@ public:
|
||||
Foo () : m_datum (""), m_initialized (false)
|
||||
{ Foo::instance_count++; }
|
||||
|
||||
Foo (int xpto) DEPRECATED : m_initialized (false) {}
|
||||
Foo (int xpto) DEPRECATED : m_initialized (false) { xpto++; }
|
||||
|
||||
Foo (std::string const &datum) : m_datum (datum), m_initialized (false)
|
||||
{ Foo::instance_count++; }
|
||||
@@ -679,7 +679,7 @@ class AbstractXptoImpl : public AbstractXpto
|
||||
public:
|
||||
AbstractXptoImpl () {}
|
||||
|
||||
virtual void something (int x) const {}
|
||||
virtual void something (int x) const { x++; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user