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:
authorJoshua Leung <aligorith@gmail.com>2014-05-22 07:46:51 +0400
committerJoshua Leung <aligorith@gmail.com>2014-05-22 07:46:51 +0400
commit6ce67a8eab884c69837381fb55f6ec86d5614cef (patch)
treeeffd23f228839759f77c4e099df98e25841f69a6 /source/blender/editors
parent5f70f8b2b4aebb9341edbd774c1b8c23114d8be0 (diff)
For increased type safety, ANIM_animdata_filter() now specifies the enums its arguments can use
Hopefully this should help prevent bugs lik T40304 from occurring again.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_filter.c9
-rw-r--r--source/blender/editors/include/ED_anim_api.h10
2 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 6c28d05110f..b80e29ba424 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -2619,7 +2619,7 @@ static size_t animdata_filter_remove_duplis(ListBase *anim_data)
* will be placed for use.
* filter_mode: how should the data be filtered - bitmapping accessed flags
*/
-size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mode, void *data, short datatype)
+size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_Flags filter_mode, void *data, eAnimCont_Types datatype)
{
size_t items = 0;
@@ -2712,6 +2712,13 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo
items = animdata_filter_animchan(ac, anim_data, ads, data, filter_mode);
break;
}
+
+ /* unhandled */
+ default:
+ {
+ printf("ANIM_animdata_filter() - Invalid datatype argument %d\n", datatype);
+ break;
+ }
}
/* remove any 'weedy' entries */
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 37c9e0ba4d9..02cc86eb55c 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -111,12 +111,12 @@ typedef struct bAnimListElem {
struct bAnimListElem *next, *prev;
void *data; /* source data this elem represents */
- int type; /* one of the ANIMTYPE_* values */
+ int type; /* (eAnim_ChannelType) one of the ANIMTYPE_* values */
int flag; /* copy of elem's flags for quick access */
- int index; /* for un-named data, the index of the data in it's collection */
+ int index; /* for un-named data, the index of the data in its collection */
- short update; /* tag the element for updating (eAnim_Update_Flags) */
- short datatype; /* type of motion data to expect */
+ short update; /* (eAnim_Update_Flags) tag the element for updating */
+ short datatype; /* (eAnim_KeyType) type of motion data to expect */
void *key_data; /* motion data - mostly F-Curves, but can be other types too */
@@ -358,7 +358,7 @@ typedef enum eAnimFilter_Flags {
/* Obtain list of filtered Animation channels to operate on.
* Returns the number of channels in the list
*/
-size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mode, void *data, short datatype);
+size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_Flags filter_mode, void *data, eAnimCont_Types datatype);
/* Obtain current anim-data context from Blender Context info.
* Returns whether the operation was successful.