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

@@ -309,7 +309,8 @@ static PyObject *pygpu_shader_uniform_bool(BPyGPUShader *self, PyObject *args)
ret = -1;
}
else {
ret = PyC_AsArray_FAST(values, seq_fast, length, &PyLong_Type, false, error_prefix);
ret = PyC_AsArray_FAST(
values, sizeof(*values), seq_fast, length, &PyLong_Type, error_prefix);
}
Py_DECREF(seq_fast);
}
@@ -448,7 +449,8 @@ static PyObject *pygpu_shader_uniform_int(BPyGPUShader *self, PyObject *args)
ret = -1;
}
else {
ret = PyC_AsArray_FAST(values, seq_fast, length, &PyLong_Type, false, error_prefix);
ret = PyC_AsArray_FAST(
values, sizeof(*values), seq_fast, length, &PyLong_Type, error_prefix);
}
Py_DECREF(seq_fast);
}