diff options
author | mano-wii <germano.costa@ig.com.br> | 2018-10-06 07:15:15 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2018-10-06 07:15:15 +0300 |
commit | 495a7128cb230a26bc72cb735e33be5324bf3baa (patch) | |
tree | 6cee7ac416017617b102c56e8747ef8ee01436e3 /source/blender/python/gpu/gpu_py_element.c | |
parent | 0f5533441390d049d2b85e86abdd57b5a874e530 (diff) |
Cleanup: use the naming convention in py_capi_utils
And use inline functions instead of preprocessor directives.
Diffstat (limited to 'source/blender/python/gpu/gpu_py_element.c')
-rw-r--r-- | source/blender/python/gpu/gpu_py_element.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/source/blender/python/gpu/gpu_py_element.c b/source/blender/python/gpu/gpu_py_element.c index 0c4cd1d815b..379cd0836ca 100644 --- a/source/blender/python/gpu/gpu_py_element.c +++ b/source/blender/python/gpu/gpu_py_element.c @@ -91,17 +91,11 @@ static PyObject *bpygpu_IndexBuf_new(PyTypeObject *UNUSED(type), PyObject *args, return NULL; } - bool format_error = pybuffer.itemsize != 4; + if (pybuffer.itemsize != 4 || + PyC_Formatstr_is_float(PyC_Formatstr_get(pybuffer.format))) { - char format = FORMAT_STR_GET(pybuffer.format); - if (FORMAT_STR_IS_FLOAT(format)) { - format_error = true; - } - } - - if (format_error) { PyErr_Format(PyExc_ValueError, - "Each index must be an integer value with 4 bytes in size"); + "Each index must be an 4-bytes integer value"); return NULL; } |