summaryrefslogtreecommitdiff
path: root/src/pyutils.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-13 00:42:25 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-13 00:42:25 -0400
commit40f553228f5a28034c6635fdcb4c86af28a385ed (patch)
tree2c40305c9f9841a4c3d453a4a5c49ec69056b4b2 /src/pyutils.h
parent556211e623cad88213e5087b5c9c36e754d9aa02 (diff)
parentb1b4e2aadff5983d443d70c09ea86a41b015873f (diff)
downloadfork-ledger-40f553228f5a28034c6635fdcb4c86af28a385ed.tar.gz
fork-ledger-40f553228f5a28034c6635fdcb4c86af28a385ed.tar.bz2
fork-ledger-40f553228f5a28034c6635fdcb4c86af28a385ed.zip
Merge branch 'next'
Diffstat (limited to 'src/pyutils.h')
-rw-r--r--src/pyutils.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pyutils.h b/src/pyutils.h
index e0f77003..efb1b858 100644
--- a/src/pyutils.h
+++ b/src/pyutils.h
@@ -59,8 +59,8 @@ struct register_optional_to_python : public boost::noncopyable
static PyObject * convert(const boost::optional<T>& value)
{
return boost::python::incref
- (value ? boost::python::to_python_value<T>()(*value) :
- boost::python::detail::none());
+ (value ? boost::python::to_python_value<T>()(*value) :
+ boost::python::detail::none());
}
};
@@ -71,30 +71,30 @@ struct register_optional_to_python : public boost::noncopyable
using namespace boost::python::converter;
if (source == Py_None)
- return source;
+ return source;
const registration& converters(registered<T>::converters);
if (implicit_rvalue_convertible_from_python(source, converters)) {
- rvalue_from_python_stage1_data data =
- rvalue_from_python_stage1(source, converters);
- return rvalue_from_python_stage2(source, data, converters);
+ rvalue_from_python_stage1_data data =
+ rvalue_from_python_stage1(source, converters);
+ return rvalue_from_python_stage2(source, data, converters);
}
return NULL;
}
static void construct(PyObject * source,
- boost::python::converter::rvalue_from_python_stage1_data * data)
+ boost::python::converter::rvalue_from_python_stage1_data * data)
{
using namespace boost::python::converter;
void * const storage =
- reinterpret_cast<rvalue_from_python_storage<T> *>(data)->storage.bytes;
+ reinterpret_cast<rvalue_from_python_storage<T> *>(data)->storage.bytes;
- if (data->convertible == source) // == None
- new (storage) boost::optional<T>(); // A Boost uninitialized value
+ if (data->convertible == source) // == None
+ new (storage) boost::optional<T>(); // A Boost uninitialized value
else
- new (storage) boost::optional<T>(*reinterpret_cast<T *>(data->convertible));
+ new (storage) boost::optional<T>(*reinterpret_cast<T *>(data->convertible));
data->convertible = storage;
}