diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-15 11:28:05 -0200 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-15 11:28:05 -0200 |
commit | 0a99e765efc8f86a00d0e2e1fb4e30df331fa3c3 (patch) | |
tree | fb2ec434c3567885e94125ff22561b8d546be837 /tests/samplebinding | |
parent | 2ad0dcc5860d9e791e6036a525b0114b7106031b (diff) |
Fix custom converters from libsample.
Diffstat (limited to 'tests/samplebinding')
-rw-r--r-- | tests/samplebinding/complex_conversions.h | 7 | ||||
-rw-r--r-- | tests/samplebinding/oddbool_conversions.h | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/tests/samplebinding/complex_conversions.h b/tests/samplebinding/complex_conversions.h index c42d42161..709b8dc1a 100644 --- a/tests/samplebinding/complex_conversions.h +++ b/tests/samplebinding/complex_conversions.h @@ -1,11 +1,14 @@ template<> -struct Converter<Complex> +struct Converter<Complex> : public ConverterBase<Complex> { static bool isConvertible(const PyObject* pyObj) { return PyComplex_Check(pyObj); } - static PyObject* toPython(Complex cpx) + + using ConverterBase<Complex>::toPython; + + static PyObject* toPython(const Complex& cpx) { return PyComplex_FromDoubles(cpx.real(), cpx.imag()); } diff --git a/tests/samplebinding/oddbool_conversions.h b/tests/samplebinding/oddbool_conversions.h index 7507cb52b..7baa684f9 100644 --- a/tests/samplebinding/oddbool_conversions.h +++ b/tests/samplebinding/oddbool_conversions.h @@ -1,12 +1,14 @@ template <> -struct Converter<OddBool> +struct Converter<OddBool> : public ConverterBase<OddBool> { static bool isConvertible(const PyObject* pyObj) { return PyBool_Check(pyObj); } - static PyObject* toPython(OddBool holder) + using ConverterBase<OddBool>::toPython; + + static PyObject* toPython(const OddBool& holder) { return PyBool_FromLong(holder.value()); } |