diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-08 00:37:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-08 00:37:32 +0300 |
commit | d022794cad977229386934e7d25365270671874f (patch) | |
tree | ec43bc243fc0259d827e65a82fa12f93e3f3e8ac /source/blender/python/generic/idprop_py_api.c | |
parent | 1fd1735df0bf2aa39b863a372a2e0f0ad91d1545 (diff) |
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.
Diffstat (limited to 'source/blender/python/generic/idprop_py_api.c')
-rw-r--r-- | source/blender/python/generic/idprop_py_api.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index 3eef3a1aa28..03ec8e54d07 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -424,13 +424,13 @@ static IDProperty *idp_from_PyBytes(const char *name, PyObject *ob) static int idp_array_type_from_formatstr_and_size(const char *typestr, Py_ssize_t itemsize) { - char format = PyC_Formatchar_get(typestr); + char format = PyC_StructFmt_type_from_str(typestr); - if (PyC_Formatchar_is_floating_type(format)) { + if (PyC_StructFmt_type_is_float_any(format)) { if (itemsize == 4) return IDP_FLOAT; if (itemsize == 8) return IDP_DOUBLE; } - if (PyC_Formatchar_is_integer_type(format)) { + if (PyC_StructFmt_type_is_int_any(format)) { if (itemsize == 4) return IDP_INT; } @@ -540,9 +540,9 @@ static IDProperty *idp_from_PySequence(const char *name, PyObject *ob) if (PyObject_CheckBuffer(ob)) { PyObject_GetBuffer(ob, &buffer, PyBUF_SIMPLE | PyBUF_FORMAT); - char format = PyC_Formatchar_get(buffer.format); - if (PyC_Formatchar_is_floating_type(format) || - (PyC_Formatchar_is_integer_type(format) && buffer.itemsize == 4)) + char format = PyC_StructFmt_type_from_str(buffer.format); + if (PyC_StructFmt_type_is_float_any(format) || + (PyC_StructFmt_type_is_int_any(format) && buffer.itemsize == 4)) { use_buffer = true; } |