Cleanup: use "num" as a suffix in: source/blender/python

See T85728
This commit is contained in:
2022-03-28 11:06:01 +11:00
parent 77155ae1c0
commit 83c274ccfc
15 changed files with 547 additions and 540 deletions

View File

@@ -24,7 +24,7 @@
void bpy_app_generic_callback(struct Main *main,
struct PointerRNA **pointers,
const int num_pointers,
const int pointers_num,
void *arg);
static PyTypeObject BlenderAppCbType;
@@ -305,7 +305,7 @@ static PyObject *choose_arguments(PyObject *func, PyObject *args_all, PyObject *
/* the actual callback - not necessarily called from py */
void bpy_app_generic_callback(struct Main *UNUSED(main),
struct PointerRNA **pointers,
const int num_pointers,
const int pointers_num,
void *arg)
{
PyObject *cb_list = py_cb_array[POINTER_AS_INT(arg)];
@@ -320,14 +320,14 @@ void bpy_app_generic_callback(struct Main *UNUSED(main),
Py_ssize_t pos;
/* setup arguments */
for (int i = 0; i < num_pointers; ++i) {
for (int i = 0; i < pointers_num; ++i) {
PyTuple_SET_ITEM(args_all, i, pyrna_struct_CreatePyObject(pointers[i]));
}
for (int i = num_pointers; i < num_arguments; ++i) {
for (int i = pointers_num; i < num_arguments; ++i) {
PyTuple_SET_ITEM(args_all, i, Py_INCREF_RET(Py_None));
}
if (num_pointers == 0) {
if (pointers_num == 0) {
PyTuple_SET_ITEM(args_single, 0, Py_INCREF_RET(Py_None));
}
else {

View File

@@ -377,15 +377,15 @@ static int validate_array(PyObject *rvalue,
totdim);
return -1;
}
if (pymat->num_col != dimsize[0] || pymat->num_row != dimsize[1]) {
if (pymat->col_num != dimsize[0] || pymat->row_num != dimsize[1]) {
PyErr_Format(PyExc_ValueError,
"%s %.200s.%.200s, matrix assign dimension size mismatch, "
"is %dx%d, expected be %dx%d",
error_prefix,
RNA_struct_identifier(ptr->type),
RNA_property_identifier(prop),
pymat->num_col,
pymat->num_row,
pymat->col_num,
pymat->row_num,
dimsize[0],
dimsize[1]);
return -1;
@@ -473,7 +473,7 @@ static char *copy_values(PyObject *seq,
if (dim == 0) {
if (MatrixObject_Check(seq)) {
MatrixObject *pymat = (MatrixObject *)seq;
const size_t allocsize = pymat->num_col * pymat->num_row * sizeof(float);
const size_t allocsize = pymat->col_num * pymat->row_num * sizeof(float);
/* read callback already done by validate */
/* since this is the first iteration we can assume data is allocated */