Code cleanup: use bool

This commit is contained in:
Campbell Barton 2014-04-11 11:25:41 +10:00
parent 52af5fa31f
commit a15b3c4d11
83 changed files with 266 additions and 250 deletions

@ -150,7 +150,7 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
#define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode) \ #define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode) \
const short _has_kerning = FT_HAS_KERNING((_font)->face); \ const bool _has_kerning = FT_HAS_KERNING((_font)->face); \
const FT_UInt _kern_mode = (_has_kerning == 0) ? 0 : \ const FT_UInt _kern_mode = (_has_kerning == 0) ? 0 : \
(((_font)->flags & BLF_KERNING_DEFAULT) ? \ (((_font)->flags & BLF_KERNING_DEFAULT) ? \
ft_kerning_default : FT_KERNING_UNFITTED) \ ft_kerning_default : FT_KERNING_UNFITTED) \

@ -48,7 +48,7 @@ struct AnimMapper;
/* AnimData API */ /* AnimData API */
/* Check if the given ID-block can have AnimData */ /* Check if the given ID-block can have AnimData */
short id_type_can_have_animdata(struct ID *id); bool id_type_can_have_animdata(struct ID *id);
/* Get AnimData from the given ID-block */ /* Get AnimData from the given ID-block */
struct AnimData *BKE_animdata_from_id(struct ID *id); struct AnimData *BKE_animdata_from_id(struct ID *id);
@ -57,7 +57,7 @@ struct AnimData *BKE_animdata_from_id(struct ID *id);
struct AnimData *BKE_id_add_animdata(struct ID *id); struct AnimData *BKE_id_add_animdata(struct ID *id);
/* Set active action used by AnimData from the given ID-block */ /* Set active action used by AnimData from the given ID-block */
short BKE_animdata_set_action(struct ReportList *reports, struct ID *id, struct bAction *act); bool BKE_animdata_set_action(struct ReportList *reports, struct ID *id, struct bAction *act);
/* Free AnimData */ /* Free AnimData */
void BKE_free_animdata(struct ID *id); void BKE_free_animdata(struct ID *id);
@ -66,7 +66,7 @@ void BKE_free_animdata(struct ID *id);
struct AnimData *BKE_copy_animdata(struct AnimData *adt, const bool do_action); struct AnimData *BKE_copy_animdata(struct AnimData *adt, const bool do_action);
/* Copy AnimData */ /* Copy AnimData */
int BKE_copy_animdata_id(struct ID *id_to, struct ID *id_from, const bool do_action); bool BKE_copy_animdata_id(struct ID *id_to, struct ID *id_from, const bool do_action);
/* Copy AnimData Actions */ /* Copy AnimData Actions */
void BKE_copy_animdata_id_action(struct ID *id); void BKE_copy_animdata_id_action(struct ID *id);
@ -106,12 +106,12 @@ void BKE_keyingsets_free(struct ListBase *list);
/* Fix all the paths for the the given ID + Action */ /* Fix all the paths for the the given ID + Action */
void BKE_action_fix_paths_rename(struct ID *owner_id, struct bAction *act, const char *prefix, const char *oldName, void BKE_action_fix_paths_rename(struct ID *owner_id, struct 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);
/* Fix all the paths for the given ID+AnimData */ /* Fix all the paths for the given ID+AnimData */
void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, struct ID *ref_id, const char *prefix, void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, struct ID *ref_id, const char *prefix,
const char *oldName, const char *newName, int oldSubscript, int newSubscript, const char *oldName, const char *newName, int oldSubscript, int newSubscript,
int verify_paths); bool verify_paths);
/* Fix all the paths for the entire database... */ /* Fix all the paths for the entire database... */
void BKE_all_animdata_fix_paths_rename(ID *ref_id, const char *prefix, const char *oldName, const char *newName); void BKE_all_animdata_fix_paths_rename(ID *ref_id, const char *prefix, const char *oldName, const char *newName);

@ -62,7 +62,7 @@ typedef struct bConstraintOb {
/* ---------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------- */
/* Callback format for performing operations on ID-pointers for Constraints */ /* Callback format for performing operations on ID-pointers for Constraints */
typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, short isReference, void *userdata); typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, bool is_reference, void *userdata);
/* ....... */ /* ....... */
@ -98,7 +98,7 @@ typedef struct bConstraintTypeInfo {
/* for multi-target constraints: return that list; otherwise make a temporary list (returns number of targets) */ /* for multi-target constraints: return that list; otherwise make a temporary list (returns number of targets) */
int (*get_constraint_targets)(struct bConstraint *con, struct ListBase *list); int (*get_constraint_targets)(struct bConstraint *con, struct ListBase *list);
/* for single-target constraints only: flush data back to source data, and the free memory used */ /* for single-target constraints only: flush data back to source data, and the free memory used */
void (*flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, short nocopy); void (*flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, bool no_copy);
/* evaluation */ /* evaluation */
/* set the ct->matrix for the given constraint target (at the given ctime) */ /* set the ct->matrix for the given constraint target (at the given ctime) */
@ -136,12 +136,12 @@ struct bConstraint *BKE_constraints_findByName(struct ListBase *list, const char
struct bConstraint *BKE_add_ob_constraint(struct Object *ob, const char *name, short type); struct bConstraint *BKE_add_ob_constraint(struct Object *ob, const char *name, short type);
struct bConstraint *BKE_add_pose_constraint(struct Object *ob, struct bPoseChannel *pchan, const char *name, short type); struct bConstraint *BKE_add_pose_constraint(struct Object *ob, struct bPoseChannel *pchan, const char *name, short type);
int BKE_remove_constraint(ListBase *list, struct bConstraint *con); bool BKE_remove_constraint(ListBase *list, struct bConstraint *con);
void BKE_remove_constraints_type(ListBase *list, short type, short last_only); void BKE_remove_constraints_type(ListBase *list, short type, bool last_only);
/* Constraints + Proxies function prototypes */ /* Constraints + Proxies function prototypes */
void BKE_extract_proxylocal_constraints(struct ListBase *dst, struct ListBase *src); void BKE_extract_proxylocal_constraints(struct ListBase *dst, struct ListBase *src);
short BKE_proxylocked_constraints_owner(struct Object *ob, struct bPoseChannel *pchan); bool BKE_proxylocked_constraints_owner(struct Object *ob, struct bPoseChannel *pchan);
/* Constraint Evaluation function prototypes */ /* Constraint Evaluation function prototypes */
struct bConstraintOb *BKE_constraints_make_evalob(struct Scene *scene, struct Object *ob, void *subdata, short datatype); struct bConstraintOb *BKE_constraints_make_evalob(struct Scene *scene, struct Object *ob, void *subdata, short datatype);

@ -62,13 +62,13 @@ struct NlaStrip *add_nla_soundstrip(struct Scene *scene, struct Speaker *spk);
bool BKE_nlastrips_has_space(ListBase *strips, float start, float end); bool BKE_nlastrips_has_space(ListBase *strips, float start, float end);
void BKE_nlastrips_sort_strips(ListBase *strips); void BKE_nlastrips_sort_strips(ListBase *strips);
short BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip); bool BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip);
void BKE_nlastrips_make_metas(ListBase *strips, short temp); void BKE_nlastrips_make_metas(ListBase *strips, bool is_temp);
void BKE_nlastrips_clear_metas(ListBase *strips, short onlySel, short onlyTemp); void BKE_nlastrips_clear_metas(ListBase *strips, bool only_sel, bool only_temp);
void BKE_nlastrips_clear_metastrip(ListBase *strips, struct NlaStrip *strip); void BKE_nlastrips_clear_metastrip(ListBase *strips, struct NlaStrip *strip);
short BKE_nlameta_add_strip(struct NlaStrip *mstrip, struct NlaStrip *strip); bool BKE_nlameta_add_strip(struct NlaStrip *mstrip, struct NlaStrip *strip);
void BKE_nlameta_flush_transforms(struct NlaStrip *mstrip); void BKE_nlameta_flush_transforms(struct NlaStrip *mstrip);
/* ............ */ /* ............ */
@ -81,24 +81,24 @@ void BKE_nlatrack_solo_toggle(struct AnimData *adt, struct NlaTrack *nlt);
bool BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end); bool BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end);
void BKE_nlatrack_sort_strips(struct NlaTrack *nlt); void BKE_nlatrack_sort_strips(struct NlaTrack *nlt);
short BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip); bool BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip);
short BKE_nlatrack_get_bounds(struct NlaTrack *nlt, float bounds[2]); bool BKE_nlatrack_get_bounds(struct NlaTrack *nlt, float bounds[2]);
/* ............ */ /* ............ */
struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt); struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt);
void BKE_nlastrip_set_active(struct AnimData *adt, struct NlaStrip *strip); void BKE_nlastrip_set_active(struct AnimData *adt, struct NlaStrip *strip);
short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max); bool BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max);
void BKE_nlastrip_recalculate_bounds(struct NlaStrip *strip); void BKE_nlastrip_recalculate_bounds(struct NlaStrip *strip);
void BKE_nlastrip_validate_name(struct AnimData *adt, struct NlaStrip *strip); void BKE_nlastrip_validate_name(struct AnimData *adt, struct NlaStrip *strip);
/* ............ */ /* ............ */
short BKE_nlatrack_has_animated_strips(struct NlaTrack *nlt); bool BKE_nlatrack_has_animated_strips(struct NlaTrack *nlt);
short BKE_nlatracks_have_animated_strips(ListBase *tracks); bool BKE_nlatracks_have_animated_strips(ListBase *tracks);
void BKE_nlastrip_validate_fcurves(struct NlaStrip *strip); void BKE_nlastrip_validate_fcurves(struct NlaStrip *strip);
void BKE_nla_validate_state(struct AnimData *adt); void BKE_nla_validate_state(struct AnimData *adt);
@ -107,7 +107,7 @@ void BKE_nla_validate_state(struct AnimData *adt);
void BKE_nla_action_pushdown(struct AnimData *adt); void BKE_nla_action_pushdown(struct AnimData *adt);
short BKE_nla_tweakmode_enter(struct AnimData *adt); bool BKE_nla_tweakmode_enter(struct AnimData *adt);
void BKE_nla_tweakmode_exit(struct AnimData *adt); void BKE_nla_tweakmode_exit(struct AnimData *adt);
/* ----------------------------- */ /* ----------------------------- */

@ -74,7 +74,7 @@
/* Getter/Setter -------------------------------------------- */ /* Getter/Setter -------------------------------------------- */
/* Check if ID can have AnimData */ /* Check if ID can have AnimData */
short id_type_can_have_animdata(ID *id) bool id_type_can_have_animdata(ID *id)
{ {
/* sanity check */ /* sanity check */
if (id == NULL) if (id == NULL)
@ -157,10 +157,10 @@ AnimData *BKE_id_add_animdata(ID *id)
/* Action Setter --------------------------------------- */ /* Action Setter --------------------------------------- */
/* Called when user tries to change the active action of an AnimData block (via RNA, Outliner, etc.) */ /* 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); AnimData *adt = BKE_animdata_from_id(id);
short ok = 0; bool ok = false;
/* animdata validity check */ /* animdata validity check */
if (adt == NULL) { if (adt == NULL) {
@ -279,7 +279,7 @@ AnimData *BKE_copy_animdata(AnimData *adt, const bool do_action)
return dadt; 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; 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 /* 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 * 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 *prefixPtr = strstr(oldpath, prefix);
char *oldNamePtr = strstr(oldpath, oldName); 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 */ /* 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, 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; 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 */ /* 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, 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; 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 */ /* 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, 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; 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"] * i.e. pose.bones["Bone"]
*/ */
void BKE_action_fix_paths_rename(ID *owner_id, bAction *act, const char *prefix, const char *oldName, 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; 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"] * 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, 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; NlaTrack *nlt;
char *oldN, *newN; char *oldN, *newN;
@ -1259,7 +1259,7 @@ void BKE_keyingsets_free(ListBase *list)
* - path: original path string (as stored in F-Curve data) * - path: original path string (as stored in F-Curve data)
* - dst: destination string to write data to * - 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? */ /* is there a valid remapping table to use? */
#if 0 #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))) #define ANIMSYS_FLOAT_AS_BOOL(value) ((value) > ((1.0f - FLT_EPSILON)))
/* Write the given value to a setting using RNA, and return success */ /* 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; PropertyRNA *prop;
PointerRNA new_ptr; 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 */ /* 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; char *path = NULL;
short free_path = 0; bool free_path = false;
short ok = 0; bool ok = false;
/* get path, remapped as appropriate to work in its new environment */ /* get path, remapped as appropriate to work in its new environment */
free_path = animsys_remap_path(remap, fcu->rna_path, &path); 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) { for (fcu = adt->drivers.first; fcu; fcu = fcu->next) {
ChannelDriver *driver = fcu->driver; ChannelDriver *driver = fcu->driver;
short ok = 0; bool ok = false;
/* check if this driver's curve should be skipped */ /* check if this driver's curve should be skipped */
if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0) { if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0) {

@ -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 * (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) * 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) { \ if (ct) { \
bConstraintTarget *ctn = ct->next; \ bConstraintTarget *ctn = ct->next; \
if (nocopy == 0) { \ if (no_copy == 0) { \
datatar = ct->tar; \ datatar = ct->tar; \
BLI_strncpy(datasubtarget, ct->subtarget, sizeof(datasubtarget)); \ BLI_strncpy(datasubtarget, ct->subtarget, sizeof(datasubtarget)); \
con->tarspace = (char)ct->space; \ 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 * (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) * 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) { \ if (ct) { \
bConstraintTarget *ctn = ct->next; \ bConstraintTarget *ctn = ct->next; \
if (nocopy == 0) { \ if (no_copy == 0) { \
datatar = ct->tar; \ datatar = ct->tar; \
con->tarspace = (char)ct->space; \ con->tarspace = (char)ct->space; \
} \ } \
@ -735,14 +735,14 @@ static int childof_get_tars(bConstraint *con, ListBase *list)
return 0; 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) { if (con && list) {
bChildOfConstraint *data = con->data; bChildOfConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bTrackToConstraint *data = con->data; bTrackToConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bKinematicConstraint *data = con->data; bKinematicConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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);
SINGLETARGET_FLUSH_TARS(con, data->poletar, data->polesubtarget, ct, list, nocopy); 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; 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) { if (con && list) {
bFollowPathConstraint *data = con->data; bFollowPathConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bLocateLikeConstraint *data = con->data; bLocateLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bRotateLikeConstraint *data = con->data; bRotateLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bSizeLikeConstraint *data = con->data; bSizeLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bTransLikeConstraint *data = con->data; bTransLikeConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bActionConstraint *data = con->data; bActionConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bLockTrackConstraint *data = con->data; bLockTrackConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bDistLimitConstraint *data = con->data; bDistLimitConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bStretchToConstraint *data = con->data; bStretchToConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bMinMaxConstraint *data = con->data; bMinMaxConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bRigidBodyJointConstraint *data = con->data; bRigidBodyJointConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bClampToConstraint *data = con->data; bClampToConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bTransformConstraint *data = con->data; bTransformConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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) { if (con && list) {
bShrinkwrapConstraint *data = con->data; bShrinkwrapConstraint *data = con->data;
bConstraintTarget *ct = list->first; 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; 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) { if (con && list) {
bDampTrackConstraint *data = con->data; bDampTrackConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bSplineIKConstraint *data = con->data; bSplineIKConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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; 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) { if (con && list) {
bPivotConstraint *data = con->data; bPivotConstraint *data = con->data;
bConstraintTarget *ct = list->first; bConstraintTarget *ct = list->first;
/* the following macro is used for all standard single-target constraints */ /* 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 ------- */ /* ---------- Data Management ------- */
/* helper function for BKE_free_constraint_data() - unlinks references */ /* 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); id_us_min(*idpoin);
} }
@ -4322,7 +4322,7 @@ void BKE_free_constraints(ListBase *list)
/* Remove the specified constraint from the given constraint stack */ /* 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) { if (con) {
BKE_free_constraint_data(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 */ /* 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; 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 */ /* 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 /* ID_NEW() expects a struct with inline "id" member as first
* since we've got the actual ID block, let's just inline this * 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 */ /* 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) if (*idpoin && (*idpoin)->lib)
id_lib_extern(*idpoin); id_lib_extern(*idpoin);
} }
/* helper for BKE_copy_constraints(), to be used for making sure that usercounts of copied ID's are fixed up */ /* 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 */ /* increment usercount if this is a reference type */
if ((*idpoin) && (isReference)) if ((*idpoin) && (is_reference))
id_us_plus(*idpoin); 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 */ /* 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 */ /* Currently, constraints can only be on object or bone level */
if (ob && ob->proxy) { if (ob && ob->proxy) {

@ -882,7 +882,7 @@ void testhandles_fcurve(FCurve *fcu, const bool use_handle)
*/ */
void sort_time_fcurve(FCurve *fcu) void sort_time_fcurve(FCurve *fcu)
{ {
short ok = 1; bool ok = true;
/* keep adjusting order of beztriples until nothing moves (bubble-sort) */ /* keep adjusting order of beztriples until nothing moves (bubble-sort) */
while (ok) { while (ok) {

@ -314,7 +314,7 @@ void BKE_lattice_make_local(Lattice *lt)
{ {
Main *bmain = G.main; Main *bmain = G.main;
Object *ob; Object *ob;
int is_local = false, is_lib = false; bool is_local = false, is_lib = false;
/* - only lib users: do nothing /* - only lib users: do nothing
* - only local users: set flag * - only local users: set flag

@ -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, 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; LibraryForeachIDData *data = (LibraryForeachIDData *) user_data;
FOREACH_CALLBACK_INVOKE_ID_PP(data->self_id, id_pointer, data->flag, data->callback, data->user_data, IDWALK_NOP); FOREACH_CALLBACK_INVOKE_ID_PP(data->self_id, id_pointer, data->flag, data->callback, data->user_data, IDWALK_NOP);

@ -356,7 +356,8 @@ void BKE_mball_texspace_calc(Object *ob)
DispList *dl; DispList *dl;
BoundBox *bb; BoundBox *bb;
float *data, min[3], max[3] /*, loc[3], size[3] */; 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"); if (ob->bb == NULL) ob->bb = MEM_callocN(sizeof(BoundBox), "mb boundbox");
bb = ob->bb; bb = ob->bb;

@ -283,7 +283,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
} }
for (i = 0, me = medges; i < totedge; i++, me++) { for (i = 0, me = medges; i < totedge; i++, me++) {
int remove = false; bool remove = false;
if (me->v1 == me->v2) { if (me->v1 == me->v2) {
PRINT_ERR("\tEdge %u: has matching verts, both %u\n", i, me->v1); PRINT_ERR("\tEdge %u: has matching verts, both %u\n", i, me->v1);
remove = do_fixes; remove = do_fixes;
@ -336,7 +336,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
PRINT_ERR("No Polys, only tesselated Faces\n"); PRINT_ERR("No Polys, only tesselated Faces\n");
for (i = 0, mf = mfaces, sf = sort_faces; i < totface; i++, mf++) { for (i = 0, mf = mfaces, sf = sort_faces; i < totface; i++, mf++) {
int remove = false; bool remove = false;
int fidx; int fidx;
unsigned int fv[4]; unsigned int fv[4];
@ -411,7 +411,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
sf++; sf++;
for (i = 1; i < totsortface; i++, sf++) { for (i = 1; i < totsortface; i++, sf++) {
int remove = false; bool remove = false;
/* on a valid mesh, code below will never run */ /* on a valid mesh, code below will never run */
if (memcmp(sf->es, sf_prev->es, sizeof(sf_prev->es)) == 0) { if (memcmp(sf->es, sf_prev->es, sizeof(sf_prev->es)) == 0) {

@ -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 /* Add the given NLA-Strip to the given list of strips, assuming that it
* isn't currently a member of another list * 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; NlaStrip *ns;
short not_added = 1; bool not_added = true;
/* sanity checks */ /* sanity checks */
if (ELEM(NULL, strips, strip)) 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. * contained within 'Meta-Strips' which act as strips which contain strips.
* temp: are the meta-strips to be created 'temporary' ones used for transforms? * 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 *mstrip = NULL;
NlaStrip *strip, *stripn; NlaStrip *strip, *stripn;
@ -689,7 +689,7 @@ void BKE_nlastrips_make_metas(ListBase *strips, short temp)
mstrip->flag = NLASTRIP_FLAG_SELECT; mstrip->flag = NLASTRIP_FLAG_SELECT;
/* set temp flag if appropriate (i.e. for transform-type editing) */ /* set temp flag if appropriate (i.e. for transform-type editing) */
if (temp) if (is_temp)
mstrip->flag |= NLASTRIP_FLAG_TEMP_META; mstrip->flag |= NLASTRIP_FLAG_TEMP_META;
/* set default repeat/scale values to prevent warnings */ /* 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 * sel: only consider selected meta-strips, otherwise all meta-strips are removed
* onlyTemp: only remove the 'temporary' meta-strips used for transforms * 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; 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 */ /* check if strip is a meta-strip */
if (strip->type == NLASTRIP_TYPE_META) { if (strip->type == NLASTRIP_TYPE_META) {
/* if check if selection and 'temporary-only' considerations are met */ /* if check if selection and 'temporary-only' considerations are met */
if ((onlySel == 0) || (strip->flag & NLASTRIP_FLAG_SELECT)) { if ((!only_sel) || (strip->flag & NLASTRIP_FLAG_SELECT)) {
if ((!onlyTemp) || (strip->flag & NLASTRIP_FLAG_TEMP_META)) { if ((!only_temp) || (strip->flag & NLASTRIP_FLAG_TEMP_META)) {
BKE_nlastrips_clear_metastrip(strips, strip); 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 /* Add the given NLA-Strip to the given Meta-Strip, assuming that the
* strip isn't attached to any list of strips * 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 */ /* sanity checks */
if (ELEM(NULL, mstrip, strip)) 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 /* Add the given NLA-Strip to the given NLA-Track, assuming that it
* isn't currently attached to another one * 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 */ /* sanity checks */
if (ELEM(NULL, nlt, strip)) 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, /* Get the extents of the given NLA-Track including gaps between strips,
* returning whether this succeeded or not * 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; 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)? */ /* 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 stripLen = (strip) ? strip->end - strip->start : 0.0f;
const float boundsLen = fabsf(max - min); const float boundsLen = fabsf(max - min);
@ -1220,7 +1220,7 @@ static bool nlastrip_is_first(AnimData *adt, NlaStrip *strip)
/* Animated Strips ------------------------------------------- */ /* Animated Strips ------------------------------------------- */
/* Check if the given NLA-Track has any strips with own F-Curves */ /* 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; 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 */ /* 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; 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, /* Find the active strip + track combo, and set them up as the tweaking track,
* and return if successful or not. * and return if successful or not.
*/ */
short BKE_nla_tweakmode_enter(AnimData *adt) bool BKE_nla_tweakmode_enter(AnimData *adt)
{ {
NlaTrack *nlt, *activeTrack = NULL; NlaTrack *nlt, *activeTrack = NULL;
NlaStrip *strip, *activeStrip = NULL; NlaStrip *strip, *activeStrip = NULL;

@ -2217,7 +2217,7 @@ static void ob_get_parent_matrix(Scene *scene, Object *ob, Object *par, float pa
{ {
float tmat[4][4]; float tmat[4][4];
float vec[3]; float vec[3];
int ok; bool ok;
switch (ob->partype & PARTYPE) { switch (ob->partype & PARTYPE) {
case PAROBJECT: case PAROBJECT:

@ -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], bool pbvh_bmesh_node_raycast(PBVHNode *node, const float ray_start[3],
const float ray_normal[3], float *dist, const float ray_normal[3], float *dist,
int use_original) bool use_original)
{ {
bool hit = false; bool hit = false;

@ -184,7 +184,7 @@ void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes, int totnode, int flag);
bool pbvh_bmesh_node_raycast( bool pbvh_bmesh_node_raycast(
PBVHNode *node, const float ray_start[3], PBVHNode *node, const float ray_start[3],
const float ray_normal[3], float *dist, const float ray_normal[3], float *dist,
int use_original); bool use_original);
void pbvh_bmesh_normals_update(PBVHNode **nodes, int totnode); void pbvh_bmesh_normals_update(PBVHNode **nodes, int totnode);

@ -933,7 +933,7 @@ static void update_obstacles(Scene *scene, Object *ob, SmokeDomainSettings *sds,
**********************************************************/ **********************************************************/
/* set "ignore cache" flag for all caches on this object */ /* 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; ListBase pidlist;
PTCacheID *pid; PTCacheID *pid;
@ -951,7 +951,7 @@ static void object_cacheIgnoreClear(Object *ob, int state)
BLI_freelistN(&pidlist); 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); SmokeModifierData *smd = (SmokeModifierData *)modifiers_findByType(ob, eModifierType_Smoke);
bConstraint *con; 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 object has parents, update them too */
if (parent_recursion) { if (parent_recursion) {
int recursion = parent_recursion - 1; int recursion = parent_recursion - 1;
int is_domain = 0; bool is_domain = false;
if (ob->parent) is_domain += subframe_updateObject(scene, ob->parent, 0, recursion, frame, for_render); 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); if (ob->track) is_domain |= subframe_updateObject(scene, ob->track, 0, recursion, frame, for_render);
/* skip subframe if object is parented /* skip subframe if object is parented
* to vertex of a dynamic paint canvas */ * 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]; 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], static void sample_derivedmesh(
float *vert_vel, int has_velocity, int defgrp_index, MDeformVert *dvert, float x, float y, float z) 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}; float ray_dir[3] = {1.0f, 0.0f, 0.0f};
BVHTreeRayHit hit = {0}; BVHTreeRayHit hit = {0};

@ -2963,7 +2963,8 @@ int txt_setcurr_tab_spaces(Text *text, int space)
* 2) within an identifier * 2) within an identifier
* 3) after the cursor (text->curc), i.e. when creating space before a function def [#25414] * 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++) { for (a = 0; (a < text->curc) && (text->curl->line[a] != '\0'); a++) {
char ch = text->curl->line[a]; char ch = text->curl->line[a];
if (ch == '#') { if (ch == '#') {

@ -319,7 +319,7 @@ static bool scanfill_preprocess_self_isect(
ScanFillVert *v_prev; ScanFillVert *v_prev;
ScanFillVert *v_curr; ScanFillVert *v_curr;
int inside = false; bool inside = false;
/* first vert */ /* first vert */
#if 0 #if 0

@ -2462,7 +2462,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open))
} FOREACH_NODETREE_END } FOREACH_NODETREE_END
{ {
int has_old_groups = 0; bool has_old_groups = false;
/* XXX this should actually be part of do_versions, but since we need /* XXX this should actually be part of do_versions, but since we need
* finished library linking, it is not possible there. Instead in do_versions * finished library linking, it is not possible there. Instead in do_versions
* we have set the NTREE_DO_VERSIONS_GROUP_EXPOSE_2_56_2 flag, so at this point we can do the * we have set the NTREE_DO_VERSIONS_GROUP_EXPOSE_2_56_2 flag, so at this point we can do the
@ -2752,12 +2752,12 @@ typedef struct tConstraintLinkData {
ID *id; ID *id;
} tConstraintLinkData; } tConstraintLinkData;
/* callback function used to relink constraint ID-links */ /* callback function used to relink constraint ID-links */
static void lib_link_constraint_cb(bConstraint *UNUSED(con), ID **idpoin, short isReference, void *userdata) static void lib_link_constraint_cb(bConstraint *UNUSED(con), ID **idpoin, bool is_reference, void *userdata)
{ {
tConstraintLinkData *cld= (tConstraintLinkData *)userdata; tConstraintLinkData *cld= (tConstraintLinkData *)userdata;
/* for reference types, we need to increment the usercounts on load... */ /* for reference types, we need to increment the usercounts on load... */
if (isReference) { if (is_reference) {
/* reference type - with usercount */ /* reference type - with usercount */
*idpoin = newlibadr_us(cld->fd, cld->id->lib, *idpoin); *idpoin = newlibadr_us(cld->fd, cld->id->lib, *idpoin);
} }
@ -8208,7 +8208,7 @@ typedef struct tConstraintExpandData {
Main *mainvar; Main *mainvar;
} tConstraintExpandData; } tConstraintExpandData;
/* callback function used to expand constraint ID-links */ /* callback function used to expand constraint ID-links */
static void expand_constraint_cb(bConstraint *UNUSED(con), ID **idpoin, short UNUSED(isReference), void *userdata) static void expand_constraint_cb(bConstraint *UNUSED(con), ID **idpoin, bool UNUSED(is_reference), void *userdata)
{ {
tConstraintExpandData *ced = (tConstraintExpandData *)userdata; tConstraintExpandData *ced = (tConstraintExpandData *)userdata;
expand_doit(ced->fd, ced->mainvar, *idpoin); expand_doit(ced->fd, ced->mainvar, *idpoin);

@ -114,7 +114,7 @@ void bmo_edgenet_prepare_exec(BMesh *bm, BMOperator *op)
BLI_array_declare(edges1); BLI_array_declare(edges1);
BLI_array_declare(edges2); BLI_array_declare(edges2);
BLI_array_declare(edges); BLI_array_declare(edges);
int ok = 1; bool ok = true;
int i, count; int i, count;
BMO_slot_buffer_flag_enable(bm, op->slots_in, "edges", BM_EDGE, EDGE_MARK); BMO_slot_buffer_flag_enable(bm, op->slots_in, "edges", BM_EDGE, EDGE_MARK);

@ -387,7 +387,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
* - setting: type of setting to set * - setting: type of setting to set
* - on: whether the visibility setting has been enabled or disabled * - on: whether the visibility setting has been enabled or disabled
*/ */
void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAnimListElem *ale_setting, int setting, short on) void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAnimListElem *ale_setting, int setting, short mode)
{ {
bAnimListElem *ale, *match = NULL; bAnimListElem *ale, *match = NULL;
int prevLevel = 0, matchLevel = 0; int prevLevel = 0, matchLevel = 0;
@ -437,8 +437,8 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
* - only flush up if the current state is now disabled (negative 'off' state is default) * - only flush up if the current state is now disabled (negative 'off' state is default)
* (otherwise, it's too much work to force the parents to be active too) * (otherwise, it's too much work to force the parents to be active too)
*/ */
if ( ((setting == ACHANNEL_SETTING_VISIBLE) && on) || if ( ((setting == ACHANNEL_SETTING_VISIBLE) && (mode != ACHANNEL_SETFLAG_CLEAR)) ||
((setting != ACHANNEL_SETTING_VISIBLE) && on == 0) ) ((setting != ACHANNEL_SETTING_VISIBLE) && (mode == ACHANNEL_SETFLAG_CLEAR)))
{ {
/* go backwards in the list, until the highest-ranking element (by indention has been covered) */ /* go backwards in the list, until the highest-ranking element (by indention has been covered) */
for (ale = match->prev; ale; ale = ale->prev) { for (ale = match->prev; ale; ale = ale->prev) {
@ -461,7 +461,7 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
*/ */
if (level < prevLevel) { if (level < prevLevel) {
/* flush the new status... */ /* flush the new status... */
ANIM_channel_setting_set(ac, ale, setting, on); ANIM_channel_setting_set(ac, ale, setting, mode);
/* store this level as the 'old' level now */ /* store this level as the 'old' level now */
prevLevel = level; prevLevel = level;
@ -502,7 +502,7 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
* flush the new status... * flush the new status...
*/ */
if (level > matchLevel) if (level > matchLevel)
ANIM_channel_setting_set(ac, ale, setting, on); ANIM_channel_setting_set(ac, ale, setting, mode);
/* however, if the level is 'less than or equal to' the channel that was changed, /* however, if the level is 'less than or equal to' the channel that was changed,
* (i.e. the current channel is as important if not more important than the changed channel) * (i.e. the current channel is as important if not more important than the changed channel)
* then we should stop, since we've found the last one of the children we should flush * then we should stop, since we've found the last one of the children we should flush

@ -223,7 +223,7 @@ static short bezt_nlamapping_apply(KeyframeEditData *ked, BezTriple *bezt)
* - restore = whether to map points back to non-mapped time * - restore = whether to map points back to non-mapped time
* - only_keys = whether to only adjust the location of the center point of beztriples * - only_keys = whether to only adjust the location of the center point of beztriples
*/ */
void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, short restore, short only_keys) void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
{ {
KeyframeEditData ked = {{NULL}}; KeyframeEditData ked = {{NULL}};
KeyframeEditFunc map_cb; KeyframeEditFunc map_cb;

@ -705,9 +705,9 @@ void free_fmodifiers_copybuf(void)
* assuming that the buffer has been cleared already with free_fmodifiers_copybuf() * assuming that the buffer has been cleared already with free_fmodifiers_copybuf()
* - active: only copy the active modifier * - active: only copy the active modifier
*/ */
short ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, short active) bool ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, bool active)
{ {
short ok = 1; bool ok = true;
/* sanity checks */ /* sanity checks */
if (ELEM(NULL, modifiers, modifiers->first)) if (ELEM(NULL, modifiers, modifiers->first))
@ -734,10 +734,10 @@ short ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, short active)
/* 'Paste' the F-Modifier(s) from the buffer to the specified list /* 'Paste' the F-Modifier(s) from the buffer to the specified list
* - replace: free all the existing modifiers to leave only the pasted ones * - replace: free all the existing modifiers to leave only the pasted ones
*/ */
short ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, short replace) bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace)
{ {
FModifier *fcm; FModifier *fcm;
short ok = 0; bool ok = false;
/* sanity checks */ /* sanity checks */
if (modifiers == NULL) if (modifiers == NULL)

@ -428,6 +428,7 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac)
*/ */
#define KEYFRAME_OK_CHECKS(check) \ #define KEYFRAME_OK_CHECKS(check) \
{ \ { \
CHECK_TYPE(ok, short); \
if (check(1)) \ if (check(1)) \
ok |= KEYFRAME_OK_KEY; \ ok |= KEYFRAME_OK_KEY; \
\ \

@ -124,7 +124,7 @@ void ED_armature_exit_posemode(bContext *C, Base *base)
/* if a selected or active bone is protected, throw error (oonly if warn == 1) and return 1 */ /* if a selected or active bone is protected, throw error (oonly if warn == 1) and return 1 */
/* only_selected == 1: the active bone is allowed to be protected */ /* only_selected == 1: the active bone is allowed to be protected */
#if 0 /* UNUSED 2.5 */ #if 0 /* UNUSED 2.5 */
static short pose_has_protected_selected(Object *ob, short warn) static bool pose_has_protected_selected(Object *ob, short warn)
{ {
/* check protection */ /* check protection */
if (ob->proxy) { if (ob->proxy) {

@ -878,7 +878,7 @@ static void poselib_apply_pose(tPoseLib_PreviewData *pld)
pchan = BKE_pose_channel_find_name(pose, agrp->name); pchan = BKE_pose_channel_find_name(pose, agrp->name);
if (pchan) { if (pchan) {
short ok = 0; bool ok = 0;
/* check if this bone should get any animation applied */ /* check if this bone should get any animation applied */
if (pld->selcount == 0) { if (pld->selcount == 0) {

@ -2971,7 +2971,7 @@ static void select_adjacent_cp(ListBase *editnurb, short next,
BezTriple *bezt; BezTriple *bezt;
BPoint *bp; BPoint *bp;
int a; int a;
short lastsel = false; bool lastsel = false;
if (next == 0) return; if (next == 0) return;
@ -3141,7 +3141,7 @@ void CURVE_OT_de_select_last(wmOperatorType *ot)
/******************* de select all operator ***************/ /******************* de select all operator ***************/
static short nurb_has_selected_cps(ListBase *editnurb) static bool nurb_has_selected_cps(ListBase *editnurb)
{ {
Nurb *nu; Nurb *nu;
BezTriple *bezt; BezTriple *bezt;
@ -4358,7 +4358,7 @@ static int merge_nurb(bContext *C, wmOperator *op)
Object *obedit = CTX_data_edit_object(C); Object *obedit = CTX_data_edit_object(C);
ListBase *editnurb = object_editcurve_get(obedit); ListBase *editnurb = object_editcurve_get(obedit);
NurbSort *nus1, *nus2; NurbSort *nus1, *nus2;
int ok = 1; bool ok = true;
make_selection_list_nurb(editnurb); make_selection_list_nurb(editnurb);
@ -4427,7 +4427,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
ListBase *nubase = object_editcurve_get(obedit); ListBase *nubase = object_editcurve_get(obedit);
Nurb *nu, *nu1 = NULL, *nu2 = NULL; Nurb *nu, *nu1 = NULL, *nu2 = NULL;
BPoint *bp; BPoint *bp;
int ok = 0; bool ok = false;
/* int a; */ /* UNUSED */ /* int a; */ /* UNUSED */
/* first decide if this is a surface merge! */ /* first decide if this is a surface merge! */
@ -4913,7 +4913,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
BezTriple *bezt, *newbezt = NULL; BezTriple *bezt, *newbezt = NULL;
BPoint *bp, *newbp = NULL; BPoint *bp, *newbp = NULL;
float imat[4][4], temp[3]; float imat[4][4], temp[3];
int ok = 0; bool ok = false;
BezTriple *bezt_recalc[3] = {NULL}; BezTriple *bezt_recalc[3] = {NULL};
invert_m4_m4(imat, obedit->obmat); invert_m4_m4(imat, obedit->obmat);

@ -716,7 +716,7 @@ static EnumPropertyItem style_items[] = {
{0, NULL, 0, NULL, NULL} {0, NULL, 0, NULL, NULL}
}; };
static int set_style(bContext *C, const int style, const int clear) static int set_style(bContext *C, const int style, const bool clear)
{ {
Object *obedit = CTX_data_edit_object(C); Object *obedit = CTX_data_edit_object(C);
Curve *cu = obedit->data; Curve *cu = obedit->data;
@ -742,7 +742,7 @@ static int set_style(bContext *C, const int style, const int clear)
static int set_style_exec(bContext *C, wmOperator *op) static int set_style_exec(bContext *C, wmOperator *op)
{ {
const int style = RNA_enum_get(op->ptr, "style"); const int style = RNA_enum_get(op->ptr, "style");
const int clear = RNA_boolean_get(op->ptr, "clear"); const bool clear = RNA_boolean_get(op->ptr, "clear");
return set_style(C, style, clear); return set_style(C, style, clear);
} }

@ -454,7 +454,7 @@ void ANIM_channel_setting_set(bAnimContext *ac, bAnimListElem *ale, int setting,
* - setting: type of setting to set * - setting: type of setting to set
* - on: whether the visibility setting has been enabled or disabled * - on: whether the visibility setting has been enabled or disabled
*/ */
void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAnimListElem *ale_setting, int setting, short on); void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAnimListElem *ale_setting, int setting, short mode);
/* Deselect all animation channels */ /* Deselect all animation channels */
@ -511,12 +511,12 @@ void free_fmodifiers_copybuf(void);
* assuming that the buffer has been cleared already with free_fmodifiers_copybuf() * assuming that the buffer has been cleared already with free_fmodifiers_copybuf()
* - active: only copy the active modifier * - active: only copy the active modifier
*/ */
short ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, short active); bool ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, bool active);
/* 'Paste' the F-Modifier(s) from the buffer to the specified list /* 'Paste' the F-Modifier(s) from the buffer to the specified list
* - replace: free all the existing modifiers to leave only the pasted ones * - replace: free all the existing modifiers to leave only the pasted ones
*/ */
short ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, short replace); bool ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, bool replace);
/* ************************************************* */ /* ************************************************* */
/* ASSORTED TOOLS */ /* ASSORTED TOOLS */
@ -537,7 +537,7 @@ void getcolor_fcurve_rainbow(int cur, int tot, float out[3]);
struct AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale); struct AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale);
/* Apply/Unapply NLA mapping to all keyframes in the nominated F-Curve */ /* Apply/Unapply NLA mapping to all keyframes in the nominated F-Curve */
void ANIM_nla_mapping_apply_fcurve(struct AnimData *adt, struct FCurve *fcu, short restore, short only_keys); void ANIM_nla_mapping_apply_fcurve(struct AnimData *adt, struct FCurve *fcu, bool restore, bool only_keys);
/* ..... */ /* ..... */

@ -1264,7 +1264,7 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
*/ */
int ui_is_but_push_ex(uiBut *but, double *value) int ui_is_but_push_ex(uiBut *but, double *value)
{ {
int is_push = false; int is_push = 0;
if (but->bit) { if (but->bit) {
const bool state = ELEM3(but->type, TOGN, ICONTOGN, OPTIONN) ? false : true; const bool state = ELEM3(but->type, TOGN, ICONTOGN, OPTIONN) ? false : true;
@ -1862,7 +1862,7 @@ void ui_convert_to_unit_alt_name(uiBut *but, char *str, size_t maxlen)
static void ui_get_but_string_unit(uiBut *but, char *str, int len_max, double value, bool pad, int float_precision) static void ui_get_but_string_unit(uiBut *but, char *str, int len_max, double value, bool pad, int float_precision)
{ {
UnitSettings *unit = but->block->unit; UnitSettings *unit = but->block->unit;
int do_split = (unit->flag & USER_UNIT_OPT_SPLIT) != 0; const bool do_split = (unit->flag & USER_UNIT_OPT_SPLIT) != 0;
int unit_type = uiButGetUnitType(but); int unit_type = uiButGetUnitType(but);
int precision; int precision;

@ -1483,7 +1483,8 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti
void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti *recti) void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti *recti)
{ {
rctf rect; rctf rect;
int ok = 0, width, height; bool ok = false;
int width, height;
GLint scissor[4]; GLint scissor[4];
MovieClipScopes *scopes = (MovieClipScopes *)but->poin; MovieClipScopes *scopes = (MovieClipScopes *)but->poin;

@ -1854,7 +1854,7 @@ static int mask_hide_view_set_exec(bContext *C, wmOperator *op)
{ {
Mask *mask = CTX_data_edit_mask(C); Mask *mask = CTX_data_edit_mask(C);
MaskLayer *masklay; MaskLayer *masklay;
const int unselected = RNA_boolean_get(op->ptr, "unselected"); const bool unselected = RNA_boolean_get(op->ptr, "unselected");
bool changed = false; bool changed = false;
for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) { for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) {

@ -699,7 +699,7 @@ static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE
MaskSpline *spline; MaskSpline *spline;
MaskSplinePoint *point = NULL; MaskSplinePoint *point = NULL;
float co[2]; float co[2];
int do_select = !RNA_boolean_get(op->ptr, "deselect"); bool do_select = !RNA_boolean_get(op->ptr, "deselect");
const float threshold = 19; const float threshold = 19;
bool changed = false; bool changed = false;

@ -168,7 +168,7 @@ void EDBM_select_mirrored(BMEditMesh *em, bool extend,
void EDBM_automerge(Scene *scene, Object *obedit, bool update, const char hflag) void EDBM_automerge(Scene *scene, Object *obedit, bool update, const char hflag)
{ {
int ok; bool ok;
BMEditMesh *em = BKE_editmesh_from_object(obedit); BMEditMesh *em = BKE_editmesh_from_object(obedit);
ok = BMO_op_callf(em->bm, BMO_FLAG_DEFAULTS, ok = BMO_op_callf(em->bm, BMO_FLAG_DEFAULTS,
@ -2092,7 +2092,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE
BMVert *eve; BMVert *eve;
BMEdge *e, *eed; BMEdge *e, *eed;
BMFace *efa; BMFace *efa;
int sel = !RNA_boolean_get(op->ptr, "deselect"); const bool sel = !RNA_boolean_get(op->ptr, "deselect");
int limit; int limit;

@ -1285,7 +1285,7 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
Mesh *me = obedit->data; Mesh *me = obedit->data;
BMEditMesh *em = BKE_editmesh_from_object(obedit); BMEditMesh *em = BKE_editmesh_from_object(obedit);
ModifierData *md; ModifierData *md;
int mirrx = false, mirry = false, mirrz = false; bool mirrx = false, mirry = false, mirrz = false;
int i, repeat; int i, repeat;
float clip_dist = 0.0f; float clip_dist = 0.0f;
bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0; bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
@ -1370,7 +1370,7 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op)
BMEditMesh *em = BKE_editmesh_from_object(obedit); BMEditMesh *em = BKE_editmesh_from_object(obedit);
Mesh *me = obedit->data; Mesh *me = obedit->data;
bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0; bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
int usex = true, usey = true, usez = true, preserve_volume = true; bool usex = true, usey = true, usez = true, preserve_volume = true;
int i, repeat; int i, repeat;
float lambda_factor; float lambda_factor;
float lambda_border; float lambda_border;

@ -596,7 +596,7 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op)
DerivedMesh *dm = NULL; DerivedMesh *dm = NULL;
Key *key = me->key; Key *key = me->key;
KeyBlock *kb; KeyBlock *kb;
int ok = 0, nonequal_verts = 0; bool ok = false, nonequal_verts = false;
CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
{ {
@ -606,7 +606,7 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op)
selme = (Mesh *)base->object->data; selme = (Mesh *)base->object->data;
if (selme->totvert == me->totvert) if (selme->totvert == me->totvert)
ok++; ok = true;
else else
nonequal_verts = 1; nonequal_verts = 1;
} }

@ -502,7 +502,7 @@ static int hide_metaelems_exec(bContext *C, wmOperator *op)
Object *obedit = CTX_data_edit_object(C); Object *obedit = CTX_data_edit_object(C);
MetaBall *mb = (MetaBall *)obedit->data; MetaBall *mb = (MetaBall *)obedit->data;
MetaElem *ml; MetaElem *ml;
const int invert = RNA_boolean_get(op->ptr, "unselected") ? SELECT : 0; const bool invert = RNA_boolean_get(op->ptr, "unselected") ? SELECT : 0;
ml = mb->editelems->first; ml = mb->editelems->first;

@ -1259,8 +1259,8 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
/********************* Make Duplicates Real ************************/ /********************* Make Duplicates Real ************************/
static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
const short use_base_parent, const bool use_base_parent,
const short use_hierarchy) const bool use_hierarchy)
{ {
Main *bmain = CTX_data_main(C); Main *bmain = CTX_data_main(C);
ListBase *lb; ListBase *lb;
@ -1410,8 +1410,8 @@ static int object_duplicates_make_real_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C); Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
const short use_base_parent = RNA_boolean_get(op->ptr, "use_base_parent"); const bool use_base_parent = RNA_boolean_get(op->ptr, "use_base_parent");
const short use_hierarchy = RNA_boolean_get(op->ptr, "use_hierarchy"); const bool use_hierarchy = RNA_boolean_get(op->ptr, "use_hierarchy");
BKE_main_id_clear_newpoins(bmain); BKE_main_id_clear_newpoins(bmain);

@ -178,7 +178,7 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C); Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
bool changed = false; bool changed = false;
const int unselected = RNA_boolean_get(op->ptr, "unselected"); const bool unselected = RNA_boolean_get(op->ptr, "unselected");
CTX_DATA_BEGIN(C, Base *, base, visible_bases) CTX_DATA_BEGIN(C, Base *, base, visible_bases)
{ {
@ -273,7 +273,7 @@ void OBJECT_OT_hide_render_clear(wmOperatorType *ot)
static int object_hide_render_set_exec(bContext *C, wmOperator *op) static int object_hide_render_set_exec(bContext *C, wmOperator *op)
{ {
const int unselected = RNA_boolean_get(op->ptr, "unselected"); const bool unselected = RNA_boolean_get(op->ptr, "unselected");
CTX_DATA_BEGIN(C, Base *, base, visible_bases) CTX_DATA_BEGIN(C, Base *, base, visible_bases)
{ {
@ -432,7 +432,7 @@ void ED_object_editmode_enter(bContext *C, int flag)
Object *ob; Object *ob;
ScrArea *sa = CTX_wm_area(C); ScrArea *sa = CTX_wm_area(C);
View3D *v3d = NULL; View3D *v3d = NULL;
int ok = 0; bool ok = false;
if (scene->id.lib) return; if (scene->id.lib) return;

@ -249,7 +249,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
int single_group_index = RNA_enum_get(op->ptr, "group"); int single_group_index = RNA_enum_get(op->ptr, "group");
Group *single_group = group_object_active_find_index(ob, single_group_index); Group *single_group = group_object_active_find_index(ob, single_group_index);
Group *group; Group *group;
int ok = 0; bool ok = false;
if (ob == NULL) if (ob == NULL)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;

@ -542,7 +542,7 @@ static int object_add_hook_selob_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C); Object *obedit = CTX_data_edit_object(C);
Object *obsel = NULL; Object *obsel = NULL;
const int use_bone = RNA_boolean_get(op->ptr, "use_bone"); const bool use_bone = RNA_boolean_get(op->ptr, "use_bone");
const int mode = use_bone ? OBJECT_ADDHOOK_SELOB_BONE : OBJECT_ADDHOOK_SELOB; const int mode = use_bone ? OBJECT_ADDHOOK_SELOB_BONE : OBJECT_ADDHOOK_SELOB;
CTX_DATA_BEGIN (C, Object *, ob, selected_objects) CTX_DATA_BEGIN (C, Object *, ob, selected_objects)

@ -375,7 +375,7 @@ static void ignore_parent_tx(Main *bmain, Scene *scene, Object *ob)
} }
} }
static int apply_objects_internal(bContext *C, ReportList *reports, int apply_loc, int apply_rot, int apply_scale) static int apply_objects_internal(bContext *C, ReportList *reports, bool apply_loc, bool apply_rot, bool apply_scale)
{ {
Main *bmain = CTX_data_main(C); Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
@ -647,9 +647,9 @@ void OBJECT_OT_visual_transform_apply(wmOperatorType *ot)
static int object_transform_apply_exec(bContext *C, wmOperator *op) static int object_transform_apply_exec(bContext *C, wmOperator *op)
{ {
const int loc = RNA_boolean_get(op->ptr, "location"); const bool loc = RNA_boolean_get(op->ptr, "location");
const int rot = RNA_boolean_get(op->ptr, "rotation"); const bool rot = RNA_boolean_get(op->ptr, "rotation");
const int sca = RNA_boolean_get(op->ptr, "scale"); const bool sca = RNA_boolean_get(op->ptr, "scale");
if (loc || rot || sca) { if (loc || rot || sca) {
return apply_objects_internal(C, op->reports, loc, rot, sca); return apply_objects_internal(C, op->reports, loc, rot, sca);

@ -512,8 +512,8 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op)
ImBuf *ibuf, *ibuf_save = NULL; ImBuf *ibuf, *ibuf_save = NULL;
void *lock; void *lock;
char name[FILE_MAX]; char name[FILE_MAX];
int ok = 0; bool ok = false;
const short view_context = (oglrender->v3d != NULL); const bool view_context = (oglrender->v3d != NULL);
Object *camera = NULL; Object *camera = NULL;
bool is_movie; bool is_movie;

@ -524,7 +524,7 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
/* new UI convention: draw is in pixel space already. */ /* new UI convention: draw is in pixel space already. */
/* uses ROUNDBOX button in block to get the rect */ /* uses ROUNDBOX button in block to get the rect */
static int ed_preview_draw_rect(ScrArea *sa, int split, int first, rcti *rect, rcti *newrect) static bool ed_preview_draw_rect(ScrArea *sa, int split, int first, rcti *rect, rcti *newrect)
{ {
Render *re; Render *re;
RenderResult rres; RenderResult rres;
@ -532,7 +532,7 @@ static int ed_preview_draw_rect(ScrArea *sa, int split, int first, rcti *rect, r
int offx = 0; int offx = 0;
int newx = BLI_rcti_size_x(rect); int newx = BLI_rcti_size_x(rect);
int newy = BLI_rcti_size_y(rect); int newy = BLI_rcti_size_y(rect);
int ok = 0; bool ok = false;
if (!split || first) sprintf(name, "Preview %p", (void *)sa); if (!split || first) sprintf(name, "Preview %p", (void *)sa);
else sprintf(name, "SecondPreview %p", (void *)sa); else sprintf(name, "SecondPreview %p", (void *)sa);

@ -366,7 +366,7 @@ static void texture_changed(Main *bmain, Tex *tex)
Scene *scene; Scene *scene;
Object *ob; Object *ob;
bNode *node; bNode *node;
int texture_draw = false; bool texture_draw = false;
/* icons */ /* icons */
BKE_icon_changed(BKE_icon_getid(&tex->id)); BKE_icon_changed(BKE_icon_getid(&tex->id));

@ -808,7 +808,7 @@ void ED_space_image_paint_update(wmWindowManager *wm, ToolSettings *settings)
wmWindow *win; wmWindow *win;
ScrArea *sa; ScrArea *sa;
ImagePaintSettings *imapaint = &settings->imapaint; ImagePaintSettings *imapaint = &settings->imapaint;
int enabled = false; bool enabled = false;
for (win = wm->windows.first; win; win = win->next) for (win = wm->windows.first; win; win = win->next)
for (sa = win->screen->areabase.first; sa; sa = sa->next) for (sa = win->screen->areabase.first; sa; sa = sa->next)

@ -405,7 +405,7 @@ void PAINT_OT_vert_select_ungrouped(wmOperatorType *ot)
static int face_select_hide_exec(bContext *C, wmOperator *op) static int face_select_hide_exec(bContext *C, wmOperator *op)
{ {
const int unselected = RNA_boolean_get(op->ptr, "unselected"); const bool unselected = RNA_boolean_get(op->ptr, "unselected");
Object *ob = CTX_data_active_object(C); Object *ob = CTX_data_active_object(C);
paintface_hide(ob, unselected); paintface_hide(ob, unselected);
ED_region_tag_redraw(CTX_wm_region(C)); ED_region_tag_redraw(CTX_wm_region(C));

@ -4218,9 +4218,9 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
/* Returns true if any of the smoothing modes are active (currently /* Returns true if any of the smoothing modes are active (currently
* one of smooth brush, autosmooth, mask smooth, or shift-key * one of smooth brush, autosmooth, mask smooth, or shift-key
* smooth) */ * smooth) */
static int sculpt_any_smooth_mode(const Brush *brush, static bool sculpt_any_smooth_mode(const Brush *brush,
StrokeCache *cache, StrokeCache *cache,
int stroke_mode) int stroke_mode)
{ {
return ((stroke_mode == BRUSH_STROKE_SMOOTH) || return ((stroke_mode == BRUSH_STROKE_SMOOTH) ||
(cache && cache->alt_smooth) || (cache && cache->alt_smooth) ||
@ -4393,8 +4393,8 @@ static int sculpt_brush_stroke_init(bContext *C, wmOperator *op)
SculptSession *ss = CTX_data_active_object(C)->sculpt; SculptSession *ss = CTX_data_active_object(C)->sculpt;
Brush *brush = BKE_paint_brush(&sd->paint); Brush *brush = BKE_paint_brush(&sd->paint);
int mode = RNA_enum_get(op->ptr, "mode"); int mode = RNA_enum_get(op->ptr, "mode");
int is_smooth = 0; bool is_smooth;
int need_mask = false; bool need_mask = false;
if (brush->sculpt_tool == SCULPT_TOOL_MASK) { if (brush->sculpt_tool == SCULPT_TOOL_MASK) {
need_mask = true; need_mask = true;

@ -402,8 +402,8 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
DerivedMesh *dm; DerivedMesh *dm;
SculptSession *ss = ob->sculpt; SculptSession *ss = ob->sculpt;
SculptUndoNode *unode; SculptUndoNode *unode;
int update = false, rebuild = false; bool update = false, rebuild = false;
int need_mask = false; bool need_mask = false;
for (unode = lb->first; unode; unode = unode->next) { for (unode = lb->first; unode; unode = unode->next) {
if (strcmp(unode->idname, ob->id.name) == 0) { if (strcmp(unode->idname, ob->id.name) == 0) {

@ -3501,9 +3501,10 @@ void CLIP_OT_stabilize_2d_set_rotation(wmOperatorType *ot)
/********************** clean tracks operator *********************/ /********************** clean tracks operator *********************/
static int is_track_clean(MovieTrackingTrack *track, int frames, int del) static bool is_track_clean(MovieTrackingTrack *track, int frames, int del)
{ {
int ok = 1, a, prev = -1, count = 0; bool ok = true;
int a, prev = -1, count = 0;
MovieTrackingMarker *markers = track->markers, *new_markers = NULL; MovieTrackingMarker *markers = track->markers, *new_markers = NULL;
int start_disabled = 0; int start_disabled = 0;
int markersnr = track->markersnr; int markersnr = track->markersnr;

@ -554,7 +554,7 @@ static int console_delete_exec(bContext *C, wmOperator *op)
int stride; int stride;
const short type = RNA_enum_get(op->ptr, "type"); const short type = RNA_enum_get(op->ptr, "type");
int done = false; bool done = false;
if (ci->len == 0) { if (ci->len == 0) {
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;

@ -127,7 +127,7 @@ static void clamp_to_filelist(int numfiles, FileSelection *sel)
} }
} }
static FileSelection file_selection_get(bContext *C, const rcti *rect, short fill) static FileSelection file_selection_get(bContext *C, const rcti *rect, bool fill)
{ {
ARegion *ar = CTX_wm_region(C); ARegion *ar = CTX_wm_region(C);
SpaceFile *sfile = CTX_wm_space_file(C); SpaceFile *sfile = CTX_wm_space_file(C);
@ -155,7 +155,7 @@ static FileSelection file_selection_get(bContext *C, const rcti *rect, short fil
return sel; return sel;
} }
static FileSelect file_select_do(bContext *C, int selected_idx, short do_diropen) static FileSelect file_select_do(bContext *C, int selected_idx, bool do_diropen)
{ {
FileSelect retval = FILE_SELECT_NOTHING; FileSelect retval = FILE_SELECT_NOTHING;
SpaceFile *sfile = CTX_wm_space_file(C); SpaceFile *sfile = CTX_wm_space_file(C);
@ -205,7 +205,7 @@ static FileSelect file_select_do(bContext *C, int selected_idx, short do_diropen
} }
static FileSelect file_select(bContext *C, const rcti *rect, FileSelType select, short fill, short do_diropen) static FileSelect file_select(bContext *C, const rcti *rect, FileSelType select, bool fill, bool do_diropen)
{ {
SpaceFile *sfile = CTX_wm_space_file(C); SpaceFile *sfile = CTX_wm_space_file(C);
FileSelect retval = FILE_SELECT_NOTHING; FileSelect retval = FILE_SELECT_NOTHING;

@ -2320,7 +2320,7 @@ static int graph_fmodifier_copy_exec(bContext *C, wmOperator *op)
{ {
bAnimContext ac; bAnimContext ac;
bAnimListElem *ale; bAnimListElem *ale;
short ok = 0; bool ok = false;
/* get editor data */ /* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0) if (ANIM_animdata_get_context(C, &ac) == 0)

@ -839,7 +839,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, int color_man
const bool is_render_out = (id && GS(id->name) == ID_SCE); const bool is_render_out = (id && GS(id->name) == ID_SCE);
uiLayout *col, *row, *split, *sub; uiLayout *col, *row, *split, *sub;
int show_preview = false; bool show_preview = false;
col = uiLayoutColumn(layout, false); col = uiLayoutColumn(layout, false);

@ -157,7 +157,7 @@ static int space_image_file_exists_poll(bContext *C)
SpaceImage *sima = CTX_wm_space_image(C); SpaceImage *sima = CTX_wm_space_image(C);
ImBuf *ibuf; ImBuf *ibuf;
void *lock; void *lock;
int ret = false; bool ret = false;
char name[FILE_MAX]; char name[FILE_MAX];
ibuf = ED_space_image_acquire_buffer(sima, &lock); ibuf = ED_space_image_acquire_buffer(sima, &lock);

@ -922,7 +922,7 @@ static uiBlock *controller_state_mask_menu(bContext *C, ARegion *ar, void *arg_c
return block; return block;
} }
static int is_sensor_linked(uiBlock *block, bSensor *sens) static bool is_sensor_linked(uiBlock *block, bSensor *sens)
{ {
bController *cont; bController *cont;
int i; int i;

@ -110,7 +110,7 @@ static int nlaedit_enable_tweakmode_exec(bContext *C, wmOperator *op)
ListBase anim_data = {NULL, NULL}; ListBase anim_data = {NULL, NULL};
bAnimListElem *ale; bAnimListElem *ale;
int filter; int filter;
int ok = 0; bool ok = false;
/* get editor data */ /* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0) if (ANIM_animdata_get_context(C, &ac) == 0)
@ -131,7 +131,7 @@ static int nlaedit_enable_tweakmode_exec(bContext *C, wmOperator *op)
AnimData *adt = ale->data; AnimData *adt = ale->data;
/* try entering tweakmode if valid */ /* try entering tweakmode if valid */
ok += BKE_nla_tweakmode_enter(adt); ok |= BKE_nla_tweakmode_enter(adt);
} }
/* free temp data */ /* free temp data */
@ -527,7 +527,7 @@ static int nlaedit_add_transition_exec(bContext *C, wmOperator *op)
bAnimListElem *ale; bAnimListElem *ale;
int filter; int filter;
int done = false; bool done = false;
/* get editor data */ /* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0) if (ANIM_animdata_get_context(C, &ac) == 0)
@ -595,7 +595,7 @@ static int nlaedit_add_transition_exec(bContext *C, wmOperator *op)
BKE_nlastrip_validate_name(adt, strip); BKE_nlastrip_validate_name(adt, strip);
/* make note of this */ /* make note of this */
done++; done = true;
} }
} }
@ -2087,7 +2087,8 @@ static int nla_fmodifier_copy_exec(bContext *C, wmOperator *op)
bAnimContext ac; bAnimContext ac;
ListBase anim_data = {NULL, NULL}; ListBase anim_data = {NULL, NULL};
bAnimListElem *ale; bAnimListElem *ale;
int filter, ok = 0; int filter;
bool ok = false;
/* get editor data */ /* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0) if (ANIM_animdata_get_context(C, &ac) == 0)
@ -2111,7 +2112,7 @@ static int nla_fmodifier_copy_exec(bContext *C, wmOperator *op)
continue; continue;
// TODO: when 'active' vs 'all' boolean is added, change last param! // TODO: when 'active' vs 'all' boolean is added, change last param!
ok += ANIM_fmodifiers_copy_to_buf(&strip->modifiers, 0); ok |= ANIM_fmodifiers_copy_to_buf(&strip->modifiers, 0);
} }
} }

@ -2323,9 +2323,9 @@ static int node_shader_script_update_poll(bContext *C)
} }
/* recursively check for script nodes in groups using this text and update */ /* recursively check for script nodes in groups using this text and update */
static int node_shader_script_update_text_recursive(RenderEngine *engine, RenderEngineType *type, bNodeTree *ntree, Text *text) static bool node_shader_script_update_text_recursive(RenderEngine *engine, RenderEngineType *type, bNodeTree *ntree, Text *text)
{ {
int found = false; bool found = false;
bNode *node; bNode *node;
ntree->done = true; ntree->done = true;
@ -2356,7 +2356,7 @@ static int node_shader_script_update_exec(bContext *C, wmOperator *op)
bNode *node = NULL; bNode *node = NULL;
RenderEngine *engine; RenderEngine *engine;
RenderEngineType *type; RenderEngineType *type;
int found = false; bool found = false;
/* setup render engine */ /* setup render engine */
type = RE_engines_find(scene->r.engine); type = RE_engines_find(scene->r.engine);

@ -684,7 +684,7 @@ static void node_group_make_insert_selected(const bContext *C, bNodeTree *ntree,
ListBase anim_basepaths = {NULL, NULL}; ListBase anim_basepaths = {NULL, NULL};
float min[2], max[2], center[2]; float min[2], max[2], center[2];
int totselect; int totselect;
int expose_all = false; bool expose_all = false;
bNode *input_node, *output_node; bNode *input_node, *output_node;
/* XXX rough guess, not nice but we don't have access to UI constants here ... */ /* XXX rough guess, not nice but we don't have access to UI constants here ... */
@ -831,7 +831,7 @@ static void node_group_make_insert_selected(const bContext *C, bNodeTree *ntree,
if (node_group_make_use_node(node, gnode)) { if (node_group_make_use_node(node, gnode)) {
for (sock = node->inputs.first; sock; sock = sock->next) { for (sock = node->inputs.first; sock; sock = sock->next) {
bNodeSocket *iosock, *input_sock; bNodeSocket *iosock, *input_sock;
int skip = false; bool skip = false;
for (link = ngroup->links.first; link; link = link->next) { for (link = ngroup->links.first; link; link = link->next) {
if (link->tosock == sock) { if (link->tosock == sock) {
skip = true; skip = true;
@ -852,7 +852,7 @@ static void node_group_make_insert_selected(const bContext *C, bNodeTree *ntree,
for (sock = node->outputs.first; sock; sock = sock->next) { for (sock = node->outputs.first; sock; sock = sock->next) {
bNodeSocket *iosock, *output_sock; bNodeSocket *iosock, *output_sock;
int skip = false; bool skip = false;
for (link = ngroup->links.first; link; link = link->next) for (link = ngroup->links.first; link; link = link->next)
if (link->fromsock == sock) if (link->fromsock == sock)
skip = true; skip = true;

@ -206,7 +206,7 @@ static void snode_autoconnect(SpaceNode *snode, const bool allow_multiple, const
for (nli = nodelist->first; nli; nli = nli->next) { for (nli = nodelist->first; nli; nli = nli->next) {
bNode *node_fr, *node_to; bNode *node_fr, *node_to;
bNodeSocket *sock_fr, *sock_to; bNodeSocket *sock_fr, *sock_to;
int has_selected_inputs = 0; bool has_selected_inputs = false;
if (nli->next == NULL) break; if (nli->next == NULL) break;
@ -770,7 +770,7 @@ static int cut_links_exec(bContext *C, wmOperator *op)
RNA_END; RNA_END;
if (i > 1) { if (i > 1) {
int found = false; bool found = false;
bNodeLink *link, *next; bNodeLink *link, *next;
ED_preview_kill_jobs(C); ED_preview_kill_jobs(C);

@ -425,7 +425,7 @@ bool ED_space_node_color_sample(SpaceNode *snode, ARegion *ar, int mval[2], floa
Image *ima; Image *ima;
ImBuf *ibuf; ImBuf *ibuf;
float fx, fy, bufx, bufy; float fx, fy, bufx, bufy;
int ret = false; bool ret = false;
if (STREQ(snode->tree_idname, ntreeType_Composite->idname) || (snode->flag & SNODE_BACKDRAW) == 0) { if (STREQ(snode->tree_idname, ntreeType_Composite->idname) || (snode->flag & SNODE_BACKDRAW) == 0) {
/* use viewer image for color sampling only if we're in compositor tree /* use viewer image for color sampling only if we're in compositor tree

@ -893,7 +893,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
/* add color */ /* add color */
static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{ {
short is_type_set = RNA_struct_property_is_set(op->ptr, "type"); bool is_type_set = RNA_struct_property_is_set(op->ptr, "type");
int type = -1; int type = -1;
int prop_flag = SEQPROP_ENDFRAME; int prop_flag = SEQPROP_ENDFRAME;

@ -918,7 +918,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
GLuint last_texid; GLuint last_texid;
void *display_buffer; void *display_buffer;
void *cache_handle = NULL; void *cache_handle = NULL;
const int is_imbuf = ED_space_sequencer_check_show_imbuf(sseq); const bool is_imbuf = ED_space_sequencer_check_show_imbuf(sseq);
int format, type; int format, type;
bool glsl_used = false; bool glsl_used = false;

@ -3168,7 +3168,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
Editing *ed = BKE_sequencer_editing_get(scene, false); Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq = BKE_sequencer_active_get(scene); Sequence *seq = BKE_sequencer_active_get(scene);
const int is_relative_path = RNA_boolean_get(op->ptr, "relative_path"); const bool is_relative_path = RNA_boolean_get(op->ptr, "relative_path");
if (seq->type == SEQ_TYPE_IMAGE) { if (seq->type == SEQ_TYPE_IMAGE) {
char directory[FILE_MAX]; char directory[FILE_MAX];

@ -952,7 +952,7 @@ static bool select_grouped_type_basic(Editing *ed, Sequence *actseq)
{ {
Sequence *seq; Sequence *seq;
bool changed = false; bool changed = false;
short is_sound = SEQ_IS_SOUND(actseq); const bool is_sound = SEQ_IS_SOUND(actseq);
SEQP_BEGIN (ed, seq) SEQP_BEGIN (ed, seq)
{ {

@ -2845,7 +2845,7 @@ static int text_insert_exec(bContext *C, wmOperator *op)
SpaceText *st = CTX_wm_space_text(C); SpaceText *st = CTX_wm_space_text(C);
Text *text = CTX_data_edit_text(C); Text *text = CTX_data_edit_text(C);
char *str; char *str;
int done = false; bool done = false;
size_t i = 0; size_t i = 0;
unsigned int code; unsigned int code;

@ -222,7 +222,7 @@ static void ruler_item_active_set(RulerInfo *ruler_info, RulerItem *ruler_item)
static void ruler_item_as_string(RulerItem *ruler_item, UnitSettings *unit, static void ruler_item_as_string(RulerItem *ruler_item, UnitSettings *unit,
char *numstr, size_t numstr_size, int prec) char *numstr, size_t numstr_size, int prec)
{ {
const int do_split = unit->flag & USER_UNIT_OPT_SPLIT; const bool do_split = (unit->flag & USER_UNIT_OPT_SPLIT) != 0;
if (ruler_item->flag & RULERITEM_USE_ANGLE) { if (ruler_item->flag & RULERITEM_USE_ANGLE) {
const float ruler_angle = angle_v3v3v3(ruler_item->co[0], const float ruler_angle = angle_v3v3v3(ruler_item->co[0],

@ -1388,7 +1388,7 @@ static bool mouse_select(bContext *C, const int mval[2],
Base *base, *startbase = NULL, *basact = NULL, *oldbasact = NULL; Base *base, *startbase = NULL, *basact = NULL, *oldbasact = NULL;
bool is_obedit; bool is_obedit;
float dist = ED_view3d_select_dist_px() * 1.3333f; float dist = ED_view3d_select_dist_px() * 1.3333f;
int retval = false; bool retval = false;
short hits; short hits;
const float mval_fl[2] = {(float)mval[0], (float)mval[1]}; const float mval_fl[2] = {(float)mval[0], (float)mval[1]};

@ -413,7 +413,7 @@ static void bundle_midpoint(Scene *scene, Object *ob, float vec[3])
MovieClip *clip = BKE_object_movieclip_get(scene, ob, false); MovieClip *clip = BKE_object_movieclip_get(scene, ob, false);
MovieTracking *tracking; MovieTracking *tracking;
MovieTrackingObject *object; MovieTrackingObject *object;
int ok = 0; bool ok = false;
float min[3], max[3], mat[4][4], pos[3], cammat[4][4] = MAT4_UNITY; float min[3], max[3], mat[4][4], pos[3], cammat[4][4] = MAT4_UNITY;
if (!clip) if (!clip)

@ -2584,7 +2584,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
bConstraintTypeInfo *cti = BKE_get_constraint_typeinfo(CONSTRAINT_TYPE_ROTLIMIT); bConstraintTypeInfo *cti = BKE_get_constraint_typeinfo(CONSTRAINT_TYPE_ROTLIMIT);
bConstraintOb cob; bConstraintOb cob;
bConstraint *con; bConstraint *con;
int do_limit = false; bool do_limit = false;
/* Evaluate valid constraints */ /* Evaluate valid constraints */
for (con = td->con; con; con = con->next) { for (con = td->con; con; con = con->next) {
@ -4107,7 +4107,8 @@ static void headerTranslation(TransInfo *t, float vec[3], char str[MAX_INFO_LEN]
dist = len_v3(vec); dist = len_v3(vec);
if (!(t->flag & T_2D_EDIT) && t->scene->unit.system) { if (!(t->flag & T_2D_EDIT) && t->scene->unit.system) {
int i, do_split = t->scene->unit.flag & USER_UNIT_OPT_SPLIT ? 1 : 0; const bool do_split = (t->scene->unit.flag & USER_UNIT_OPT_SPLIT) != 0;
int i;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
bUnit_AsString(&tvec[NUM_STR_REP_LEN * i], NUM_STR_REP_LEN, dvec[i] * t->scene->unit.scale_length, bUnit_AsString(&tvec[NUM_STR_REP_LEN * i], NUM_STR_REP_LEN, dvec[i] * t->scene->unit.scale_length,
@ -4121,13 +4122,18 @@ static void headerTranslation(TransInfo *t, float vec[3], char str[MAX_INFO_LEN]
} }
} }
if (!(t->flag & T_2D_EDIT) && t->scene->unit.system) if (!(t->flag & T_2D_EDIT) && t->scene->unit.system) {
const bool do_split = (t->scene->unit.flag & USER_UNIT_OPT_SPLIT) != 0;
bUnit_AsString(distvec, sizeof(distvec), dist * t->scene->unit.scale_length, 4, t->scene->unit.system, bUnit_AsString(distvec, sizeof(distvec), dist * t->scene->unit.scale_length, 4, t->scene->unit.system,
B_UNIT_LENGTH, t->scene->unit.flag & USER_UNIT_OPT_SPLIT, false); B_UNIT_LENGTH, do_split, false);
else if (dist > 1e10f || dist < -1e10f) /* prevent string buffer overflow */ }
else if (dist > 1e10f || dist < -1e10f) {
/* prevent string buffer overflow */
BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4e", dist); BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4e", dist);
else }
else {
BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4f", dist); BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4f", dist);
}
if (t->flag & T_AUTOIK) { if (t->flag & T_AUTOIK) {
short chainlen = t->settings->autoik_chainlen; short chainlen = t->settings->autoik_chainlen;
@ -4571,7 +4577,8 @@ static void applyMaskShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
{ {
TransData *td; TransData *td;
float ratio; float ratio;
int i, initial_feather = false; int i;
bool initial_feather = false;
char str[MAX_INFO_LEN]; char str[MAX_INFO_LEN];
ratio = t->values[0]; ratio = t->values[0];

@ -6596,7 +6596,7 @@ static void MaskHandleToTransData(MaskSplinePoint *point, eMaskWhichHandle which
/*const*/ float parent_inverse_matrix[3][3]) /*const*/ float parent_inverse_matrix[3][3])
{ {
BezTriple *bezt = &point->bezt; BezTriple *bezt = &point->bezt;
short is_sel_any = MASKPOINT_ISSEL_ANY(point); const bool is_sel_any = MASKPOINT_ISSEL_ANY(point);
tdm->point = point; tdm->point = point;
copy_m3_m3(tdm->vec, bezt->vec); copy_m3_m3(tdm->vec, bezt->vec);

@ -505,7 +505,7 @@ int calc_manipulator_stats(const bContext *C)
else if (ob && (ob->mode & OB_MODE_POSE)) { else if (ob && (ob->mode & OB_MODE_POSE)) {
bPoseChannel *pchan; bPoseChannel *pchan;
int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed
int ok = false; bool ok = false;
if ((ob->lay & v3d->lay) == 0) return 0; if ((ob->lay & v3d->lay) == 0) return 0;

@ -858,7 +858,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
bArmature *arm = ob->data; bArmature *arm = ob->data;
bPoseChannel *pchan; bPoseChannel *pchan;
float imat[3][3], mat[3][3]; float imat[3][3], mat[3][3];
int ok = false; bool ok = false;
if (activeOnly && (pchan = BKE_pose_channel_active(ob))) { if (activeOnly && (pchan = BKE_pose_channel_active(ob))) {
add_v3_v3(normal, pchan->pose_mat[2]); add_v3_v3(normal, pchan->pose_mat[2]);

@ -1684,7 +1684,7 @@ typedef struct UVvert {
static int uv_remove_doubles_exec(bContext *C, wmOperator *op) static int uv_remove_doubles_exec(bContext *C, wmOperator *op)
{ {
const float threshold = RNA_float_get(op->ptr, "threshold"); const float threshold = RNA_float_get(op->ptr, "threshold");
const int use_unselected = RNA_boolean_get(op->ptr, "use_unselected"); const bool use_unselected = RNA_boolean_get(op->ptr, "use_unselected");
SpaceImage *sima; SpaceImage *sima;
Scene *scene; Scene *scene;

@ -105,8 +105,8 @@ typedef struct GPUNodeStack {
const char *name; const char *name;
float vec[4]; float vec[4];
struct GPUNodeLink *link; struct GPUNodeLink *link;
short hasinput; bool hasinput;
short hasoutput; bool hasoutput;
short sockettype; short sockettype;
} GPUNodeStack; } GPUNodeStack;

@ -261,7 +261,7 @@ void GPU_set_gpu_mipmapping(int gpu_mipmap)
static void gpu_generate_mipmap(GLenum target) static void gpu_generate_mipmap(GLenum target)
{ {
int is_ati = GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_ANY); const bool is_ati = GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_ANY);
int target_enabled = 0; int target_enabled = 0;
/* work around bug in ATI driver, need to have GL_TEXTURE_2D enabled /* work around bug in ATI driver, need to have GL_TEXTURE_2D enabled
@ -1040,7 +1040,7 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h)
/* if color correction is needed, we must update the part that needs updating. */ /* if color correction is needed, we must update the part that needs updating. */
if (ibuf->rect_float) { if (ibuf->rect_float) {
float *buffer = MEM_mallocN(w*h*sizeof(float)*4, "temp_texpaint_float_buf"); float *buffer = MEM_mallocN(w*h*sizeof(float)*4, "temp_texpaint_float_buf");
int is_data = (ima->tpageflag & IMA_GLBIND_IS_DATA); bool is_data = (ima->tpageflag & IMA_GLBIND_IS_DATA) != 0;
IMB_partial_rect_from_float(ibuf, buffer, x, y, w, h, is_data); IMB_partial_rect_from_float(ibuf, buffer, x, y, w, h, is_data);
if (GPU_check_scaled_image(ibuf, ima, buffer, x, y, w, h)) { if (GPU_check_scaled_image(ibuf, ima, buffer, x, y, w, h)) {

@ -379,7 +379,7 @@ void IMB_interlace(struct ImBuf *ibuf);
void IMB_rect_from_float(struct ImBuf *ibuf); void IMB_rect_from_float(struct ImBuf *ibuf);
/* Create char buffer for part of the image, color corrected if necessary, /* Create char buffer for part of the image, color corrected if necessary,
* Changed part will be stored in buffer. This is expected to be used for texture painting updates */ * Changed part will be stored in buffer. This is expected to be used for texture painting updates */
void IMB_partial_rect_from_float(struct ImBuf *ibuf, float *buffer, int x, int y, int w, int h, int is_data); void IMB_partial_rect_from_float(struct ImBuf *ibuf, float *buffer, int x, int y, int w, int h, bool is_data);
void IMB_float_from_rect(struct ImBuf *ibuf); void IMB_float_from_rect(struct ImBuf *ibuf);
void IMB_color_to_bw(struct ImBuf *ibuf); void IMB_color_to_bw(struct ImBuf *ibuf);
void IMB_saturation(struct ImBuf *ibuf, float sat); void IMB_saturation(struct ImBuf *ibuf, float sat);

@ -565,7 +565,7 @@ void IMB_rect_from_float(ImBuf *ibuf)
} }
/* converts from linear float to sRGB byte for part of the texture, buffer will hold the changed part */ /* converts from linear float to sRGB byte for part of the texture, buffer will hold the changed part */
void IMB_partial_rect_from_float(ImBuf *ibuf, float *buffer, int x, int y, int w, int h, int is_data) void IMB_partial_rect_from_float(ImBuf *ibuf, float *buffer, int x, int y, int w, int h, bool is_data)
{ {
float *rect_float; float *rect_float;
uchar *rect_byte; uchar *rect_byte;

@ -333,7 +333,7 @@ static int filter_make_index(const int x, const int y, const int w, const int h)
else return y * w + x; else return y * w + x;
} }
static int check_pixel_assigned(const void *buffer, const char *mask, const int index, const int depth, const int is_float) static int check_pixel_assigned(const void *buffer, const char *mask, const int index, const int depth, const bool is_float)
{ {
int res = 0; int res = 0;
@ -364,7 +364,7 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter)
const int depth = 4; /* always 4 channels */ const int depth = 4; /* always 4 channels */
const int chsize = ibuf->rect_float ? sizeof(float) : sizeof(unsigned char); const int chsize = ibuf->rect_float ? sizeof(float) : sizeof(unsigned char);
const int bsize = width * height * depth * chsize; const int bsize = width * height * depth * chsize;
const int is_float = ibuf->rect_float != NULL; const bool is_float = (ibuf->rect_float != NULL);
void *dstbuf = (void *) MEM_dupallocN(ibuf->rect_float ? (void *) ibuf->rect_float : (void *) ibuf->rect); void *dstbuf = (void *) MEM_dupallocN(ibuf->rect_float ? (void *) ibuf->rect_float : (void *) ibuf->rect);
char *dstmask = mask == NULL ? NULL : (char *) MEM_dupallocN(mask); char *dstmask = mask == NULL ? NULL : (char *) MEM_dupallocN(mask);
void *srcbuf = ibuf->rect_float ? (void *) ibuf->rect_float : (void *) ibuf->rect; void *srcbuf = ibuf->rect_float ? (void *) ibuf->rect_float : (void *) ibuf->rect;

@ -117,7 +117,7 @@ static int tga_out4(unsigned int data, FILE *file)
return ~EOF; return ~EOF;
} }
static short makebody_tga(ImBuf *ibuf, FILE *file, int (*out)(unsigned int, FILE *)) static bool makebody_tga(ImBuf *ibuf, FILE *file, int (*out)(unsigned int, FILE *))
{ {
register int last, this; register int last, this;
register int copy, bytes; register int copy, bytes;
@ -196,7 +196,7 @@ static short makebody_tga(ImBuf *ibuf, FILE *file, int (*out)(unsigned int, FILE
return 1; return 1;
} }
static int dumptarga(struct ImBuf *ibuf, FILE *file) static bool dumptarga(struct ImBuf *ibuf, FILE *file)
{ {
int size; int size;
uchar *rect; uchar *rect;
@ -253,7 +253,7 @@ int imb_savetarga(struct ImBuf *ibuf, const char *name, int flags)
{ {
char buf[20] = {0}; char buf[20] = {0};
FILE *fildes; FILE *fildes;
short ok = 0; bool ok = false;
(void)flags; /* unused */ (void)flags; /* unused */

@ -2156,7 +2156,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
PropertyType type; PropertyType type;
const char *funcname, *valstr; const char *funcname, *valstr;
const char *ptrstr; const char *ptrstr;
const short has_data = (dfunc->cont.properties.first != NULL); const bool has_data = (dfunc->cont.properties.first != NULL);
int flag, pout, cptr, first; int flag, pout, cptr, first;
srna = dsrna->srna; srna = dsrna->srna;

@ -83,7 +83,7 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
for (i = 0; i < seq_size; i++) { for (i = 0; i < seq_size; i++) {
Py_ssize_t item_seq_size; Py_ssize_t item_seq_size;
PyObject *item; PyObject *item;
int ok = 1; bool ok = true;
item = PySequence_GetItem(seq, i); item = PySequence_GetItem(seq, i);
if (item == NULL) { if (item == NULL) {

@ -3360,7 +3360,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
if ( mface->mat_nr==a1 ) { if ( mface->mat_nr==a1 ) {
float len; float len;
int reverse_verts = (negative_scale != 0 && do_autosmooth == false); bool reverse_verts = (negative_scale != 0 && do_autosmooth == false);
int rev_tab[] = {reverse_verts==0 ? 0 : 2, 1, reverse_verts==0 ? 2 : 0, 3}; int rev_tab[] = {reverse_verts==0 ? 0 : 2, 1, reverse_verts==0 ? 2 : 0, 3};
v1= reverse_verts==0 ? mface->v1 : mface->v3; v1= reverse_verts==0 ? mface->v1 : mface->v3;
v2= mface->v2; v2= mface->v2;