summaryrefslogtreecommitdiff
path: root/python/pyutils.h
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyutils.h')
-rw-r--r--python/pyutils.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/pyutils.h b/python/pyutils.h
index bdb1f142..006f75ac 100644
--- a/python/pyutils.h
+++ b/python/pyutils.h
@@ -90,12 +90,13 @@ struct register_optional_to_python : public boost::noncopyable
{
using namespace boost::python::converter;
- void * const storage = ((rvalue_from_python_storage<T> *) data)->storage.bytes;
+ void * const storage =
+ reinterpret_cast<rvalue_from_python_storage<T> *>(data)->storage.bytes;
if (data->convertible == source) // == None
new (storage) boost::optional<T>(); // A Boost uninitialized value
else
- new (storage) boost::optional<T>(*static_cast<T *>(data->convertible));
+ new (storage) boost::optional<T>(*reinterpret_cast<T *>(data->convertible));
data->convertible = storage;
}
@@ -103,7 +104,7 @@ struct register_optional_to_python : public boost::noncopyable
explicit register_optional_to_python() {
register_python_conversion<boost::optional<T>,
- optional_to_python, optional_from_python>();
+ optional_to_python, optional_from_python>();
}
};