diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-07-04 18:30:05 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-07-04 19:22:10 +0300 |
commit | 1ba90582f532081dc4b980e79e732e268e2ca96a (patch) | |
tree | 7761d112257cf33cf3255ba559a41f771120026d /source/blender/blenlib/intern/array_store.c | |
parent | 439fe6568fc5494ef18394612da3eb069bb82483 (diff) |
Fix a few compiler warnings on OS X / clang.
Two were actual bugs, though they existed only in unused code:
* In Freestyle it was unintentionally copying a scene rather than referencing it.
* In BLI_array_store_is_valid there was use of uninitialized memory.
Diffstat (limited to 'source/blender/blenlib/intern/array_store.c')
-rw-r--r-- | source/blender/blenlib/intern/array_store.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/array_store.c b/source/blender/blenlib/intern/array_store.c index 33565596c1f..6000c1a680c 100644 --- a/source/blender/blenlib/intern/array_store.c +++ b/source/blender/blenlib/intern/array_store.c @@ -249,7 +249,7 @@ typedef struct BArrayMemory { /** * Main storage for all states */ -typedef struct BArrayStore { +struct BArrayStore { /* static */ BArrayInfo info; @@ -260,7 +260,7 @@ typedef struct BArrayStore { * #BArrayState may be in any order (logic should never depend on state order). */ ListBase states; -} BArrayStore; +}; /** * A single instance of an array. @@ -272,13 +272,13 @@ typedef struct BArrayStore { * While this could be moved to a memory pool, * it makes it easier to trace invalid usage, so leave as-is for now. */ -typedef struct BArrayState { +struct BArrayState { /** linked list in #BArrayStore.states */ struct BArrayState *next, *prev; struct BChunkList *chunk_list; /* BChunkList's */ -} BArrayState; +}; typedef struct BChunkList { ListBase chunk_refs; /* BChunkRef's */ @@ -1750,10 +1750,11 @@ bool BLI_array_store_is_valid( } \ } ((void)0) - /* count chunk_list's */ - int totrefs = 0; GHash *chunk_list_map = BLI_ghash_ptr_new(__func__); + GHash *chunk_map = BLI_ghash_ptr_new(__func__); + + int totrefs = 0; for (BArrayState *state = bs->states.first; state; state = state->next) { GHASH_PTR_ADD_USER(chunk_list_map, state->chunk_list); } @@ -1771,7 +1772,6 @@ bool BLI_array_store_is_valid( } /* count chunk's */ - GHash *chunk_map = BLI_ghash_ptr_new(__func__); GHASH_ITER (gh_iter, chunk_list_map) { const struct BChunkList *chunk_list = BLI_ghashIterator_getKey(&gh_iter); for (const BChunkRef *cref = chunk_list->chunk_refs.first; cref; cref = cref->next) { |