From 83c274ccfc86c168657af9de9939cd96b0fc3f41 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 28 Mar 2022 11:06:01 +1100 Subject: Cleanup: use "num" as a suffix in: source/blender/python See T85728 --- source/blender/python/mathutils/mathutils_noise.c | 25 ++++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'source/blender/python/mathutils/mathutils_noise.c') 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, -- cgit v1.2.3