diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 13:52:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 13:52:18 +0300 |
commit | 0955c664aa7c5fc5f0bd345c58219c40f04ab9c1 (patch) | |
tree | 20b6a2ab2e1130d75d119eba09f3b195a33a9434 /source/blender/blenkernel/intern/seqcache.c | |
parent | f3bd89b1b7a86778ff4c633a6b4115309a1b3c7e (diff) |
fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
Diffstat (limited to 'source/blender/blenkernel/intern/seqcache.c')
-rw-r--r-- | source/blender/blenkernel/intern/seqcache.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/seqcache.c b/source/blender/blenkernel/intern/seqcache.c index 78cd4bb51fe..1c40ef020be 100644 --- a/source/blender/blenkernel/intern/seqcache.c +++ b/source/blender/blenkernel/intern/seqcache.c @@ -54,10 +54,10 @@ typedef struct seqCacheEntry MEM_CacheLimiterHandleC * c_handle; } seqCacheEntry; -static GHash * hash = 0; -static MEM_CacheLimiterC * limitor = 0; -static struct BLI_mempool * entrypool = 0; -static struct BLI_mempool * keypool = 0; +static GHash * hash = NULL; +static MEM_CacheLimiterC * limitor = NULL; +static struct BLI_mempool * entrypool = NULL; +static struct BLI_mempool * keypool = NULL; static int ibufs_in = 0; static int ibufs_rem = 0; @@ -119,8 +119,8 @@ static void HashValFree(void *val) ibufs_rem++; } - e->ibuf = 0; - e->c_handle = 0; + e->ibuf = NULL; + e->c_handle = NULL; BLI_mempool_free(entrypool, e); } @@ -135,12 +135,12 @@ static void IMB_seq_cache_destructor(void * p) IMB_freeImBuf(e->ibuf); ibufs_rem++; - e->ibuf = 0; - e->c_handle = 0; + e->ibuf = NULL; + e->c_handle = NULL; } } -void seq_stripelem_cache_init() +void seq_stripelem_cache_init(void) { hash = BLI_ghash_new(HashHash, HashCmp, "seq stripelem cache hash"); limitor = new_MEM_CacheLimiter( IMB_seq_cache_destructor ); @@ -149,7 +149,7 @@ void seq_stripelem_cache_init() keypool = BLI_mempool_create(sizeof(seqCacheKey), 64, 64, 0); } -void seq_stripelem_cache_destruct() +void seq_stripelem_cache_destruct(void) { if (!entrypool) { return; @@ -160,7 +160,7 @@ void seq_stripelem_cache_destruct() BLI_mempool_destroy(keypool); } -void seq_stripelem_cache_cleanup() +void seq_stripelem_cache_cleanup(void) { if (!entrypool) { seq_stripelem_cache_init(); @@ -185,7 +185,7 @@ struct ImBuf * seq_stripelem_cache_get( seqCacheEntry * e; if (!seq) { - return 0; + return NULL; } if (!entrypool) { @@ -205,7 +205,7 @@ struct ImBuf * seq_stripelem_cache_get( MEM_CacheLimiter_touch(e->c_handle); return e->ibuf; } - return 0; + return NULL; } void seq_stripelem_cache_put( @@ -239,7 +239,7 @@ void seq_stripelem_cache_put( e = (seqCacheEntry*) BLI_mempool_alloc(entrypool); e->ibuf = i; - e->c_handle = 0; + e->c_handle = NULL; BLI_ghash_remove(hash, key, HashKeyFree, HashValFree); BLI_ghash_insert(hash, key, e); |