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:
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c32
-rw-r--r--source/blender/blenkernel/intern/constraint.c108
-rw-r--r--source/blender/blenkernel/intern/fcurve.c2
-rw-r--r--source/blender/blenkernel/intern/lattice.c2
-rw-r--r--source/blender/blenkernel/intern/library_query.c2
-rw-r--r--source/blender/blenkernel/intern/mball.c3
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c6
-rw-r--r--source/blender/blenkernel/intern/nla.c28
-rw-r--r--source/blender/blenkernel/intern/object.c2
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c2
-rw-r--r--source/blender/blenkernel/intern/pbvh_intern.h2
-rw-r--r--source/blender/blenkernel/intern/smoke.c19
-rw-r--r--source/blender/blenkernel/intern/text.c3
13 files changed, 108 insertions, 103 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 8692ff2767d..8542bd65933 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -74,7 +74,7 @@
/* Getter/Setter -------------------------------------------- */
/* Check if ID can have AnimData */
-short id_type_can_have_animdata(ID *id)
+bool id_type_can_have_animdata(ID *id)
{
/* sanity check */
if (id == NULL)
@@ -157,10 +157,10 @@ AnimData *BKE_id_add_animdata(ID *id)
/* Action Setter --------------------------------------- */
/* Called when user tries to change the active action of an AnimData block (via RNA, Outliner, etc.) */
-short BKE_animdata_set_action(ReportList *reports, ID *id, bAction *act)
+bool BKE_animdata_set_action(ReportList *reports, ID *id, bAction *act)
{
AnimData *adt = BKE_animdata_from_id(id);
- short ok = 0;
+ bool ok = false;
/* animdata validity check */
if (adt == NULL) {
@@ -279,7 +279,7 @@ AnimData *BKE_copy_animdata(AnimData *adt, const bool do_action)
return dadt;
}
-int BKE_copy_animdata_id(ID *id_to, ID *id_from, const bool do_action)
+bool BKE_copy_animdata_id(ID *id_to, ID *id_from, const bool do_action)
{
AnimData *adt;
@@ -567,7 +567,7 @@ static bool check_rna_path_is_valid(ID *owner_id, const char *path)
/* Check if some given RNA Path needs fixing - free the given path and set a new one as appropriate
* NOTE: we assume that oldName and newName have [" "] padding around them
*/
-static char *rna_path_rename_fix(ID *owner_id, const char *prefix, const char *oldName, const char *newName, char *oldpath, int verify_paths)
+static char *rna_path_rename_fix(ID *owner_id, const char *prefix, const char *oldName, const char *newName, char *oldpath, bool verify_paths)
{
char *prefixPtr = strstr(oldpath, prefix);
char *oldNamePtr = strstr(oldpath, oldName);
@@ -626,7 +626,7 @@ static char *rna_path_rename_fix(ID *owner_id, const char *prefix, const char *o
/* Check RNA-Paths for a list of F-Curves */
static void fcurves_path_rename_fix(ID *owner_id, const char *prefix, const char *oldName, const char *newName,
- const char *oldKey, const char *newKey, ListBase *curves, int verify_paths)
+ const char *oldKey, const char *newKey, ListBase *curves, bool verify_paths)
{
FCurve *fcu;
@@ -654,7 +654,7 @@ static void fcurves_path_rename_fix(ID *owner_id, const char *prefix, const char
/* Check RNA-Paths for a list of Drivers */
static void drivers_path_rename_fix(ID *owner_id, ID *ref_id, const char *prefix, const char *oldName, const char *newName,
- const char *oldKey, const char *newKey, ListBase *curves, int verify_paths)
+ const char *oldKey, const char *newKey, ListBase *curves, bool verify_paths)
{
FCurve *fcu;
@@ -695,7 +695,7 @@ static void drivers_path_rename_fix(ID *owner_id, ID *ref_id, const char *prefix
/* Fix all RNA-Paths for Actions linked to NLA Strips */
static void nlastrips_path_rename_fix(ID *owner_id, const char *prefix, const char *oldName, const char *newName,
- const char *oldKey, const char *newKey, ListBase *strips, int verify_paths)
+ const char *oldKey, const char *newKey, ListBase *strips, bool verify_paths)
{
NlaStrip *strip;
@@ -720,7 +720,7 @@ static void nlastrips_path_rename_fix(ID *owner_id, const char *prefix, const ch
* i.e. pose.bones["Bone"]
*/
void BKE_action_fix_paths_rename(ID *owner_id, bAction *act, const char *prefix, const char *oldName,
- const char *newName, int oldSubscript, int newSubscript, int verify_paths)
+ const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
{
char *oldN, *newN;
@@ -759,7 +759,7 @@ void BKE_action_fix_paths_rename(ID *owner_id, bAction *act, const char *prefix,
* i.e. pose.bones["Bone"]
*/
void BKE_animdata_fix_paths_rename(ID *owner_id, AnimData *adt, ID *ref_id, const char *prefix, const char *oldName,
- const char *newName, int oldSubscript, int newSubscript, int verify_paths)
+ const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
{
NlaTrack *nlt;
char *oldN, *newN;
@@ -1259,7 +1259,7 @@ void BKE_keyingsets_free(ListBase *list)
* - path: original path string (as stored in F-Curve data)
* - dst: destination string to write data to
*/
-static short animsys_remap_path(AnimMapper *UNUSED(remap), char *path, char **dst)
+static bool animsys_remap_path(AnimMapper *UNUSED(remap), char *path, char **dst)
{
/* is there a valid remapping table to use? */
#if 0
@@ -1279,7 +1279,7 @@ static short animsys_remap_path(AnimMapper *UNUSED(remap), char *path, char **ds
#define ANIMSYS_FLOAT_AS_BOOL(value) ((value) > ((1.0f - FLT_EPSILON)))
/* Write the given value to a setting using RNA, and return success */
-static short animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_index, float value)
+static bool animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_index, float value)
{
PropertyRNA *prop;
PointerRNA new_ptr;
@@ -1409,11 +1409,11 @@ static short animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_in
}
/* Simple replacement based data-setting of the FCurve using RNA */
-static short animsys_execute_fcurve(PointerRNA *ptr, AnimMapper *remap, FCurve *fcu)
+static bool animsys_execute_fcurve(PointerRNA *ptr, AnimMapper *remap, FCurve *fcu)
{
char *path = NULL;
- short free_path = 0;
- short ok = 0;
+ bool free_path = false;
+ bool ok = false;
/* get path, remapped as appropriate to work in its new environment */
free_path = animsys_remap_path(remap, fcu->rna_path, &path);
@@ -1463,7 +1463,7 @@ static void animsys_evaluate_drivers(PointerRNA *ptr, AnimData *adt, float ctime
*/
for (fcu = adt->drivers.first; fcu; fcu = fcu->next) {
ChannelDriver *driver = fcu->driver;
- short ok = 0;
+ bool ok = false;
/* check if this driver's curve should be skipped */
if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0) {
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 2b486f64b61..694474d5656 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -665,11 +665,11 @@ static void default_get_tarmat(bConstraint *con, bConstraintOb *UNUSED(cob), bCo
* (Hopefully all compilers will be happy with the lines with just a space on them. Those are
* really just to help this code easier to read)
*/
-#define SINGLETARGET_FLUSH_TARS(con, datatar, datasubtarget, ct, list, nocopy) \
+#define SINGLETARGET_FLUSH_TARS(con, datatar, datasubtarget, ct, list, no_copy) \
{ \
if (ct) { \
bConstraintTarget *ctn = ct->next; \
- if (nocopy == 0) { \
+ if (no_copy == 0) { \
datatar = ct->tar; \
BLI_strncpy(datasubtarget, ct->subtarget, sizeof(datasubtarget)); \
con->tarspace = (char)ct->space; \
@@ -686,11 +686,11 @@ static void default_get_tarmat(bConstraint *con, bConstraintOb *UNUSED(cob), bCo
* (Hopefully all compilers will be happy with the lines with just a space on them. Those are
* really just to help this code easier to read)
*/
-#define SINGLETARGETNS_FLUSH_TARS(con, datatar, ct, list, nocopy) \
+#define SINGLETARGETNS_FLUSH_TARS(con, datatar, ct, list, no_copy) \
{ \
if (ct) { \
bConstraintTarget *ctn = ct->next; \
- if (nocopy == 0) { \
+ if (no_copy == 0) { \
datatar = ct->tar; \
con->tarspace = (char)ct->space; \
} \
@@ -735,14 +735,14 @@ static int childof_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void childof_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void childof_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bChildOfConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -870,14 +870,14 @@ static int trackto_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void trackto_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void trackto_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bTrackToConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -1052,15 +1052,15 @@ static int kinematic_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void kinematic_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void kinematic_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bKinematicConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
- SINGLETARGET_FLUSH_TARS(con, data->poletar, data->polesubtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
+ SINGLETARGET_FLUSH_TARS(con, data->poletar, data->polesubtarget, ct, list, no_copy);
}
}
@@ -1140,14 +1140,14 @@ static int followpath_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void followpath_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void followpath_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bFollowPathConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, no_copy);
}
}
@@ -1488,14 +1488,14 @@ static int loclike_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void loclike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void loclike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bLocateLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -1578,14 +1578,14 @@ static int rotlike_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void rotlike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void rotlike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bRotateLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -1690,14 +1690,14 @@ static int sizelike_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void sizelike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void sizelike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bSizeLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -1779,14 +1779,14 @@ static int translike_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void translike_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void translike_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bTransLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2038,14 +2038,14 @@ static int actcon_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void actcon_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void actcon_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bActionConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2202,14 +2202,14 @@ static int locktrack_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void locktrack_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void locktrack_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bLockTrackConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2509,14 +2509,14 @@ static int distlimit_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void distlimit_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void distlimit_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bDistLimitConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2636,14 +2636,14 @@ static int stretchto_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void stretchto_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void stretchto_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bStretchToConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2808,14 +2808,14 @@ static int minmax_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void minmax_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void minmax_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bMinMaxConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -2951,14 +2951,14 @@ static int rbj_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void rbj_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void rbj_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bRigidBodyJointConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, no_copy);
}
}
@@ -3002,14 +3002,14 @@ static int clampto_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void clampto_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void clampto_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bClampToConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, no_copy);
}
}
@@ -3182,14 +3182,14 @@ static int transform_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void transform_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void transform_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bTransformConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -3329,13 +3329,13 @@ static int shrinkwrap_get_tars(bConstraint *con, ListBase *list)
}
-static void shrinkwrap_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void shrinkwrap_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bShrinkwrapConstraint *data = con->data;
bConstraintTarget *ct = list->first;
- SINGLETARGETNS_FLUSH_TARS(con, data->target, ct, list, nocopy);
+ SINGLETARGETNS_FLUSH_TARS(con, data->target, ct, list, no_copy);
}
}
@@ -3512,14 +3512,14 @@ static int damptrack_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void damptrack_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void damptrack_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bDampTrackConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -3657,14 +3657,14 @@ static int splineik_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void splineik_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void splineik_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bSplineIKConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, nocopy);
+ SINGLETARGETNS_FLUSH_TARS(con, data->tar, ct, list, no_copy);
}
}
@@ -3725,14 +3725,14 @@ static int pivotcon_get_tars(bConstraint *con, ListBase *list)
return 0;
}
-static void pivotcon_flush_tars(bConstraint *con, ListBase *list, short nocopy)
+static void pivotcon_flush_tars(bConstraint *con, ListBase *list, bool no_copy)
{
if (con && list) {
bPivotConstraint *data = con->data;
bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */
- SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, nocopy);
+ SINGLETARGET_FLUSH_TARS(con, data->tar, data->subtarget, ct, list, no_copy);
}
}
@@ -4277,9 +4277,9 @@ bConstraintTypeInfo *BKE_constraint_get_typeinfo(bConstraint *con)
/* ---------- Data Management ------- */
/* helper function for BKE_free_constraint_data() - unlinks references */
-static void con_unlink_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short isReference, void *UNUSED(userData))
+static void con_unlink_refs_cb(bConstraint *UNUSED(con), ID **idpoin, bool is_reference, void *UNUSED(userData))
{
- if (*idpoin && isReference)
+ if (*idpoin && is_reference)
id_us_min(*idpoin);
}
@@ -4322,7 +4322,7 @@ void BKE_free_constraints(ListBase *list)
/* Remove the specified constraint from the given constraint stack */
-int BKE_remove_constraint(ListBase *list, bConstraint *con)
+bool BKE_remove_constraint(ListBase *list, bConstraint *con)
{
if (con) {
BKE_free_constraint_data(con);
@@ -4334,7 +4334,7 @@ int BKE_remove_constraint(ListBase *list, bConstraint *con)
}
/* Remove all the constraints of the specified type from the given constraint stack */
-void BKE_remove_constraints_type(ListBase *list, short type, short last_only)
+void BKE_remove_constraints_type(ListBase *list, short type, bool last_only)
{
bConstraint *con, *conp;
@@ -4460,7 +4460,7 @@ bConstraint *BKE_add_ob_constraint(Object *ob, const char *name, short type)
/* ......... */
/* helper for BKE_relink_constraints() - call ID_NEW() on every ID reference the constraint has */
-static void con_relink_id_cb(bConstraint *UNUSED(con), ID **idpoin, short UNUSED(isReference), void *UNUSED(userdata))
+static void con_relink_id_cb(bConstraint *UNUSED(con), ID **idpoin, bool UNUSED(is_reference), void *UNUSED(userdata))
{
/* ID_NEW() expects a struct with inline "id" member as first
* since we've got the actual ID block, let's just inline this
@@ -4498,17 +4498,17 @@ void BKE_id_loop_constraints(ListBase *conlist, ConstraintIDFunc func, void *use
/* ......... */
/* helper for BKE_copy_constraints(), to be used for making sure that ID's are valid */
-static void con_extern_cb(bConstraint *UNUSED(con), ID **idpoin, short UNUSED(isReference), void *UNUSED(userData))
+static void con_extern_cb(bConstraint *UNUSED(con), ID **idpoin, bool UNUSED(is_reference), void *UNUSED(userData))
{
if (*idpoin && (*idpoin)->lib)
id_lib_extern(*idpoin);
}
/* helper for BKE_copy_constraints(), to be used for making sure that usercounts of copied ID's are fixed up */
-static void con_fix_copied_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short isReference, void *UNUSED(userData))
+static void con_fix_copied_refs_cb(bConstraint *UNUSED(con), ID **idpoin, bool is_reference, void *UNUSED(userData))
{
/* increment usercount if this is a reference type */
- if ((*idpoin) && (isReference))
+ if ((*idpoin) && (is_reference))
id_us_plus(*idpoin);
}
@@ -4605,7 +4605,7 @@ void BKE_extract_proxylocal_constraints(ListBase *dst, ListBase *src)
}
/* Returns if the owner of the constraint is proxy-protected */
-short BKE_proxylocked_constraints_owner(Object *ob, bPoseChannel *pchan)
+bool BKE_proxylocked_constraints_owner(Object *ob, bPoseChannel *pchan)
{
/* Currently, constraints can only be on object or bone level */
if (ob && ob->proxy) {
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 1810e41a39c..0f3a2a668bf 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -882,7 +882,7 @@ void testhandles_fcurve(FCurve *fcu, const bool use_handle)
*/
void sort_time_fcurve(FCurve *fcu)
{
- short ok = 1;
+ bool ok = true;
/* keep adjusting order of beztriples until nothing moves (bubble-sort) */
while (ok) {
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 55abd4b3f6c..c2760b811d5 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -314,7 +314,7 @@ void BKE_lattice_make_local(Lattice *lt)
{
Main *bmain = G.main;
Object *ob;
- int is_local = false, is_lib = false;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c
index abc3a762372..4787dbb0701 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -104,7 +104,7 @@ static void library_foreach_modifiersForeachIDLink(void *user_data, Object *UNUS
}
static void library_foreach_constraintObjectLooper(bConstraint *UNUSED(con), ID **id_pointer,
- short UNUSED(isReference), void *user_data)
+ bool UNUSED(is_reference), void *user_data)
{
LibraryForeachIDData *data = (LibraryForeachIDData *) user_data;
FOREACH_CALLBACK_INVOKE_ID_PP(data->self_id, id_pointer, data->flag, data->callback, data->user_data, IDWALK_NOP);
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 9efd0dee19a..fc6f9149841 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -356,7 +356,8 @@ void BKE_mball_texspace_calc(Object *ob)
DispList *dl;
BoundBox *bb;
float *data, min[3], max[3] /*, loc[3], size[3] */;
- int tot, do_it = false;
+ int tot;
+ bool do_it = false;
if (ob->bb == NULL) ob->bb = MEM_callocN(sizeof(BoundBox), "mb boundbox");
bb = ob->bb;
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 848483d2877..e80433580b0 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -283,7 +283,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
}
for (i = 0, me = medges; i < totedge; i++, me++) {
- int remove = false;
+ bool remove = false;
if (me->v1 == me->v2) {
PRINT_ERR("\tEdge %u: has matching verts, both %u\n", i, me->v1);
remove = do_fixes;
@@ -336,7 +336,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
PRINT_ERR("No Polys, only tesselated Faces\n");
for (i = 0, mf = mfaces, sf = sort_faces; i < totface; i++, mf++) {
- int remove = false;
+ bool remove = false;
int fidx;
unsigned int fv[4];
@@ -411,7 +411,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
sf++;
for (i = 1; i < totsortface; i++, sf++) {
- int remove = false;
+ bool remove = false;
/* on a valid mesh, code below will never run */
if (memcmp(sf->es, sf_prev->es, sizeof(sf_prev->es)) == 0) {
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 06a12bdade1..d251a8599b1 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -626,10 +626,10 @@ void BKE_nlastrips_sort_strips(ListBase *strips)
/* Add the given NLA-Strip to the given list of strips, assuming that it
* isn't currently a member of another list
*/
-short BKE_nlastrips_add_strip(ListBase *strips, NlaStrip *strip)
+bool BKE_nlastrips_add_strip(ListBase *strips, NlaStrip *strip)
{
NlaStrip *ns;
- short not_added = 1;
+ bool not_added = true;
/* sanity checks */
if (ELEM(NULL, strips, strip))
@@ -664,7 +664,7 @@ short BKE_nlastrips_add_strip(ListBase *strips, NlaStrip *strip)
* contained within 'Meta-Strips' which act as strips which contain strips.
* temp: are the meta-strips to be created 'temporary' ones used for transforms?
*/
-void BKE_nlastrips_make_metas(ListBase *strips, short temp)
+void BKE_nlastrips_make_metas(ListBase *strips, bool is_temp)
{
NlaStrip *mstrip = NULL;
NlaStrip *strip, *stripn;
@@ -689,7 +689,7 @@ void BKE_nlastrips_make_metas(ListBase *strips, short temp)
mstrip->flag = NLASTRIP_FLAG_SELECT;
/* set temp flag if appropriate (i.e. for transform-type editing) */
- if (temp)
+ if (is_temp)
mstrip->flag |= NLASTRIP_FLAG_TEMP_META;
/* set default repeat/scale values to prevent warnings */
@@ -741,7 +741,7 @@ void BKE_nlastrips_clear_metastrip(ListBase *strips, NlaStrip *strip)
* sel: only consider selected meta-strips, otherwise all meta-strips are removed
* onlyTemp: only remove the 'temporary' meta-strips used for transforms
*/
-void BKE_nlastrips_clear_metas(ListBase *strips, short onlySel, short onlyTemp)
+void BKE_nlastrips_clear_metas(ListBase *strips, bool only_sel, bool only_temp)
{
NlaStrip *strip, *stripn;
@@ -756,8 +756,8 @@ void BKE_nlastrips_clear_metas(ListBase *strips, short onlySel, short onlyTemp)
/* check if strip is a meta-strip */
if (strip->type == NLASTRIP_TYPE_META) {
/* if check if selection and 'temporary-only' considerations are met */
- if ((onlySel == 0) || (strip->flag & NLASTRIP_FLAG_SELECT)) {
- if ((!onlyTemp) || (strip->flag & NLASTRIP_FLAG_TEMP_META)) {
+ if ((!only_sel) || (strip->flag & NLASTRIP_FLAG_SELECT)) {
+ if ((!only_temp) || (strip->flag & NLASTRIP_FLAG_TEMP_META)) {
BKE_nlastrips_clear_metastrip(strips, strip);
}
}
@@ -768,7 +768,7 @@ void BKE_nlastrips_clear_metas(ListBase *strips, short onlySel, short onlyTemp)
/* Add the given NLA-Strip to the given Meta-Strip, assuming that the
* strip isn't attached to any list of strips
*/
-short BKE_nlameta_add_strip(NlaStrip *mstrip, NlaStrip *strip)
+bool BKE_nlameta_add_strip(NlaStrip *mstrip, NlaStrip *strip)
{
/* sanity checks */
if (ELEM(NULL, mstrip, strip))
@@ -1002,7 +1002,7 @@ void BKE_nlatrack_sort_strips(NlaTrack *nlt)
/* Add the given NLA-Strip to the given NLA-Track, assuming that it
* isn't currently attached to another one
*/
-short BKE_nlatrack_add_strip(NlaTrack *nlt, NlaStrip *strip)
+bool BKE_nlatrack_add_strip(NlaTrack *nlt, NlaStrip *strip)
{
/* sanity checks */
if (ELEM(NULL, nlt, strip))
@@ -1015,7 +1015,7 @@ short BKE_nlatrack_add_strip(NlaTrack *nlt, NlaStrip *strip)
/* Get the extents of the given NLA-Track including gaps between strips,
* returning whether this succeeded or not
*/
-short BKE_nlatrack_get_bounds(NlaTrack *nlt, float bounds[2])
+bool BKE_nlatrack_get_bounds(NlaTrack *nlt, float bounds[2])
{
NlaStrip *strip;
@@ -1085,7 +1085,7 @@ void BKE_nlastrip_set_active(AnimData *adt, NlaStrip *strip)
/* Does the given NLA-strip fall within the given bounds (times)? */
-short BKE_nlastrip_within_bounds(NlaStrip *strip, float min, float max)
+bool BKE_nlastrip_within_bounds(NlaStrip *strip, float min, float max)
{
const float stripLen = (strip) ? strip->end - strip->start : 0.0f;
const float boundsLen = fabsf(max - min);
@@ -1220,7 +1220,7 @@ static bool nlastrip_is_first(AnimData *adt, NlaStrip *strip)
/* Animated Strips ------------------------------------------- */
/* Check if the given NLA-Track has any strips with own F-Curves */
-short BKE_nlatrack_has_animated_strips(NlaTrack *nlt)
+bool BKE_nlatrack_has_animated_strips(NlaTrack *nlt)
{
NlaStrip *strip;
@@ -1239,7 +1239,7 @@ short BKE_nlatrack_has_animated_strips(NlaTrack *nlt)
}
/* Check if given NLA-Tracks have any strips with own F-Curves */
-short BKE_nlatracks_have_animated_strips(ListBase *tracks)
+bool BKE_nlatracks_have_animated_strips(ListBase *tracks)
{
NlaTrack *nlt;
@@ -1567,7 +1567,7 @@ void BKE_nla_action_pushdown(AnimData *adt)
/* Find the active strip + track combo, and set them up as the tweaking track,
* and return if successful or not.
*/
-short BKE_nla_tweakmode_enter(AnimData *adt)
+bool BKE_nla_tweakmode_enter(AnimData *adt)
{
NlaTrack *nlt, *activeTrack = NULL;
NlaStrip *strip, *activeStrip = NULL;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 71b3e83f9de..cae46199285 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2217,7 +2217,7 @@ static void ob_get_parent_matrix(Scene *scene, Object *ob, Object *par, float pa
{
float tmat[4][4];
float vec[3];
- int ok;
+ bool ok;
switch (ob->partype & PARTYPE) {
case PAROBJECT:
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 24969c1a07a..9547ac9fc81 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -1024,7 +1024,7 @@ static bool pbvh_bmesh_collapse_short_edges(EdgeQueueContext *eq_ctx,
bool pbvh_bmesh_node_raycast(PBVHNode *node, const float ray_start[3],
const float ray_normal[3], float *dist,
- int use_original)
+ bool use_original)
{
bool hit = false;
diff --git a/source/blender/blenkernel/intern/pbvh_intern.h b/source/blender/blenkernel/intern/pbvh_intern.h
index 361f7c6cfde..46f7a9b7b56 100644
--- a/source/blender/blenkernel/intern/pbvh_intern.h
+++ b/source/blender/blenkernel/intern/pbvh_intern.h
@@ -184,7 +184,7 @@ void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes, int totnode, int flag);
bool pbvh_bmesh_node_raycast(
PBVHNode *node, const float ray_start[3],
const float ray_normal[3], float *dist,
- int use_original);
+ bool use_original);
void pbvh_bmesh_normals_update(PBVHNode **nodes, int totnode);
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index f993d74959d..8a912a277ae 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -933,7 +933,7 @@ static void update_obstacles(Scene *scene, Object *ob, SmokeDomainSettings *sds,
**********************************************************/
/* set "ignore cache" flag for all caches on this object */
-static void object_cacheIgnoreClear(Object *ob, int state)
+static void object_cacheIgnoreClear(Object *ob, bool state)
{
ListBase pidlist;
PTCacheID *pid;
@@ -951,7 +951,7 @@ static void object_cacheIgnoreClear(Object *ob, int state)
BLI_freelistN(&pidlist);
}
-static int subframe_updateObject(Scene *scene, Object *ob, int update_mesh, int parent_recursion, float frame, bool for_render)
+static bool subframe_updateObject(Scene *scene, Object *ob, int update_mesh, int parent_recursion, float frame, bool for_render)
{
SmokeModifierData *smd = (SmokeModifierData *)modifiers_findByType(ob, eModifierType_Smoke);
bConstraint *con;
@@ -963,9 +963,9 @@ static int subframe_updateObject(Scene *scene, Object *ob, int update_mesh, int
/* if object has parents, update them too */
if (parent_recursion) {
int recursion = parent_recursion - 1;
- int is_domain = 0;
- if (ob->parent) is_domain += subframe_updateObject(scene, ob->parent, 0, recursion, frame, for_render);
- if (ob->track) is_domain += subframe_updateObject(scene, ob->track, 0, recursion, frame, for_render);
+ bool is_domain = false;
+ if (ob->parent) is_domain |= subframe_updateObject(scene, ob->parent, 0, recursion, frame, for_render);
+ if (ob->track) is_domain |= subframe_updateObject(scene, ob->track, 0, recursion, frame, for_render);
/* skip subframe if object is parented
* to vertex of a dynamic paint canvas */
@@ -1073,7 +1073,7 @@ static void clampBoundsInDomain(SmokeDomainSettings *sds, int min[3], int max[3]
}
}
-static void em_allocateData(EmissionMap *em, int use_velocity, int hires_mul)
+static void em_allocateData(EmissionMap *em, bool use_velocity, int hires_mul)
{
int i, res[3];
@@ -1427,8 +1427,11 @@ static void emit_from_particles(Object *flow_ob, SmokeDomainSettings *sds, Smoke
}
}
-static void sample_derivedmesh(SmokeFlowSettings *sfs, MVert *mvert, MTFace *tface, MFace *mface, float *influence_map, float *velocity_map, int index, int base_res[3], float flow_center[3], BVHTreeFromMesh *treeData, float ray_start[3],
- float *vert_vel, int has_velocity, int defgrp_index, MDeformVert *dvert, float x, float y, float z)
+static void sample_derivedmesh(
+ SmokeFlowSettings *sfs, MVert *mvert, MTFace *tface, MFace *mface,
+ float *influence_map, float *velocity_map, int index, int base_res[3], float flow_center[3],
+ BVHTreeFromMesh *treeData, const float ray_start[3], const float *vert_vel,
+ bool has_velocity, int defgrp_index, MDeformVert *dvert, float x, float y, float z)
{
float ray_dir[3] = {1.0f, 0.0f, 0.0f};
BVHTreeRayHit hit = {0};
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 22267c93680..f42663401ee 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -2963,7 +2963,8 @@ int txt_setcurr_tab_spaces(Text *text, int space)
* 2) within an identifier
* 3) after the cursor (text->curc), i.e. when creating space before a function def [#25414]
*/
- int a, is_indent = 0;
+ int a;
+ bool is_indent = false;
for (a = 0; (a < text->curc) && (text->curl->line[a] != '\0'); a++) {
char ch = text->curl->line[a];
if (ch == '#') {