Cleanup: pass sizeof array element to PyC_AsArray

Replace the is_double argument which was only used for single/double
precision floats.

This allows supporting different sized int types more easily.
This commit is contained in:
2021-07-27 22:26:33 +10:00
parent b1a2abd6b2
commit 58eacb8e7c
9 changed files with 89 additions and 46 deletions

View File

@@ -1836,7 +1836,7 @@ static int BPy_IDArray_ass_slice(BPy_IDArray *self, int begin, int end, PyObject
/* NOTE: we count on int/float being the same size here */
vec = MEM_mallocN(alloc_len, "array assignment");
if (PyC_AsArray(vec, seq, size, py_type, is_double, "slice assignment: ") == -1) {
if (PyC_AsArray(vec, elem_size, seq, size, py_type, "slice assignment: ") == -1) {
MEM_freeN(vec);
return -1;
}