Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-10-09 01:25:33 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-09 01:25:33 +0300
commitd592eb510e654666cc7b240aa379f4e529cd43c8 (patch)
tree9078baf13d729f03c3fca9387f57c4c029ec82ce /source/blender/python/gpu/gpu_py_vertex_format.c
parent733e6c0b1d2433166b7326c3654c5ece7ce17b88 (diff)
Cleanup: naming
Diffstat (limited to 'source/blender/python/gpu/gpu_py_vertex_format.c')
-rw-r--r--source/blender/python/gpu/gpu_py_vertex_format.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/python/gpu/gpu_py_vertex_format.c b/source/blender/python/gpu/gpu_py_vertex_format.c
index 65d41a7baf1..d42bb557cd9 100644
--- a/source/blender/python/gpu/gpu_py_vertex_format.c
+++ b/source/blender/python/gpu/gpu_py_vertex_format.c
@@ -160,36 +160,38 @@ static int get_default_fetch_mode(GPUVertCompType type)
/** \name VertFormat Type
* \{ */
-static int add_attribute_simple(GPUVertFormat *format, char *name, GPUVertCompType comp_type, int length)
+static bool bpygpu_vertformat_attr_add_simple(
+ GPUVertFormat *format, const char *name, GPUVertCompType comp_type, int length)
{
if (length <= 0) {
PyErr_SetString(PyExc_ValueError,
"length of an attribute must greater than 0");
- return 0;
+ return false;
}
int fetch_mode = get_default_fetch_mode(comp_type);
if (fetch_mode == -1) {
PyErr_SetString(PyExc_ValueError,
"no default fetch mode found");
- return 0;
+ return false;
}
GPU_vertformat_attr_add(format, name, comp_type, length, fetch_mode);
- return 1;
+ return true;
}
-static int add_attribute_from_tuple(GPUVertFormat *format, PyObject *data)
+static bool bpygpu_vertformat_attr_add_from_tuple(
+ GPUVertFormat *format, PyObject *data)
{
- char *name;
+ const char *name;
GPUVertCompType comp_type;
int length;
if (!PyArg_ParseTuple(data, "sO&i", &name, bpygpu_ParseVertCompType, &comp_type, &length)) {
- return 0;
+ return false;
}
- return add_attribute_simple(format, name, comp_type, length);
+ return bpygpu_vertformat_attr_add_simple(format, name, comp_type, length);
}
static PyObject *bpygpu_VertFormat_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
@@ -308,7 +310,7 @@ bool bpygpu_vertformat_from_PyList(
return false;
}
- if (!add_attribute_from_tuple(r_fmt, element)) {
+ if (!bpygpu_vertformat_attr_add_from_tuple(r_fmt, element)) {
return false;
}
}