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 <campbell@blender.org>2022-03-28 03:06:01 +0300
committerCampbell Barton <campbell@blender.org>2022-03-28 06:14:31 +0300
commit83c274ccfc86c168657af9de9939cd96b0fc3f41 (patch)
tree6bd70f43b81d6352aba7d08a4ee93d2a1bbbcb44 /source/blender/python/mathutils/mathutils_noise.c
parent77155ae1c03e6bd430c4a3a1b9a09bd6d245a156 (diff)
Cleanup: use "num" as a suffix in: source/blender/python
See T85728
Diffstat (limited to 'source/blender/python/mathutils/mathutils_noise.c')
-rw-r--r--source/blender/python/mathutils/mathutils_noise.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c
index 0853c5dd3ea..e1282e90c48 100644
--- a/source/blender/python/mathutils/mathutils_noise.c
+++ b/source/blender/python/mathutils/mathutils_noise.c
@@ -305,23 +305,24 @@ static PyObject *M_Noise_random_unit_vector(PyObject *UNUSED(self), PyObject *ar
static const char *kwlist[] = {"size", NULL};
float vec[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float norm = 2.0f;
- int size = 3;
+ int vec_num = 3;
- if (!PyArg_ParseTupleAndKeywords(args, kw, "|$i:random_unit_vector", (char **)kwlist, &size)) {
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kw, "|$i:random_unit_vector", (char **)kwlist, &vec_num)) {
return NULL;
}
- if (size > 4 || size < 2) {
+ if (vec_num > 4 || vec_num < 2) {
PyErr_SetString(PyExc_ValueError, "Vector(): invalid size");
return NULL;
}
while (norm == 0.0f || norm > 1.0f) {
- rand_vn(vec, size);
- norm = normalize_vn(vec, size);
+ rand_vn(vec, vec_num);
+ norm = normalize_vn(vec, vec_num);
}
- return Vector_CreatePyObject(vec, size, NULL);
+ return Vector_CreatePyObject(vec, vec_num, NULL);
}
PyDoc_STRVAR(M_Noise_random_vector_doc,
@@ -337,22 +338,22 @@ static PyObject *M_Noise_random_vector(PyObject *UNUSED(self), PyObject *args, P
{
static const char *kwlist[] = {"size", NULL};
float *vec = NULL;
- int size = 3;
+ int vec_num = 3;
- if (!PyArg_ParseTupleAndKeywords(args, kw, "|$i:random_vector", (char **)kwlist, &size)) {
+ if (!PyArg_ParseTupleAndKeywords(args, kw, "|$i:random_vector", (char **)kwlist, &vec_num)) {
return NULL;
}
- if (size < 2) {
+ if (vec_num < 2) {
PyErr_SetString(PyExc_ValueError, "Vector(): invalid size");
return NULL;
}
- vec = PyMem_New(float, size);
+ vec = PyMem_New(float, vec_num);
- rand_vn(vec, size);
+ rand_vn(vec, vec_num);
- return Vector_CreatePyObject_alloc(vec, size, NULL);
+ return Vector_CreatePyObject_alloc(vec, vec_num, NULL);
}
PyDoc_STRVAR(M_Noise_seed_set_doc,