Cleanup: use of the term 'len' & 'maxlen'

Only use the term len & maxlen when they represent the length & maximum
length of a string. Instead of the available bytes to use.

Also include the data they're referencing as a suffix, otherwise it's
not always clear what the length is in reference to.
This commit is contained in:
2023-05-07 15:22:58 +10:00
parent 5abb3c96cf
commit df54b627b3
49 changed files with 465 additions and 389 deletions

View File

@@ -571,12 +571,12 @@ void PyC_ObSpit(const char *name, PyObject *var)
}
}
void PyC_ObSpitStr(char *result, size_t result_len, PyObject *var)
void PyC_ObSpitStr(char *result, size_t result_maxncpy, PyObject *var)
{
/* No name, creator of string can manage that. */
const char *null_str = "<null>";
if (var == NULL) {
BLI_snprintf(result, result_len, "%s", null_str);
BLI_snprintf(result, result_maxncpy, "%s", null_str);
}
else {
const PyTypeObject *type = Py_TYPE(var);
@@ -587,7 +587,7 @@ void PyC_ObSpitStr(char *result, size_t result_len, PyObject *var)
PyErr_Clear();
}
BLI_snprintf(result,
result_len,
result_maxncpy,
" ref=%d, ptr=%p, type=%s, value=%.200s",
(int)var->ob_refcnt,
(void *)var,