Generalise function ConvertList to ConvertInPlace

* We'll use the same function for maps and we want to be able to reuse
  the typemaps and things there.
This commit is contained in:
baldurk
2017-04-18 14:57:42 +01:00
parent ab6a868057
commit dc1ee62730
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -318,7 +318,7 @@ struct TypeConversion<rdctype::array<U>, false>
}
static int Convert(PyObject *in, rdctype::array<U> &out) { return Convert(in, out, NULL); }
static PyObject *ConvertList(PyObject *list, const rdctype::array<U> &in, int *failIdx)
static PyObject *ConvertInPlace(PyObject *list, const rdctype::array<U> &in, int *failIdx)
{
for(int i = 0; i < in.count; i++)
{
@@ -346,7 +346,7 @@ struct TypeConversion<rdctype::array<U>, false>
if(!list)
return NULL;
PyObject *ret = ConvertList(list, in, failIdx);
PyObject *ret = ConvertInPlace(list, in, failIdx);
// if a failure happened, don't leak the list we created
if(!ret)
+1 -1
View File
@@ -179,7 +179,7 @@
// overwrite with array contents
int failIdx = 0;
PyObject *res = TypeConversion<std::remove_pointer<decltype($1)>::type>::ConvertList($input, *$1, &failIdx);
PyObject *res = TypeConversion<std::remove_pointer<decltype($1)>::type>::ConvertInPlace($input, *$1, &failIdx);
if(!res)
{