Cleanup: rename checks for Python struct strings

Using 'format' prefix made this read as if t was for string formatting.

Use 'PyC_StructFmt' prefix instead since these values are compatible
with formatting from Python's 'struct' module.
This commit is contained in:
2018-10-08 08:37:32 +11:00
parent 1fd1735df0
commit d022794cad
5 changed files with 21 additions and 21 deletions

View File

@@ -92,7 +92,7 @@ static PyObject *bpygpu_IndexBuf_new(PyTypeObject *UNUSED(type), PyObject *args,
}
if (pybuffer.itemsize != 4 ||
PyC_Formatchar_is_floating_type(PyC_Formatchar_get(pybuffer.format)))
PyC_StructFmt_type_is_float_any(PyC_StructFmt_type_from_str(pybuffer.format)))
{
PyErr_Format(PyExc_ValueError,
"Each index must be an 4-bytes integer value");