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-25 04:04:20 +0300
committerCampbell Barton <campbell@blender.org>2022-03-25 04:04:20 +0300
commit4d46fac65d9946382c4be5b3842660e77468f00b (patch)
treec2910a4ca0b2d345007bf853d6484a1b9e53e4e1 /source/blender/blenkernel/intern/image.cc
parentc594cfbe50497fdc365b3f327b643de507cda02f (diff)
Cleanup: use count or num instead of nbr
Follow conventions from T85728.
Diffstat (limited to 'source/blender/blenkernel/intern/image.cc')
-rw-r--r--source/blender/blenkernel/intern/image.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/image.cc b/source/blender/blenkernel/intern/image.cc
index c4f8677d199..b65f3416f0f 100644
--- a/source/blender/blenkernel/intern/image.cc
+++ b/source/blender/blenkernel/intern/image.cc
@@ -3113,14 +3113,15 @@ bool BKE_image_get_tile_info(char *filepath, ListBase *tiles, int *tile_start, i
int max_udim = 0;
int id;
- struct direntry *dir;
- uint totfile = BLI_filelist_dir_contents(dirname, &dir);
- for (int i = 0; i < totfile; i++) {
- if (!(dir[i].type & S_IFREG)) {
+ struct direntry *dirs;
+ const uint dirs_num = BLI_filelist_dir_contents(dirname, &dirs);
+ for (int i = 0; i < dirs_num; i++) {
+ if (!(dirs[i].type & S_IFREG)) {
continue;
}
- if (!BKE_image_get_tile_number_from_filepath(dir[i].relname, udim_pattern, tile_format, &id)) {
+ if (!BKE_image_get_tile_number_from_filepath(
+ dirs[i].relname, udim_pattern, tile_format, &id)) {
continue;
}
@@ -3133,7 +3134,7 @@ bool BKE_image_get_tile_info(char *filepath, ListBase *tiles, int *tile_start, i
min_udim = min_ii(min_udim, id);
max_udim = max_ii(max_udim, id);
}
- BLI_filelist_free(dir, totfile);
+ BLI_filelist_free(dirs, dirs_num);
MEM_SAFE_FREE(udim_pattern);
if (is_udim && min_udim <= IMA_UDIM_MAX) {
@@ -3350,15 +3351,15 @@ bool BKE_image_tile_filepath_exists(const char *filepath)
char *udim_pattern = BKE_image_get_tile_strformat(filepath, &tile_format);
bool found = false;
- struct direntry *dir;
- uint totfile = BLI_filelist_dir_contents(dirname, &dir);
- for (int i = 0; i < totfile; i++) {
- if (!(dir[i].type & S_IFREG)) {
+ struct direntry *dirs;
+ const uint dirs_num = BLI_filelist_dir_contents(dirname, &dirs);
+ for (int i = 0; i < dirs_num; i++) {
+ if (!(dirs[i].type & S_IFREG)) {
continue;
}
int id;
- if (!BKE_image_get_tile_number_from_filepath(dir[i].path, udim_pattern, tile_format, &id)) {
+ if (!BKE_image_get_tile_number_from_filepath(dirs[i].path, udim_pattern, tile_format, &id)) {
continue;
}
@@ -3369,7 +3370,7 @@ bool BKE_image_tile_filepath_exists(const char *filepath)
found = true;
break;
}
- BLI_filelist_free(dir, totfile);
+ BLI_filelist_free(dirs, dirs_num);
MEM_SAFE_FREE(udim_pattern);
return found;