[Bf-blender-cvs] [391af6bea25] master: Cleanup: Replace int with bool for pointcache function
Julian Eisel
noreply at git.blender.org
Tue Aug 3 15:52:54 CEST 2021
Commit: 391af6bea256e11cbc599ac8b15278e2f956ea01
Author: Julian Eisel
Date: Tue Aug 3 15:48:54 2021 +0200
Branches: master
https://developer.blender.org/rB391af6bea256e11cbc599ac8b15278e2f956ea01
Cleanup: Replace int with bool for pointcache function
Was using an int for boolean return value.
===================================================================
M source/blender/blenkernel/BKE_pointcache.h
M source/blender/blenkernel/intern/pointcache.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 3f99a0dc793..c83fca767a1 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -302,7 +302,7 @@ void BKE_ptcache_remove(void);
/************ ID specific functions ************************/
void BKE_ptcache_id_clear(PTCacheID *id, int mode, unsigned int cfra);
-int BKE_ptcache_id_exist(PTCacheID *id, int cfra);
+bool BKE_ptcache_id_exist(PTCacheID *id, int cfra);
int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode);
void BKE_ptcache_id_time(PTCacheID *pid,
struct Scene *scene,
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 9ed5b0230e6..a6adff35a7f 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -2753,18 +2753,18 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
pid->cache->flag |= PTCACHE_FLAG_INFO_DIRTY;
}
-int BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
+bool BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
{
if (!pid->cache) {
- return 0;
+ return false;
}
if (cfra < pid->cache->startframe || cfra > pid->cache->endframe) {
- return 0;
+ return false;
}
if (pid->cache->cached_frames && pid->cache->cached_frames[cfra - pid->cache->startframe] == 0) {
- return 0;
+ return false;
}
if (pid->cache->flag & PTCACHE_DISK_CACHE) {
@@ -2779,10 +2779,10 @@ int BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
for (; pm; pm = pm->next) {
if (pm->frame == cfra) {
- return 1;
+ return true;
}
}
- return 0;
+ return false;
}
void BKE_ptcache_id_time(
PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
More information about the Bf-blender-cvs
mailing list