From dc1ee6273068fc29774b354e0b173c699c40b001 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 28 Mar 2017 16:35:30 +0100 Subject: [PATCH] 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. --- qrenderdoc/Code/pyrenderdoc/pyconversion.h | 4 ++-- qrenderdoc/Code/pyrenderdoc/renderdoc.i | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qrenderdoc/Code/pyrenderdoc/pyconversion.h b/qrenderdoc/Code/pyrenderdoc/pyconversion.h index dcf95b27e..e5677da7c 100644 --- a/qrenderdoc/Code/pyrenderdoc/pyconversion.h +++ b/qrenderdoc/Code/pyrenderdoc/pyconversion.h @@ -318,7 +318,7 @@ struct TypeConversion, false> } static int Convert(PyObject *in, rdctype::array &out) { return Convert(in, out, NULL); } - static PyObject *ConvertList(PyObject *list, const rdctype::array &in, int *failIdx) + static PyObject *ConvertInPlace(PyObject *list, const rdctype::array &in, int *failIdx) { for(int i = 0; i < in.count; i++) { @@ -346,7 +346,7 @@ struct TypeConversion, 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) diff --git a/qrenderdoc/Code/pyrenderdoc/renderdoc.i b/qrenderdoc/Code/pyrenderdoc/renderdoc.i index 467416f6d..7bddb299d 100644 --- a/qrenderdoc/Code/pyrenderdoc/renderdoc.i +++ b/qrenderdoc/Code/pyrenderdoc/renderdoc.i @@ -179,7 +179,7 @@ // overwrite with array contents int failIdx = 0; - PyObject *res = TypeConversion::type>::ConvertList($input, *$1, &failIdx); + PyObject *res = TypeConversion::type>::ConvertInPlace($input, *$1, &failIdx); if(!res) {