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

@@ -144,8 +144,12 @@ static PyObject *pygpu_IndexBuf__tp_new(PyTypeObject *UNUSED(type), PyObject *ar
goto finally;
}
ok = PyC_AsArray_FAST(
values, seq_fast_item, verts_per_prim, &PyLong_Type, false, error_prefix) == 0;
ok = PyC_AsArray_FAST(values,
sizeof(*values),
seq_fast_item,
verts_per_prim,
&PyLong_Type,
error_prefix) == 0;
if (ok) {
for (uint j = 0; j < verts_per_prim; j++) {