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-04-26 07:25:58 +0300
committerCampbell Barton <campbell@blender.org>2022-04-26 07:25:58 +0300
commit6d12bc9e918d47f39135750f9d99f901f88efc44 (patch)
tree752020c03cecc7a447eb9878601ee79527e957aa /source/blender/blenkernel/intern/pointcache.c
parenta9d1b3d7e3e9fa52c811d9807c8a26aa1c64b327 (diff)
Cleanup: use boolean arguments and return values
Diffstat (limited to 'source/blender/blenkernel/intern/pointcache.c')
-rw-r--r--source/blender/blenkernel/intern/pointcache.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index d5d304343df..34720bf7d6b 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1399,7 +1399,8 @@ static size_t ptcache_filename_ext_append(PTCacheID *pid,
return len;
}
-static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_path, short do_ext)
+static int ptcache_filename(
+ PTCacheID *pid, char *filename, int cfra, const bool do_path, const bool do_ext)
{
int len = 0;
char *idname;
@@ -1464,7 +1465,7 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra)
}
}
- ptcache_filename(pid, filename, cfra, 1, 1);
+ ptcache_filename(pid, filename, cfra, true, true);
if (mode == PTCACHE_FILE_READ) {
fp = BLI_fopen(filename, "rb");
@@ -2630,7 +2631,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
return;
}
- len = ptcache_filename(pid, filename, cfra, 0, 0); /* no path */
+ len = ptcache_filename(pid, filename, cfra, false, false); /* no path */
/* append underscore terminator to ensure we don't match similar names
* from objects whose names start with the same prefix
*/
@@ -2712,7 +2713,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
case PTCACHE_CLEAR_FRAME:
if (pid->cache->flag & PTCACHE_DISK_CACHE) {
if (BKE_ptcache_id_exist(pid, cfra)) {
- ptcache_filename(pid, filename, cfra, 1, 1); /* no path */
+ ptcache_filename(pid, filename, cfra, true, true); /* no path */
BLI_delete(filename, false, false);
}
}
@@ -2753,7 +2754,7 @@ bool BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
if (pid->cache->flag & PTCACHE_DISK_CACHE) {
char filename[MAX_PTCACHE_FILE];
- ptcache_filename(pid, filename, cfra, 1, 1);
+ ptcache_filename(pid, filename, cfra, true, true);
return BLI_exists(filename);
}
@@ -3500,7 +3501,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const c
/* get "from" filename */
BLI_strncpy(pid->cache->name, name_src, sizeof(pid->cache->name));
- len = ptcache_filename(pid, old_filename, 0, 0, 0); /* no path */
+ len = ptcache_filename(pid, old_filename, 0, false, false); /* no path */
ptcache_path(pid, path);
dir = opendir(path);
@@ -3522,7 +3523,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const c
if (frame != -1) {
BLI_join_dirfile(old_path_full, sizeof(old_path_full), path, de->d_name);
- ptcache_filename(pid, new_path_full, frame, 1, 1);
+ ptcache_filename(pid, new_path_full, frame, true, true);
BLI_rename(old_path_full, new_path_full);
}
}
@@ -3555,7 +3556,7 @@ void BKE_ptcache_load_external(PTCacheID *pid)
ptcache_path(pid, path);
- len = ptcache_filename(pid, filename, 1, 0, 0); /* no path */
+ len = ptcache_filename(pid, filename, 1, false, false); /* no path */
dir = opendir(path);
if (dir == NULL) {