mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-24 06:36:08 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user