Cleanup: style, use braces for blenlib

This commit is contained in:
2019-03-27 13:16:10 +11:00
parent 337eb8c1de
commit 9ba948a485
53 changed files with 1705 additions and 857 deletions

View File

@@ -68,8 +68,9 @@ size_t BLI_split_name_num(char *left, int *nr, const char *name, const char deli
left[a] = '\0'; /* truncate left part here */
*nr = atol(name + a + 1);
/* casting down to an int, can overflow for large numbers */
if (*nr < 0)
if (*nr < 0) {
*nr = 0;
}
return a;
}
else if (isdigit(name[a]) == 0) {
@@ -368,8 +369,9 @@ bool BLI_uniquename(ListBase *list, void *vlink, const char *defname, char delim
BLI_assert(name_len > 1);
/* See if we are given an empty string */
if (ELEM(NULL, vlink, defname))
if (ELEM(NULL, vlink, defname)) {
return false;
}
return BLI_uniquename_cb(uniquename_unique_check, &data, defname, delim, GIVE_STRADDR(vlink, name_offs), name_len);
}