From 7e65b02fb616a4b71a2ec58a4e544a3ce5c0c94c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 24 Mar 2016 18:05:10 +1100 Subject: Cleanup: use prefix for return args --- source/blender/blenkernel/BKE_fcurve.h | 11 ++++++---- source/blender/blenkernel/intern/fcurve.c | 28 ++++++++++++++------------ source/blender/editors/animation/keyframing.c | 5 +++-- source/blender/editors/include/ED_keyframing.h | 2 +- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index ff2880ab311..3db104aea73 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -226,11 +226,14 @@ struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, c int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix, const char *dataName); /* Find an f-curve based on an rna property. */ -struct FCurve *rna_get_fcurve(struct PointerRNA *ptr, struct PropertyRNA *prop, int rnaindex, - struct AnimData **adt, struct bAction **action, bool *r_driven, bool *r_special); +struct FCurve *rna_get_fcurve( + struct PointerRNA *ptr, struct PropertyRNA *prop, int rnaindex, + struct AnimData **r_adt, struct bAction **r_action, + bool *r_driven, bool *r_special); /* Same as above, but takes a context data, temp hack needed for complex paths like texture ones. */ -struct FCurve *rna_get_fcurve_context_ui(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, - int rnaindex, struct AnimData **adt, struct bAction **action, bool *r_driven, bool *r_special); +struct FCurve *rna_get_fcurve_context_ui( + struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int rnaindex, + struct AnimData **r_adt, struct bAction **r_action, bool *r_driven, bool *r_special); /* Binary search algorithm for finding where to 'insert' BezTriple with given frame number. * Returns the index to insert at (data already at that index will be offset if replace is 0) diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 891ab7999fe..52bece60361 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -314,23 +314,25 @@ int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix, return matches; } -FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **adt, - bAction **action, bool *r_driven, bool *r_special) +FCurve *rna_get_fcurve( + PointerRNA *ptr, PropertyRNA *prop, int rnaindex, + AnimData **r_adt, bAction **r_action, bool *r_driven, bool *r_special) { - return rna_get_fcurve_context_ui(NULL, ptr, prop, rnaindex, adt, action, r_driven, r_special); + return rna_get_fcurve_context_ui(NULL, ptr, prop, rnaindex, r_adt, r_action, r_driven, r_special); } -FCurve *rna_get_fcurve_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **animdata, - bAction **action, bool *r_driven, bool *r_special) +FCurve *rna_get_fcurve_context_ui( + bContext *C, PointerRNA *ptr, PropertyRNA *prop, int rnaindex, + AnimData **r_animdata, bAction **r_action, bool *r_driven, bool *r_special) { FCurve *fcu = NULL; PointerRNA tptr = *ptr; - if (animdata) *animdata = NULL; *r_driven = false; *r_special = false; - if (action) *action = NULL; + if (r_animdata) *r_animdata = NULL; + if (r_action) *r_action = NULL; /* Special case for NLA Control Curves... */ if (ptr->type == &RNA_NlaStrip) { @@ -372,8 +374,8 @@ FCurve *rna_get_fcurve_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *pro if (adt->action && adt->action->curves.first) { fcu = list_find_fcurve(&adt->action->curves, path, rnaindex); - if (fcu && action) - *action = adt->action; + if (fcu && r_action) + *r_action = adt->action; } /* if not animated, check if driven */ @@ -381,14 +383,14 @@ FCurve *rna_get_fcurve_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *pro fcu = list_find_fcurve(&adt->drivers, path, rnaindex); if (fcu) { - if (animdata) *animdata = adt; + if (r_animdata) *r_animdata = adt; *r_driven = true; } } - if (fcu && action) { - if (animdata) *animdata = adt; - *action = adt->action; + if (fcu && r_action) { + if (r_animdata) *r_animdata = adt; + *r_action = adt->action; break; } else if (step) { diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index a50924ccefa..6a19cf679be 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -301,7 +301,7 @@ void update_autoflags_fcurve(FCurve *fcu, bContext *C, ReportList *reports, Poin * NOTE: any recalculate of the F-Curve that needs to be done will need to * be done by the caller. */ -int insert_bezt_fcurve(FCurve *fcu, BezTriple *bezt, short flag) +int insert_bezt_fcurve(FCurve *fcu, const BezTriple *bezt, short flag) { int i = 0; @@ -383,7 +383,8 @@ int insert_bezt_fcurve(FCurve *fcu, BezTriple *bezt, short flag) return i; } -/* This function is a wrapper for insert_bezt_fcurve_internal(), and should be used when +/** + * This function is a wrapper for insert_bezt_fcurve_internal(), and should be used when * adding a new keyframe to a curve, when the keyframe doesn't exist anywhere else yet. * It returns the index at which the keyframe was added. * diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 3382f4508cf..02b22bdbf42 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -91,7 +91,7 @@ void update_autoflags_fcurve(struct FCurve *fcu, struct bContext *C, struct Repo * Use this when validation of necessary animation data isn't necessary as it already * exists, and there is a beztriple that can be directly copied into the array. */ -int insert_bezt_fcurve(struct FCurve *fcu, struct BezTriple *bezt, short flag); +int insert_bezt_fcurve(struct FCurve *fcu, const struct BezTriple *bezt, short flag); /* Main Keyframing API call: * Use this when validation of necessary animation data isn't necessary as it -- cgit v1.2.3