diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_fcurve.h | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 26 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/fmodifier.c | 10 |
5 files changed, 28 insertions, 28 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index d3671516248..a53fc15714e 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -70,7 +70,7 @@ int BKE_read_file(struct bContext *C, const char *filepath, struct ReportList *r #define BKE_READ_FILE_OK 1 /* OK */ #define BKE_READ_FILE_OK_USERPREFS 2 /* OK, and with new user settings */ -int BKE_read_file_from_memory(struct bContext *C, char *filebuf, int filelength, struct ReportList *reports); +int BKE_read_file_from_memory(struct bContext *C, const void *filebuf, int filelength, struct ReportList *reports); int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, struct ReportList *reports); int BKE_read_file_userdef(const char *filepath, struct ReportList *reports); @@ -105,8 +105,8 @@ extern struct Main *BKE_undo_get_main(struct Scene **scene); /* copybuffer */ void BKE_copybuffer_begin(void); void BKE_copybuffer_tag_ID(struct ID *id); -int BKE_copybuffer_save(char *filename, struct ReportList *reports); - int BKE_copybuffer_paste(struct bContext *C, char *libname, struct ReportList *reports); +int BKE_copybuffer_save(const char *filename, struct ReportList *reports); + int BKE_copybuffer_paste(struct bContext *C, const char *libname, struct ReportList *reports); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 6ce7b952b97..d7ef04195d5 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -182,7 +182,7 @@ void evaluate_value_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float *c void fcurve_bake_modifiers(struct FCurve *fcu, int start, int end); -int BKE_fcm_envelope_find_index(struct FCM_EnvelopeData *array, float frame, int arraylen, short *exists); +int BKE_fcm_envelope_find_index(struct FCM_EnvelopeData *array, float frame, int arraylen, bool *r_exists); /* ************** F-Curves API ******************** */ @@ -200,7 +200,7 @@ struct FCurve *list_find_fcurve(ListBase *list, const char rna_path[], const int struct FCurve *iter_step_fcurve(struct FCurve *fcu_iter, const char rna_path[]); /* high level function to get an fcurve from C without having the rna */ -struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, char *driven); +struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, bool *r_driven); /* Get list of LinkData's containing pointers to the F-Curves which control the types of data indicated * e.g. numMatches = list_find_data_fcurves(matches, &act->curves, "pose.bones[", "MyFancyBone"); @@ -208,12 +208,12 @@ 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 bAction **action, int *driven); +struct FCurve *rna_get_fcurve(struct PointerRNA *ptr, struct PropertyRNA *prop, int rnaindex, struct bAction **action, bool *r_driven); /* 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) */ -int binarysearch_bezt_index(struct BezTriple array[], float frame, int arraylen, short *replace); +int binarysearch_bezt_index(struct BezTriple array[], float frame, int arraylen, bool *r_replace); /* get the time extents for F-Curve */ void calc_fcurve_range(struct FCurve *fcu, float *min, float *max, diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 82b3b4f5618..fa6aafabe05 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -461,7 +461,7 @@ int BKE_read_file(bContext *C, const char *filepath, ReportList *reports) return (bfd ? retval : BKE_READ_FILE_FAIL); } -int BKE_read_file_from_memory(bContext *C, char *filebuf, int filelength, ReportList *reports) +int BKE_read_file_from_memory(bContext *C, const void *filebuf, int filelength, ReportList *reports) { BlendFileData *bfd; @@ -906,7 +906,7 @@ static void copybuffer_doit(void *UNUSED(handle), Main *UNUSED(bmain), void *vid } /* frees main in end */ -int BKE_copybuffer_save(char *filename, ReportList *reports) +int BKE_copybuffer_save(const char *filename, ReportList *reports) { Main *mainb = MEM_callocN(sizeof(Main), "copybuffer"); ListBase *lbarray[MAX_LIBARRAY], *fromarray[MAX_LIBARRAY]; @@ -959,7 +959,7 @@ int BKE_copybuffer_save(char *filename, ReportList *reports) } /* return success (1) */ -int BKE_copybuffer_paste(bContext *C, char *libname, ReportList *reports) +int BKE_copybuffer_paste(bContext *C, const char *libname, ReportList *reports) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index bc396d218df..594b887d361 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -169,7 +169,7 @@ void copy_fcurves(ListBase *dst, ListBase *src) /* ----------------- Finding F-Curves -------------------------- */ /* high level function to get an fcurve from C without having the rna */ -FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *prop_name, int index, char *driven) +FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *prop_name, int index, bool *r_driven) { /* anim vars */ AnimData *adt = BKE_animdata_from_id(id); @@ -180,8 +180,8 @@ FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *pro PropertyRNA *prop; char *path; - if (driven) - *driven = FALSE; + if (r_driven) + *r_driven = false; /* only use the current action ??? */ if (ELEM(NULL, adt, adt->action)) @@ -201,8 +201,8 @@ FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *pro /* if not animated, check if driven */ if ((fcu == NULL) && (adt->drivers.first)) { fcu = list_find_fcurve(&adt->drivers, path, index); - if (fcu && driven) - *driven = TRUE; + if (fcu && r_driven) + *r_driven = true; fcu = NULL; } @@ -305,11 +305,11 @@ int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix, return matches; } -FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction **action, int *driven) +FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction **action, bool *r_driven) { FCurve *fcu = NULL; - *driven = 0; + *r_driven = false; /* there must be some RNA-pointer + property combon */ if (prop && ptr->id.data && RNA_property_animateable(ptr, prop)) { @@ -331,7 +331,7 @@ FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction fcu = list_find_fcurve(&adt->drivers, path, rnaindex); if (fcu) - *driven = 1; + *r_driven = true; } if (fcu && action) @@ -354,13 +354,13 @@ FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction /* Binary search algorithm for finding where to insert BezTriple. (for use by insert_bezt_fcurve) * Returns the index to insert at (data already at that index will be offset if replace is 0) */ -int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short *replace) +int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, bool *r_replace) { int start = 0, end = arraylen; int loopbreaker = 0, maxloop = arraylen * 2; /* initialize replace-flag first */ - *replace = 0; + *r_replace = false; /* sneaky optimizations (don't go through searching process if...): * - keyframe to be added is to be added out of current bounds @@ -377,7 +377,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short /* 'First' Keyframe (when only one keyframe, this case is used) */ framenum = array[0].vec[1][0]; if (IS_EQT(frame, framenum, BEZT_BINARYSEARCH_THRESH)) { - *replace = 1; + *r_replace = true; return 0; } else if (frame < framenum) @@ -386,7 +386,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short /* 'Last' Keyframe */ framenum = array[(arraylen - 1)].vec[1][0]; if (IS_EQT(frame, framenum, BEZT_BINARYSEARCH_THRESH)) { - *replace = 1; + *r_replace = true; return (arraylen - 1); } else if (frame > framenum) @@ -404,7 +404,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short /* check if exactly equal to midpoint */ if (IS_EQT(frame, midfra, BEZT_BINARYSEARCH_THRESH)) { - *replace = 1; + *r_replace = true; return mid; } diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index c3fc659137d..19912a19d94 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -487,13 +487,13 @@ static FModifierTypeInfo FMI_ENVELOPE = { */ #define BINARYSEARCH_FRAMEEQ_THRESH 0.0001f -int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int arraylen, short *exists) +int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int arraylen, bool *r_exists) { int start = 0, end = arraylen; int loopbreaker = 0, maxloop = arraylen * 2; /* initialize exists-flag first */ - *exists = 0; + *r_exists = false; /* sneaky optimizations (don't go through searching process if...): * - keyframe to be added is to be added out of current bounds @@ -510,7 +510,7 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int array /* 'First' Point (when only one point, this case is used) */ framenum = array[0].time; if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) { - *exists = 1; + *r_exists = true; return 0; } else if (frame < framenum) { @@ -520,7 +520,7 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int array /* 'Last' Point */ framenum = array[(arraylen - 1)].time; if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) { - *exists = 1; + *r_exists = true; return (arraylen - 1); } else if (frame > framenum) { @@ -539,7 +539,7 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int array /* check if exactly equal to midpoint */ if (IS_EQT(frame, midfra, BINARYSEARCH_FRAMEEQ_THRESH)) { - *exists = 1; + *r_exists = true; return mid; } |