From 89c79c3ed8d4f8cdf4f78782443bcf218425b412 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Wed, 17 Feb 2021 12:38:21 -0300 Subject: Cleanup: Abbreviate enums with 'UNSIGNED_' in the name --- source/blender/python/gpu/gpu_py.c | 6 +++--- source/blender/python/gpu/gpu_py_buffer.c | 18 +++++++++--------- source/blender/python/gpu/gpu_py_texture.c | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'source/blender/python/gpu') diff --git a/source/blender/python/gpu/gpu_py.c b/source/blender/python/gpu/gpu_py.c index 522cd89c5c0..35cc945e76c 100644 --- a/source/blender/python/gpu/gpu_py.c +++ b/source/blender/python/gpu/gpu_py.c @@ -36,9 +36,9 @@ struct PyC_StringEnumItems bpygpu_dataformat_items[] = { {GPU_DATA_FLOAT, "FLOAT"}, {GPU_DATA_INT, "INT"}, - {GPU_DATA_UNSIGNED_INT, "UINT"}, - {GPU_DATA_UNSIGNED_BYTE, "UBYTE"}, - {GPU_DATA_UNSIGNED_INT_24_8, "UINT_24_8"}, + {GPU_DATA_UINT, "UINT"}, + {GPU_DATA_UBYTE, "UBYTE"}, + {GPU_DATA_UINT_24_8, "UINT_24_8"}, {GPU_DATA_10_11_11_REV, "10_11_11_REV"}, {0, NULL}, }; diff --git a/source/blender/python/gpu/gpu_py_buffer.c b/source/blender/python/gpu/gpu_py_buffer.c index aef819aec39..c8eaa9cd5c8 100644 --- a/source/blender/python/gpu/gpu_py_buffer.c +++ b/source/blender/python/gpu/gpu_py_buffer.c @@ -57,11 +57,11 @@ static const char *pygpu_buffer_formatstr(eGPUDataFormat data_format) return "f"; case GPU_DATA_INT: return "i"; - case GPU_DATA_UNSIGNED_INT: + case GPU_DATA_UINT: return "I"; - case GPU_DATA_UNSIGNED_BYTE: + case GPU_DATA_UBYTE: return "B"; - case GPU_DATA_UNSIGNED_INT_24_8: + case GPU_DATA_UINT_24_8: case GPU_DATA_10_11_11_REV: return "I"; default: @@ -114,10 +114,10 @@ static PyObject *pygpu_buffer__sq_item(BPyGPUBuffer *self, int i) return Py_BuildValue(formatstr, self->buf.as_float[i]); case GPU_DATA_INT: return Py_BuildValue(formatstr, self->buf.as_int[i]); - case GPU_DATA_UNSIGNED_BYTE: + case GPU_DATA_UBYTE: return Py_BuildValue(formatstr, self->buf.as_byte[i]); - case GPU_DATA_UNSIGNED_INT: - case GPU_DATA_UNSIGNED_INT_24_8: + case GPU_DATA_UINT: + case GPU_DATA_UINT_24_8: case GPU_DATA_10_11_11_REV: return Py_BuildValue(formatstr, self->buf.as_uint[i]); } @@ -433,10 +433,10 @@ static int pygpu_buffer__sq_ass_item(BPyGPUBuffer *self, int i, PyObject *v) return PyArg_Parse(v, "f:Expected floats", &self->buf.as_float[i]) ? 0 : -1; case GPU_DATA_INT: return PyArg_Parse(v, "i:Expected ints", &self->buf.as_int[i]) ? 0 : -1; - case GPU_DATA_UNSIGNED_BYTE: + case GPU_DATA_UBYTE: return PyArg_Parse(v, "b:Expected ints", &self->buf.as_byte[i]) ? 0 : -1; - case GPU_DATA_UNSIGNED_INT: - case GPU_DATA_UNSIGNED_INT_24_8: + case GPU_DATA_UINT: + case GPU_DATA_UINT_24_8: case GPU_DATA_10_11_11_REV: return PyArg_Parse(v, "b:Expected ints", &self->buf.as_uint[i]) ? 0 : -1; default: diff --git a/source/blender/python/gpu/gpu_py_texture.c b/source/blender/python/gpu/gpu_py_texture.c index 97dc99f5d58..2b1b5f672b0 100644 --- a/source/blender/python/gpu/gpu_py_texture.c +++ b/source/blender/python/gpu/gpu_py_texture.c @@ -314,7 +314,7 @@ static PyObject *pygpu_texture_clear(BPyGPUTexture *self, PyObject *args, PyObje } if (shape != 1 && - ELEM(pygpu_dataformat.value_found, GPU_DATA_UNSIGNED_INT_24_8, GPU_DATA_10_11_11_REV)) { + ELEM(pygpu_dataformat.value_found, GPU_DATA_UINT_24_8, GPU_DATA_10_11_11_REV)) { PyErr_SetString(PyExc_AttributeError, "`UINT_24_8` and `10_11_11_REV` only support single values"); return NULL; @@ -330,7 +330,7 @@ static PyObject *pygpu_texture_clear(BPyGPUTexture *self, PyObject *args, PyObje return NULL; } - if (pygpu_dataformat.value_found == GPU_DATA_UNSIGNED_BYTE) { + if (pygpu_dataformat.value_found == GPU_DATA_UBYTE) { /* Convert to byte. */ values.c[0] = values.i[0]; values.c[1] = values.i[1]; @@ -362,13 +362,13 @@ static PyObject *pygpu_texture_read(BPyGPUTexture *self) break; case GPU_DEPTH24_STENCIL8: case GPU_DEPTH32F_STENCIL8: - best_data_format = GPU_DATA_UNSIGNED_INT_24_8; + best_data_format = GPU_DATA_UINT_24_8; break; case GPU_R8UI: case GPU_R16UI: case GPU_RG16UI: case GPU_R32UI: - best_data_format = GPU_DATA_UNSIGNED_INT; + best_data_format = GPU_DATA_UINT; break; case GPU_RG16I: case GPU_R16I: @@ -379,7 +379,7 @@ static PyObject *pygpu_texture_read(BPyGPUTexture *self) case GPU_RGBA8: case GPU_RGBA8UI: case GPU_SRGB8_A8: - best_data_format = GPU_DATA_UNSIGNED_BYTE; + best_data_format = GPU_DATA_UBYTE; break; case GPU_R11F_G11F_B10F: best_data_format = GPU_DATA_10_11_11_REV; -- cgit v1.2.3