Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-04-01 04:34:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-01 08:22:28 +0400
commit617557b08ea94e2b65a1697ddf0b79651204d92b (patch)
tree50b24bab075b42fa20456140c9a9681cfb01325b /source/blender/blenkernel/intern
parent2c00ecc738c04dc5dc22d4a6b81a1e937526ba6d (diff)
Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c8
-rw-r--r--source/blender/blenkernel/intern/action.c18
-rw-r--r--source/blender/blenkernel/intern/addon.c2
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c16
-rw-r--r--source/blender/blenkernel/intern/armature.c38
-rw-r--r--source/blender/blenkernel/intern/blender.c4
-rw-r--r--source/blender/blenkernel/intern/brush.c10
-rw-r--r--source/blender/blenkernel/intern/camera.c14
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c35
-rw-r--r--source/blender/blenkernel/intern/colortools.c6
-rw-r--r--source/blender/blenkernel/intern/constraint.c84
-rw-r--r--source/blender/blenkernel/intern/context.c12
-rw-r--r--source/blender/blenkernel/intern/curve.c42
-rw-r--r--source/blender/blenkernel/intern/deform.c4
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c12
-rw-r--r--source/blender/blenkernel/intern/displist.c2
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c4
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c5
-rw-r--r--source/blender/blenkernel/intern/fcurve.c29
-rw-r--r--source/blender/blenkernel/intern/font.c4
-rw-r--r--source/blender/blenkernel/intern/group.c14
-rw-r--r--source/blender/blenkernel/intern/idprop.c4
-rw-r--r--source/blender/blenkernel/intern/image.c71
-rw-r--r--source/blender/blenkernel/intern/key.c8
-rw-r--r--source/blender/blenkernel/intern/lamp.c8
-rw-r--r--source/blender/blenkernel/intern/lattice.c20
-rw-r--r--source/blender/blenkernel/intern/mask_rasterize.c2
-rw-r--r--source/blender/blenkernel/intern/material.c47
-rw-r--r--source/blender/blenkernel/intern/mball.c16
-rw-r--r--source/blender/blenkernel/intern/mesh.c30
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c86
-rw-r--r--source/blender/blenkernel/intern/modifiers_bmesh.c2
-rw-r--r--source/blender/blenkernel/intern/movieclip.c12
-rw-r--r--source/blender/blenkernel/intern/multires.c4
-rw-r--r--source/blender/blenkernel/intern/node.c58
-rw-r--r--source/blender/blenkernel/intern/object.c46
-rw-r--r--source/blender/blenkernel/intern/object_deform.c6
-rw-r--r--source/blender/blenkernel/intern/ocean.c2
-rw-r--r--source/blender/blenkernel/intern/packedFile.c7
-rw-r--r--source/blender/blenkernel/intern/paint.c8
-rw-r--r--source/blender/blenkernel/intern/particle.c16
-rw-r--r--source/blender/blenkernel/intern/pbvh.c4
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c30
-rw-r--r--source/blender/blenkernel/intern/pointcache.c25
-rw-r--r--source/blender/blenkernel/intern/report.c6
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c6
-rw-r--r--source/blender/blenkernel/intern/scene.c4
-rw-r--r--source/blender/blenkernel/intern/screen.c2
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c4
-rw-r--r--source/blender/blenkernel/intern/sequencer.c4
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c2
-rw-r--r--source/blender/blenkernel/intern/smoke.c6
-rw-r--r--source/blender/blenkernel/intern/softbody.c2
-rw-r--r--source/blender/blenkernel/intern/speaker.c8
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c2
-rw-r--r--source/blender/blenkernel/intern/text.c30
-rw-r--r--source/blender/blenkernel/intern/texture.c37
-rw-r--r--source/blender/blenkernel/intern/tracking.c4
-rw-r--r--source/blender/blenkernel/intern/tracking_solver.c2
-rw-r--r--source/blender/blenkernel/intern/tracking_stabilize.c4
-rw-r--r--source/blender/blenkernel/intern/unit.c2
-rw-r--r--source/blender/blenkernel/intern/world.c12
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c14
-rw-r--r--source/blender/blenkernel/intern/writeframeserver.c2
64 files changed, 521 insertions, 507 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index b4a2dab8b1e..4e9df194f40 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1115,7 +1115,7 @@ static void calc_weightpaint_vert_color(
if (was_a_nonzero == false) {
show_alert_color = true;
}
- else if ((draw_flag & CALC_WP_AUTO_NORMALIZE) == FALSE) {
+ else if ((draw_flag & CALC_WP_AUTO_NORMALIZE) == false) {
input /= defbase_sel_tot; /* get the average */
}
}
@@ -1402,7 +1402,7 @@ static void dm_ensure_display_normals(DerivedMesh *dm)
BLI_assert(CustomData_has_layer(&dm->polyData, CD_NORMAL) == false);
if ((dm->type == DM_TYPE_CDDM) &&
- ((dm->dirty & DM_DIRTY_NORMALS) || CustomData_has_layer(&dm->faceData, CD_NORMAL) == FALSE))
+ ((dm->dirty & DM_DIRTY_NORMALS) || CustomData_has_layer(&dm->faceData, CD_NORMAL) == false))
{
/* if normals are dirty we want to calculate vertex normals too */
CDDM_calc_normals_mapping_ex(dm, (dm->dirty & DM_DIRTY_NORMALS) ? false : true);
@@ -1442,7 +1442,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
#if 0 /* XXX Will re-enable this when we have global mod stack options. */
const bool do_final_wmcol = (scene->toolsettings->weights_preview == WP_WPREVIEW_FINAL) && do_wmcol;
#endif
- const bool do_final_wmcol = FALSE;
+ const bool do_final_wmcol = false;
const bool do_init_wmcol = ((dataMask & CD_MASK_PREVIEW_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT) && !do_final_wmcol);
/* XXX Same as above... For now, only weights preview in WPaint mode. */
const bool do_mod_wmcol = do_init_wmcol;
@@ -1968,7 +1968,7 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
#if 0 /* XXX Will re-enable this when we have global mod stack options. */
const bool do_final_wmcol = (scene->toolsettings->weights_preview == WP_WPREVIEW_FINAL) && do_wmcol;
#endif
- const bool do_final_wmcol = FALSE;
+ const bool do_final_wmcol = false;
const bool do_init_wmcol = ((((Mesh *)ob->data)->drawflag & ME_DRAWEIGHT) && !do_final_wmcol);
const bool do_init_statvis = ((((Mesh *)ob->data)->drawflag & ME_DRAW_STATVIS) && !do_init_wmcol);
const bool do_mod_wmcol = do_init_wmcol;
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 3a32cad0873..d5efa09bdc9 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -96,8 +96,8 @@ typedef struct tMakeLocalActionContext {
bAction *act; /* original action */
bAction *act_new; /* new action */
- int is_lib; /* some action users were libraries */
- int is_local; /* some action users were not libraries */
+ bool is_lib; /* some action users were libraries */
+ bool is_local; /* some action users were not libraries */
} tMakeLocalActionContext;
/* helper function for BKE_action_make_local() - local/lib init step */
@@ -106,8 +106,8 @@ static void make_localact_init_cb(ID *id, AnimData *adt, void *mlac_ptr)
tMakeLocalActionContext *mlac = (tMakeLocalActionContext *)mlac_ptr;
if (adt->action == mlac->act) {
- if (id->lib) mlac->is_lib = TRUE;
- else mlac->is_local = TRUE;
+ if (id->lib) mlac->is_lib = true;
+ else mlac->is_local = true;
}
}
@@ -129,7 +129,7 @@ static void make_localact_apply_cb(ID *id, AnimData *adt, void *mlac_ptr)
// does copy_fcurve...
void BKE_action_make_local(bAction *act)
{
- tMakeLocalActionContext mlac = {act, NULL, FALSE, FALSE};
+ tMakeLocalActionContext mlac = {act, NULL, false, false};
Main *bmain = G.main;
if (act->id.lib == NULL)
@@ -143,7 +143,7 @@ void BKE_action_make_local(bAction *act)
BKE_animdata_main_cb(bmain, make_localact_init_cb, &mlac);
- if (mlac.is_local && mlac.is_lib == FALSE) {
+ if (mlac.is_local && mlac.is_lib == false) {
id_clear_lib_data(bmain, &act->id);
}
else if (mlac.is_local && mlac.is_lib) {
@@ -604,7 +604,7 @@ void BKE_pose_copy_data(bPose **dst, bPose *src, const bool copy_constraints)
for (pchan = outPose->chanbase.first; pchan; pchan = pchan->next) {
if (copy_constraints) {
- BKE_copy_constraints(&listb, &pchan->constraints, TRUE); // BKE_copy_constraints NULLs listb
+ BKE_copy_constraints(&listb, &pchan->constraints, true); // BKE_copy_constraints NULLs listb
pchan->constraints = listb;
pchan->mpath = NULL; /* motion paths should not get copied yet... */
}
@@ -843,7 +843,7 @@ void BKE_pose_channel_copy_data(bPoseChannel *pchan, const bPoseChannel *pchan_f
pchan->iklinweight = pchan_from->iklinweight;
/* constraints */
- BKE_copy_constraints(&pchan->constraints, &pchan_from->constraints, TRUE);
+ BKE_copy_constraints(&pchan->constraints, &pchan_from->constraints, true);
/* id-properties */
if (pchan->prop) {
@@ -1037,7 +1037,7 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
/* get extents for this curve */
/* TODO: allow enabling/disabling this? */
- calc_fcurve_range(fcu, &nmin, &nmax, FALSE, TRUE);
+ calc_fcurve_range(fcu, &nmin, &nmax, false, true);
/* compare to the running tally */
min = min_ff(min, nmin);
diff --git a/source/blender/blenkernel/intern/addon.c b/source/blender/blenkernel/intern/addon.c
index 129bc4657b4..119fa266908 100644
--- a/source/blender/blenkernel/intern/addon.c
+++ b/source/blender/blenkernel/intern/addon.c
@@ -43,7 +43,7 @@
static GHash *global_addonpreftype_hash = NULL;
-bAddonPrefType *BKE_addon_pref_type_find(const char *idname, int quiet)
+bAddonPrefType *BKE_addon_pref_type_find(const char *idname, bool quiet)
{
if (idname[0]) {
bAddonPrefType *apt;
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 3088f2ccf9b..7bd5e2207a5 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1291,7 +1291,7 @@ static short animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_in
/* set value - only for animatable numerical values */
if (RNA_property_animateable(&new_ptr, prop)) {
int array_len = RNA_property_array_length(&new_ptr, prop);
- int written = FALSE;
+ bool written = false;
if (array_len && array_index >= array_len) {
if (G.debug & G_DEBUG) {
@@ -1308,13 +1308,13 @@ static short animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_in
if (array_len) {
if (RNA_property_boolean_get_index(&new_ptr, prop, array_index) != ANIMSYS_FLOAT_AS_BOOL(value)) {
RNA_property_boolean_set_index(&new_ptr, prop, array_index, ANIMSYS_FLOAT_AS_BOOL(value));
- written = TRUE;
+ written = true;
}
}
else {
if (RNA_property_boolean_get(&new_ptr, prop) != ANIMSYS_FLOAT_AS_BOOL(value)) {
RNA_property_boolean_set(&new_ptr, prop, ANIMSYS_FLOAT_AS_BOOL(value));
- written = TRUE;
+ written = true;
}
}
break;
@@ -1322,13 +1322,13 @@ static short animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_in
if (array_len) {
if (RNA_property_int_get_index(&new_ptr, prop, array_index) != (int)value) {
RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value);
- written = TRUE;
+ written = true;
}
}
else {
if (RNA_property_int_get(&new_ptr, prop) != (int)value) {
RNA_property_int_set(&new_ptr, prop, (int)value);
- written = TRUE;
+ written = true;
}
}
break;
@@ -1336,20 +1336,20 @@ static short animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_in
if (array_len) {
if (RNA_property_float_get_index(&new_ptr, prop, array_index) != value) {
RNA_property_float_set_index(&new_ptr, prop, array_index, value);
- written = TRUE;
+ written = true;
}
}
else {
if (RNA_property_float_get(&new_ptr, prop) != value) {
RNA_property_float_set(&new_ptr, prop, value);
- written = TRUE;
+ written = true;
}
}
break;
case PROP_ENUM:
if (RNA_property_enum_get(&new_ptr, prop) != (int)value) {
RNA_property_enum_set(&new_ptr, prop, (int)value);
- written = TRUE;
+ written = true;
}
break;
default:
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index afd3ae7e85d..60ec4817f81 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -137,7 +137,7 @@ void BKE_armature_free(bArmature *arm)
void BKE_armature_make_local(bArmature *arm)
{
Main *bmain = G.main;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
Object *ob;
if (arm->id.lib == NULL)
@@ -150,13 +150,13 @@ void BKE_armature_make_local(bArmature *arm)
for (ob = bmain->object.first; ob && ELEM(0, is_lib, is_local); ob = ob->id.next) {
if (ob->data == arm) {
if (ob->id.lib)
- is_lib = TRUE;
+ is_lib = true;
else
- is_local = TRUE;
+ is_local = true;
}
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &arm->id);
}
else if (is_local && is_lib) {
@@ -827,7 +827,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
const short invert_vgroup = deformflag & ARM_DEF_INVERT_VGROUP;
int defbase_tot = 0; /* safety for vertexgroup index overflow */
int i, target_totvert = 0; /* safety for vertexgroup overflow */
- int use_dverts = FALSE;
+ bool use_dverts = false;
int armature_def_nr;
int totchan;
@@ -891,7 +891,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
use_dverts = (dm->getVertDataArray(dm, CD_MDEFORMVERT) != NULL);
}
else if (dverts) {
- use_dverts = TRUE;
+ use_dverts = true;
}
if (use_dverts) {
@@ -1294,19 +1294,19 @@ void BKE_armature_mat_pose_to_bone_ex(Object *ob, bPoseChannel *pchan, float inm
/* recalculate pose matrix with only parent transformations,
* bone loc/sca/rot is ignored, scene and frame are not used. */
- BKE_pose_where_is_bone(NULL, ob, &work_pchan, 0.0f, FALSE);
+ BKE_pose_where_is_bone(NULL, ob, &work_pchan, 0.0f, false);
/* find the matrix, need to remove the bone transforms first so this is
* calculated as a matrix to set rather then a difference ontop of whats
* already there. */
unit_m4(outmat);
- BKE_pchan_apply_mat4(&work_pchan, outmat, FALSE);
+ BKE_pchan_apply_mat4(&work_pchan, outmat, false);
BKE_armature_mat_pose_to_bone(&work_pchan, inmat, outmat);
}
/* same as BKE_object_mat3_to_rot() */
-void BKE_pchan_mat3_to_rot(bPoseChannel *pchan, float mat[3][3], short use_compat)
+void BKE_pchan_mat3_to_rot(bPoseChannel *pchan, float mat[3][3], bool use_compat)
{
switch (pchan->rotmode) {
case ROT_MODE_QUAT:
@@ -1326,7 +1326,7 @@ void BKE_pchan_mat3_to_rot(bPoseChannel *pchan, float mat[3][3], short use_compa
/* Apply a 4x4 matrix to the pose bone,
* similar to BKE_object_apply_mat4() */
-void BKE_pchan_apply_mat4(bPoseChannel *pchan, float mat[4][4], short use_compat)
+void BKE_pchan_apply_mat4(bPoseChannel *pchan, float mat[4][4], bool use_compat)
{
float rot[3][3];
mat4_to_loc_rot_size(pchan->loc, rot, pchan->size, mat);
@@ -1619,7 +1619,7 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected
* we get the libs direct linked in this blend.
*/
BKE_extract_proxylocal_constraints(&proxylocal_constraints, &pchan->constraints);
- BKE_copy_constraints(&pchanw.constraints, &pchanp->constraints, FALSE);
+ BKE_copy_constraints(&pchanw.constraints, &pchanp->constraints, false);
BLI_movelisttolist(&pchanw.constraints, &proxylocal_constraints);
/* constraints - set target ob pointer to own object */
@@ -1768,7 +1768,7 @@ typedef struct tSplineIK_Tree {
int type; /* type of IK that this serves (CONSTRAINT_TYPE_KINEMATIC or ..._SPLINEIK) */
- short free_points; /* free the point positions array */
+ bool free_points; /* free the point positions array */
short chainlen; /* number of bones in the chain */
float *points; /* parametric positions for the joints along the curve */
@@ -1791,7 +1791,7 @@ static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPos
bSplineIKConstraint *ikData = NULL;
float boneLengths[255], *jointPoints;
float totLength = 0.0f;
- short free_joints = 0;
+ bool free_joints = 0;
int segcount = 0;
/* find the SplineIK constraint */
@@ -2261,13 +2261,13 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
int do_modif;
for (strip = armob->nlastrips.first; strip; strip = strip->next) {
- do_modif = FALSE;
+ do_modif = false;
if (scene_cfra >= strip->start && scene_cfra <= strip->end)
- do_modif = TRUE;
+ do_modif = true;
if ((scene_cfra > strip->end) && (strip->flag & ACTSTRIP_HOLDLASTFRAME)) {
- do_modif = TRUE;
+ do_modif = true;
/* if there are any other strips active, ignore modifiers for this strip -
* 'hold' option should only hold action modifiers if there are
@@ -2277,7 +2277,7 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
if (scene_cfra >= strip2->start && scene_cfra <= strip2->end) {
if (!(strip2->flag & ACTSTRIP_MUTE))
- do_modif = FALSE;
+ do_modif = false;
}
}
@@ -2286,7 +2286,7 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
for (strip2 = strip->next; strip2; strip2 = strip2->next) {
if (scene_cfra < strip2->start) continue;
if ((strip2->flag & ACTSTRIP_HOLDLASTFRAME) && !(strip2->flag & ACTSTRIP_MUTE)) {
- do_modif = FALSE;
+ do_modif = false;
}
}
}
@@ -2390,7 +2390,7 @@ void BKE_pose_where_is_bone_tail(bPoseChannel *pchan)
/* pchan is validated, as having bone and parent pointer
* 'do_extra': when zero skips loc/size/rot, constraints and strip modifiers.
*/
-void BKE_pose_where_is_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float ctime, int do_extra)
+void BKE_pose_where_is_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float ctime, bool do_extra)
{
/* This gives a chan_mat with actions (ipos) results. */
if (do_extra)
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index ed48bf5f3a4..9b1f2e87f9e 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -554,7 +554,7 @@ int blender_test_break(void)
blender_test_break_cb();
}
- return (G.is_break == TRUE);
+ return (G.is_break == true);
}
@@ -598,7 +598,7 @@ static int read_undosave(bContext *C, UndoElem *uel)
if (success) {
/* important not to update time here, else non keyed tranforms are lost */
- DAG_on_visible_update(G.main, FALSE);
+ DAG_on_visible_update(G.main, false);
}
return success;
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 17fdb15399f..c34b237f53e 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -212,7 +212,7 @@ void BKE_brush_make_local(Brush *brush)
Main *bmain = G.main;
Scene *scene;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
if (brush->id.lib == NULL) return;
@@ -225,12 +225,12 @@ void BKE_brush_make_local(Brush *brush)
for (scene = bmain->scene.first; scene && ELEM(0, is_lib, is_local); scene = scene->id.next) {
if (BKE_paint_brush(&scene->toolsettings->imapaint.paint) == brush) {
- if (scene->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (scene->id.lib) is_lib = true;
+ else is_local = true;
}
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &brush->id);
extern_local_brush(brush);
@@ -450,7 +450,7 @@ void BKE_brush_curve_preset(Brush *b, int preset)
b->curve->preset = preset;
curvemap_reset(cm, &b->curve->clipr, b->curve->preset, CURVEMAP_SLOPE_NEGATIVE);
- curvemapping_changed(b->curve, FALSE);
+ curvemapping_changed(b->curve, false);
}
int BKE_brush_texture_set_nr(Brush *brush, int nr)
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 1e47dc3ab53..b20ba40c0dd 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -84,7 +84,7 @@ void BKE_camera_make_local(Camera *cam)
{
Main *bmain = G.main;
Object *ob;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -99,12 +99,12 @@ void BKE_camera_make_local(Camera *cam)
for (ob = bmain->object.first; ob && ELEM(0, is_lib, is_local); ob = ob->id.next) {
if (ob->data == cam) {
- if (ob->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ob->id.lib) is_lib = true;
+ else is_local = true;
}
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &cam->id);
}
else if (is_local && is_lib) {
@@ -214,7 +214,7 @@ void BKE_camera_params_from_object(CameraParams *params, Object *ob)
Camera *cam = ob->data;
if (cam->type == CAM_ORTHO)
- params->is_ortho = TRUE;
+ params->is_ortho = true;
params->lens = cam->lens;
params->ortho_scale = cam->ortho_scale;
@@ -273,7 +273,7 @@ void BKE_camera_params_from_view3d(CameraParams *params, View3D *v3d, RegionView
params->clipend *= 0.5f; // otherwise too extreme low zbuffer quality
params->clipsta = -params->clipend;
- params->is_ortho = TRUE;
+ params->is_ortho = true;
/* make sure any changes to this match ED_view3d_radius_to_ortho_dist() */
params->ortho_scale = rv3d->dist * sensor_size / v3d->lens;
params->zoom = 2.0f;
@@ -454,7 +454,7 @@ void BKE_camera_view_frame(Scene *scene, Camera *camera, float r_vec[4][3])
float dummy_drawsize;
const float dummy_scale[3] = {1.0f, 1.0f, 1.0f};
- BKE_camera_view_frame_ex(scene, camera, FALSE, 1.0, dummy_scale,
+ BKE_camera_view_frame_ex(scene, camera, false, 1.0, dummy_scale,
dummy_asp, dummy_shift, &dummy_drawsize, r_vec);
}
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index a7940eb8f9c..64b3cf5f1d3 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -82,7 +82,7 @@ typedef struct {
/* Cached */
struct PBVH *pbvh;
- int pbvh_draw;
+ bool pbvh_draw;
/* Mesh connectivity */
MeshElemMap *pmap;
@@ -223,7 +223,7 @@ static const MeshElemMap *cdDM_getPolyMap(Object *ob, DerivedMesh *dm)
return cddm->pmap;
}
-static int can_pbvh_draw(Object *ob, DerivedMesh *dm)
+static bool can_pbvh_draw(Object *ob, DerivedMesh *dm)
{
CDDerivedMesh *cddm = (CDDerivedMesh *) dm;
Mesh *me = ob->data;
@@ -265,7 +265,7 @@ static PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
/* Sculpting on a BMesh (dynamic-topology) gets a special PBVH */
if (!cddm->pbvh && ob->sculpt->bm) {
cddm->pbvh = BKE_pbvh_new();
- cddm->pbvh_draw = TRUE;
+ cddm->pbvh_draw = true;
BKE_pbvh_build_bmesh(cddm->pbvh, ob->sculpt->bm,
ob->sculpt->bm_smooth_shading,
@@ -429,7 +429,7 @@ static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges
if (cddm->pbvh && cddm->pbvh_draw &&
BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH)
{
- BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, TRUE);
+ BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, true);
return;
}
@@ -450,7 +450,7 @@ static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges
else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
int prevstart = 0;
int prevdraw = 1;
- int draw = TRUE;
+ bool draw = true;
GPU_edge_setup(dm);
if (!GPU_buffer_legacy(dm)) {
@@ -458,10 +458,10 @@ static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges
if ((drawAllEdges || (medge->flag & ME_EDGEDRAW)) &&
(drawLooseEdges || !(medge->flag & ME_LOOSEEDGE)))
{
- draw = TRUE;
+ draw = true;
}
else {
- draw = FALSE;
+ draw = false;
}
if (prevdraw != draw) {
if (prevdraw > 0 && (i - prevstart) > 0) {
@@ -550,7 +550,7 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
float (*face_nors)[3] = CustomData_get_layer(&dm->faceData, CD_NORMAL);
BKE_pbvh_draw(cddm->pbvh, partial_redraw_planes, face_nors,
- setMaterial, FALSE);
+ setMaterial, false);
glShadeModel(GL_FLAT);
}
@@ -657,7 +657,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
if (dm->numTessFaceData) {
GPU_set_tpage(NULL, false, false);
- BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
+ BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, false);
}
return;
@@ -1136,7 +1136,8 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
MFace *mface = cddm->mface;
/* MTFace *tf = dm->getTessFaceDataArray(dm, CD_MTFACE); */ /* UNUSED */
float (*nors)[3] = dm->getTessFaceDataArray(dm, CD_NORMAL);
- int a, b, do_draw, matnr, new_matnr;
+ int a, b, matnr, new_matnr;
+ bool do_draw;
int orig;
/* double lookup */
@@ -1153,7 +1154,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
if (dm->numTessFaceData) {
setMaterial(1, &gattribs);
- BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
+ BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, false);
}
return;
@@ -1162,7 +1163,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
cdDM_update_normals_from_pbvh(dm);
matnr = -1;
- do_draw = FALSE;
+ do_draw = false;
glShadeModel(GL_SMOOTH);
@@ -1479,7 +1480,7 @@ static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
if (dm->numTessFaceData) {
setMaterial(userData, 1, &gattribs);
- BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
+ BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, false);
}
return;
@@ -2506,11 +2507,11 @@ DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int
/* skip faces with all vertices merged */
{
- int all_vertices_merged = TRUE;
+ bool all_vertices_merged = true;
for (j = 0; j < mp->totloop; j++, ml++) {
if (vtargetmap[ml->v] == -1) {
- all_vertices_merged = FALSE;
+ all_vertices_merged = false;
break;
}
}
@@ -2667,7 +2668,7 @@ void CDDM_calc_edges_tessface(DerivedMesh *dm)
index = CustomData_get_layer(&edgeData, CD_ORIGINDEX);
for (ehi = BLI_edgehashIterator_new(eh), i = 0;
- BLI_edgehashIterator_isDone(ehi) == FALSE;
+ BLI_edgehashIterator_isDone(ehi) == false;
BLI_edgehashIterator_step(ehi), i++, med++, index++)
{
BLI_edgehashIterator_getKey(ehi, &med->v1, &med->v2);
@@ -2739,7 +2740,7 @@ void CDDM_calc_edges(DerivedMesh *dm)
index = CustomData_get_layer(&edgeData, CD_ORIGINDEX);
for (ehi = BLI_edgehashIterator_new(eh), i = 0;
- BLI_edgehashIterator_isDone(ehi) == FALSE;
+ BLI_edgehashIterator_isDone(ehi) == false;
BLI_edgehashIterator_step(ehi), ++i, ++med, ++index)
{
BLI_edgehashIterator_getKey(ehi, &med->v1, &med->v2);
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index e2cb0118e50..75d24fa3a49 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -183,14 +183,14 @@ void curvemapping_set_black_white(CurveMapping *cumap, const float black[3], con
/* ********** NOTE: requires curvemapping_changed() call after ******** */
/* remove specified point */
-int curvemap_remove_point(CurveMap *cuma, CurveMapPoint *point)
+bool curvemap_remove_point(CurveMap *cuma, CurveMapPoint *point)
{
CurveMapPoint *cmp;
int a, b, removed = 0;
/* must have 2 points minimum */
if (cuma->totpoint <= 2)
- return FALSE;
+ return false;
cmp = MEM_mallocN((cuma->totpoint) * sizeof(CurveMapPoint), "curve points");
@@ -759,7 +759,7 @@ void curvemapping_changed_all(CurveMapping *cumap)
for (a = 0; a < CM_TOT; a++) {
if (cumap->cm[a].curve) {
cumap->cur = a;
- curvemapping_changed(cumap, FALSE);
+ curvemapping_changed(cumap, false);
}
}
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 243b99a31e4..7ec00352853 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -717,7 +717,7 @@ static void childof_id_looper(bConstraint *con, ConstraintIDFunc func, void *use
bChildOfConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int childof_get_tars(bConstraint *con, ListBase *list)
@@ -852,7 +852,7 @@ static void trackto_id_looper(bConstraint *con, ConstraintIDFunc func, void *use
bTrackToConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int trackto_get_tars(bConstraint *con, ListBase *list)
@@ -1030,10 +1030,10 @@ static void kinematic_id_looper(bConstraint *con, ConstraintIDFunc func, void *u
bKinematicConstraint *data = con->data;
/* chain target */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
/* poletarget */
- func(con, (ID **)&data->poletar, FALSE, userdata);
+ func(con, (ID **)&data->poletar, false, userdata);
}
static int kinematic_get_tars(bConstraint *con, ListBase *list)
@@ -1122,7 +1122,7 @@ static void followpath_id_looper(bConstraint *con, ConstraintIDFunc func, void *
bFollowPathConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int followpath_get_tars(bConstraint *con, ListBase *list)
@@ -1169,7 +1169,7 @@ static void followpath_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstra
#ifdef CYCLIC_DEPENDENCY_WORKAROUND
if (ct->tar->curve_cache == NULL) {
- BKE_displist_make_curveTypes(cob->scene, ct->tar, FALSE);
+ BKE_displist_make_curveTypes(cob->scene, ct->tar, false);
}
#endif
@@ -1470,7 +1470,7 @@ static void loclike_id_looper(bConstraint *con, ConstraintIDFunc func, void *use
bLocateLikeConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int loclike_get_tars(bConstraint *con, ListBase *list)
@@ -1560,7 +1560,7 @@ static void rotlike_id_looper(bConstraint *con, ConstraintIDFunc func, void *use
bRotateLikeConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int rotlike_get_tars(bConstraint *con, ListBase *list)
@@ -1672,7 +1672,7 @@ static void sizelike_id_looper(bConstraint *con, ConstraintIDFunc func, void *us
bSizeLikeConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int sizelike_get_tars(bConstraint *con, ListBase *list)
@@ -1761,7 +1761,7 @@ static void translike_id_looper(bConstraint *con, ConstraintIDFunc func, void *u
bTransLikeConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int translike_get_tars(bConstraint *con, ListBase *list)
@@ -1924,10 +1924,10 @@ static void pycon_id_looper(bConstraint *con, ConstraintIDFunc func, void *userd
/* targets */
for (ct = data->targets.first; ct; ct = ct->next)
- func(con, (ID **)&ct->tar, FALSE, userdata);
+ func(con, (ID **)&ct->tar, false, userdata);
/* script */
- func(con, (ID **)&data->text, TRUE, userdata);
+ func(con, (ID **)&data->text, true, userdata);
}
/* Whether this approach is maintained remains to be seen (aligorith) */
@@ -1942,7 +1942,7 @@ static void pycon_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstraintTa
/* special exception for curves - depsgraph issues */
if (ct->tar->type == OB_CURVE) {
if (ct->tar->curve_cache == NULL) {
- BKE_displist_make_curveTypes(cob->scene, ct->tar, FALSE);
+ BKE_displist_make_curveTypes(cob->scene, ct->tar, false);
}
}
#endif
@@ -2017,10 +2017,10 @@ static void actcon_id_looper(bConstraint *con, ConstraintIDFunc func, void *user
bActionConstraint *data = con->data;
/* target */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
/* action */
- func(con, (ID **)&data->act, TRUE, userdata);
+ func(con, (ID **)&data->act, true, userdata);
}
static int actcon_get_tars(bConstraint *con, ListBase *list)
@@ -2184,7 +2184,7 @@ static void locktrack_id_looper(bConstraint *con, ConstraintIDFunc func, void *u
bLockTrackConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int locktrack_get_tars(bConstraint *con, ListBase *list)
@@ -2491,7 +2491,7 @@ static void distlimit_id_looper(bConstraint *con, ConstraintIDFunc func, void *u
bDistLimitConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int distlimit_get_tars(bConstraint *con, ListBase *list)
@@ -2618,7 +2618,7 @@ static void stretchto_id_looper(bConstraint *con, ConstraintIDFunc func, void *u
bStretchToConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int stretchto_get_tars(bConstraint *con, ListBase *list)
@@ -2790,7 +2790,7 @@ static void minmax_id_looper(bConstraint *con, ConstraintIDFunc func, void *user
bMinMaxConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int minmax_get_tars(bConstraint *con, ListBase *list)
@@ -2932,8 +2932,8 @@ static void rbj_id_looper(bConstraint *con, ConstraintIDFunc func, void *userdat
bRigidBodyJointConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
- func(con, (ID **)&data->child, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
+ func(con, (ID **)&data->child, false, userdata);
}
static int rbj_get_tars(bConstraint *con, ListBase *list)
@@ -2984,7 +2984,7 @@ static void clampto_id_looper(bConstraint *con, ConstraintIDFunc func, void *use
bClampToConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int clampto_get_tars(bConstraint *con, ListBase *list)
@@ -3018,7 +3018,7 @@ static void clampto_get_tarmat(bConstraint *UNUSED(con), bConstraintOb *cob, bCo
#ifdef CYCLIC_DEPENDENCY_WORKAROUND
if (VALID_CONS_TARGET(ct)) {
if (ct->tar->curve_cache == NULL) {
- BKE_displist_make_curveTypes(cob->scene, ct->tar, FALSE);
+ BKE_displist_make_curveTypes(cob->scene, ct->tar, false);
}
}
#endif
@@ -3046,7 +3046,7 @@ static void clampto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *tar
INIT_MINMAX(curveMin, curveMax);
/* XXX - don't think this is good calling this here - campbell */
- BKE_object_minmax(ct->tar, curveMin, curveMax, TRUE);
+ BKE_object_minmax(ct->tar, curveMin, curveMax, true);
/* get targetmatrix */
if (data->tar->curve_cache && data->tar->curve_cache->path && data->tar->curve_cache->path->data) {
@@ -3164,7 +3164,7 @@ static void transform_id_looper(bConstraint *con, ConstraintIDFunc func, void *u
bTransformConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int transform_get_tars(bConstraint *con, ListBase *list)
@@ -3311,7 +3311,7 @@ static void shrinkwrap_id_looper(bConstraint *con, ConstraintIDFunc func, void *
bShrinkwrapConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->target, FALSE, userdata);
+ func(con, (ID **)&data->target, false, userdata);
}
static void shrinkwrap_new_data(void *cdata)
@@ -3383,7 +3383,7 @@ static void shrinkwrap_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstra
bvhtree_from_mesh_faces(&treeData, target, 0.0, 2, 6);
if (treeData.tree == NULL) {
- fail = TRUE;
+ fail = true;
break;
}
@@ -3425,13 +3425,13 @@ static void shrinkwrap_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstra
mul_mat3_m4_v3(mat, no);
if (normalize_v3(no) < FLT_EPSILON) {
- fail = TRUE;
+ fail = true;
break;
}
bvhtree_from_mesh_faces(&treeData, target, scon->dist, 4, 6);
if (treeData.tree == NULL) {
- fail = TRUE;
+ fail = true;
break;
}
@@ -3439,7 +3439,7 @@ static void shrinkwrap_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstra
if (BKE_shrinkwrap_project_normal(0, co, no, &transform, treeData.tree, &hit,
treeData.raycast_callback, &treeData) == false)
{
- fail = TRUE;
+ fail = true;
break;
}
copy_v3_v3(co, hit.co);
@@ -3451,7 +3451,7 @@ static void shrinkwrap_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstra
target->release(target);
- if (fail == TRUE) {
+ if (fail == true) {
/* Don't move the point */
zero_v3(co);
}
@@ -3502,7 +3502,7 @@ static void damptrack_id_looper(bConstraint *con, ConstraintIDFunc func, void *u
bDampTrackConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int damptrack_get_tars(bConstraint *con, ListBase *list)
@@ -3647,7 +3647,7 @@ static void splineik_id_looper(bConstraint *con, ConstraintIDFunc func, void *us
bSplineIKConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int splineik_get_tars(bConstraint *con, ListBase *list)
@@ -3681,7 +3681,7 @@ static void splineik_get_tarmat(bConstraint *UNUSED(con), bConstraintOb *cob, bC
#ifdef CYCLIC_DEPENDENCY_WORKAROUND
if (VALID_CONS_TARGET(ct)) {
if (ct->tar->curve_cache == NULL) {
- BKE_displist_make_curveTypes(cob->scene, ct->tar, FALSE);
+ BKE_displist_make_curveTypes(cob->scene, ct->tar, false);
}
}
#endif
@@ -3715,7 +3715,7 @@ static void pivotcon_id_looper(bConstraint *con, ConstraintIDFunc func, void *us
bPivotConstraint *data = con->data;
/* target only */
- func(con, (ID **)&data->tar, FALSE, userdata);
+ func(con, (ID **)&data->tar, false, userdata);
}
static int pivotcon_get_tars(bConstraint *con, ListBase *list)
@@ -3846,9 +3846,9 @@ static void followtrack_id_looper(bConstraint *con, ConstraintIDFunc func, void
{
bFollowTrackConstraint *data = con->data;
- func(con, (ID **)&data->clip, TRUE, userdata);
- func(con, (ID **)&data->camera, FALSE, userdata);
- func(con, (ID **)&data->depth_ob, FALSE, userdata);
+ func(con, (ID **)&data->clip, true, userdata);
+ func(con, (ID **)&data->camera, false, userdata);
+ func(con, (ID **)&data->depth_ob, false, userdata);
}
static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
@@ -4082,7 +4082,7 @@ static void camerasolver_id_looper(bConstraint *con, ConstraintIDFunc func, void
{
bCameraSolverConstraint *data = con->data;
- func(con, (ID **)&data->clip, TRUE, userdata);
+ func(con, (ID **)&data->clip, true, userdata);
}
static void camerasolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
@@ -4138,8 +4138,8 @@ static void objectsolver_id_looper(bConstraint *con, ConstraintIDFunc func, void
{
bObjectSolverConstraint *data = con->data;
- func(con, (ID **)&data->clip, FALSE, userdata);
- func(con, (ID **)&data->camera, FALSE, userdata);
+ func(con, (ID **)&data->clip, false, userdata);
+ func(con, (ID **)&data->camera, false, userdata);
}
static void objectsolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *UNUSED(targets))
@@ -4521,7 +4521,7 @@ static void con_fix_copied_refs_cb(bConstraint *UNUSED(con), ID **idpoin, short
}
/* duplicate all of the constraints in a constraint stack */
-void BKE_copy_constraints(ListBase *dst, const ListBase *src, int do_extern)
+void BKE_copy_constraints(ListBase *dst, const ListBase *src, bool do_extern)
{
bConstraint *con, *srccon;
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index a63807f4bcb..eeb1f4b9e4f 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -258,7 +258,7 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
bScreen *sc;
ScrArea *sa;
ARegion *ar;
- int done = FALSE, recursion = C->data.recursion;
+ int done = 0, recursion = C->data.recursion;
int ret = 0;
memset(result, 0, sizeof(bContextDataResult));
@@ -291,7 +291,7 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res
entry = BLI_rfindstring(&C->wm.store->entries, member, offsetof(bContextStoreEntry, name));
if (entry) {
result->ptr = entry->ptr;
- done = TRUE;
+ done = 1;
}
}
if (done != 1 && recursion < 2 && (ar = CTX_wm_region(C))) {
@@ -435,11 +435,11 @@ int CTX_data_get(const bContext *C, const char *member, PointerRNA *r_ptr, ListB
return ret;
}
-static void data_dir_add(ListBase *lb, const char *member, const short use_all)
+static void data_dir_add(ListBase *lb, const char *member, const bool use_all)
{
LinkData *link;
- if ((use_all == FALSE) && strcmp(member, "scene") == 0) /* exception */
+ if ((use_all == false) && strcmp(member, "scene") == 0) /* exception */
return;
if (BLI_findstring(lb, member, offsetof(LinkData, data)))
@@ -456,7 +456,7 @@ static void data_dir_add(ListBase *lb, const char *member, const short use_all)
* \param use_rna Use Include the properties from 'RNA_Context'
* \param use_all Don't skip values (currently only "scene")
*/
-ListBase CTX_data_dir_get_ex(const bContext *C, const short use_store, const short use_rna, const short use_all)
+ListBase CTX_data_dir_get_ex(const bContext *C, const bool use_store, const bool use_rna, const bool use_all)
{
bContextDataResult result;
ListBase lb;
@@ -526,7 +526,7 @@ ListBase CTX_data_dir_get_ex(const bContext *C, const short use_store, const sho
ListBase CTX_data_dir_get(const bContext *C)
{
- return CTX_data_dir_get_ex(C, TRUE, FALSE, FALSE);
+ return CTX_data_dir_get_ex(C, true, false, false);
}
bool CTX_data_equals(const char *member, const char *str)
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 109909e8e0b..ae45ca55c5d 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -256,7 +256,7 @@ void BKE_curve_make_local(Curve *cu)
{
Main *bmain = G.main;
Object *ob;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - when there are only lib users: don't do
* - when there are only local users: set flag
@@ -274,12 +274,12 @@ void BKE_curve_make_local(Curve *cu)
for (ob = bmain->object.first; ob && ELEM(0, is_lib, is_local); ob = ob->id.next) {
if (ob->data == cu) {
- if (ob->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ob->id.lib) is_lib = true;
+ else is_local = true;
}
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &cu->id);
extern_local_curve(cu);
}
@@ -437,7 +437,7 @@ void BKE_curve_texspace_get(Curve *cu, float r_loc[3], float r_rot[3], float r_s
if (r_size) copy_v3_v3(r_size, cu->size);
}
-int BKE_nurbList_index_get_co(ListBase *nurb, const int index, float r_co[3])
+bool BKE_nurbList_index_get_co(ListBase *nurb, const int index, float r_co[3])
{
Nurb *nu;
int tot = 0;
@@ -448,20 +448,20 @@ int BKE_nurbList_index_get_co(ListBase *nurb, const int index, float r_co[3])
tot_nu = nu->pntsu;
if (index - tot < tot_nu) {
copy_v3_v3(r_co, nu->bezt[index - tot].vec[1]);
- return TRUE;
+ return true;
}
}
else {
tot_nu = nu->pntsu * nu->pntsv;
if (index - tot < tot_nu) {
copy_v3_v3(r_co, nu->bp[index - tot].vec);
- return TRUE;
+ return true;
}
}
tot += tot_nu;
}
- return FALSE;
+ return false;
}
int BKE_nurbList_verts_count(ListBase *nurb)
@@ -1494,12 +1494,12 @@ float *BKE_curve_surf_make_orco(Object *ob)
for (b = 0; b < sizeu; b++) {
int use_b = b;
if (b == sizeu - 1 && (nu->flagu & CU_NURB_CYCLIC))
- use_b = FALSE;
+ use_b = false;
for (a = 0; a < sizev; a++) {
int use_a = a;
if (a == sizev - 1 && (nu->flagv & CU_NURB_CYCLIC))
- use_a = FALSE;
+ use_a = false;
tdata = _tdata + 3 * (use_b * (nu->pntsv * resolv) + use_a);
@@ -2530,7 +2530,7 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
float min, inp;
struct BevelSort *sortdata, *sd, *sd1;
int a, b, nr, poly, resolu = 0, len = 0;
- int do_tilt, do_radius, do_weight;
+ bool do_tilt, do_radius, do_weight;
bool is_editmode = false;
ListBase *bev;
@@ -2558,7 +2558,7 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
/* check if we will calculate tilt data */
do_tilt = CU_DO_TILT(cu, nu);
do_radius = CU_DO_RADIUS(cu, nu); /* normal display uses the radius, better just to calculate them */
- do_weight = TRUE;
+ do_weight = true;
/* check we are a single point? also check we are not a surface and that the orderu is sane,
* enforced in the UI but can go wrong possibly */
@@ -2591,7 +2591,7 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
bevp->alfa = bp->alfa;
bevp->radius = bp->radius;
bevp->weight = bp->weight;
- bevp->split_tag = TRUE;
+ bevp->split_tag = true;
bevp++;
bp++;
}
@@ -2631,8 +2631,8 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
bevp->alfa = prevbezt->alfa;
bevp->radius = prevbezt->radius;
bevp->weight = prevbezt->weight;
- bevp->split_tag = TRUE;
- bevp->dupe_tag = FALSE;
+ bevp->split_tag = true;
+ bevp->dupe_tag = false;
bevp++;
bl->nr++;
bl->dupe_nr = 1;
@@ -2665,13 +2665,13 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
/* indicate with handlecodes double points */
if (prevbezt->h1 == prevbezt->h2) {
if (prevbezt->h1 == 0 || prevbezt->h1 == HD_VECT)
- bevp->split_tag = TRUE;
+ bevp->split_tag = true;
}
else {
if (prevbezt->h1 == 0 || prevbezt->h1 == HD_VECT)
- bevp->split_tag = TRUE;
+ bevp->split_tag = true;
else if (prevbezt->h2 == 0 || prevbezt->h2 == HD_VECT)
- bevp->split_tag = TRUE;
+ bevp->split_tag = true;
}
bl->nr += resolu;
bevp += resolu;
@@ -2737,7 +2737,7 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
if (fabsf(bevp0->vec[0] - bevp1->vec[0]) < 0.00001f) {
if (fabsf(bevp0->vec[1] - bevp1->vec[1]) < 0.00001f) {
if (fabsf(bevp0->vec[2] - bevp1->vec[2]) < 0.00001f) {
- bevp0->dupe_tag = TRUE;
+ bevp0->dupe_tag = true;
bl->dupe_nr++;
}
}
@@ -3175,7 +3175,7 @@ void BKE_nurb_handle_calc(BezTriple *bezt, BezTriple *prev, BezTriple *next, con
void BKE_nurb_handles_calc(Nurb *nu) /* first, if needed, set handle flags */
{
- calchandlesNurb_intern(nu, FALSE);
+ calchandlesNurb_intern(nu, false);
}
/* similar to BKE_nurb_handle_calc but for curves and
@@ -3693,7 +3693,7 @@ void BK_curve_nurbs_vertexCos_apply(ListBase *lb, float (*vertexCos)[3])
}
}
- calchandlesNurb_intern(nu, TRUE);
+ calchandlesNurb_intern(nu, true);
}
}
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 82b6dded29c..d072088ac8e 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -359,7 +359,7 @@ void defvert_normalize_lock_map(
for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
if ((dw->def_nr < vgroup_tot) && vgroup_subset[dw->def_nr]) {
- if ((dw->def_nr < defbase_tot) && (lock_flags[dw->def_nr] == FALSE)) {
+ if ((dw->def_nr < defbase_tot) && (lock_flags[dw->def_nr] == false)) {
tot_weight += dw->weight;
}
else {
@@ -377,7 +377,7 @@ void defvert_normalize_lock_map(
float scalar = (1.0f / tot_weight) * lock_iweight;
for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) {
if ((dw->def_nr < vgroup_tot) && vgroup_subset[dw->def_nr]) {
- if ((dw->def_nr < defbase_tot) && (lock_flags[dw->def_nr] == FALSE)) {
+ if ((dw->def_nr < defbase_tot) && (lock_flags[dw->def_nr] == false)) {
dw->weight *= scalar;
/* in case of division errors with very low weights */
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index af321302984..45f80959533 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -2535,7 +2535,8 @@ void DAG_ids_flush_tagged(Main *bmain)
ListBase listbase;
DagSceneLayer *dsl;
ListBase *lbarray[MAX_LIBARRAY];
- int a, do_flush = FALSE;
+ int a;
+ bool do_flush = false;
/* get list of visible scenes and layers */
dag_current_scene_layers(bmain, &listbase);
@@ -2559,7 +2560,7 @@ void DAG_ids_flush_tagged(Main *bmain)
for (dsl = listbase.first; dsl; dsl = dsl->next)
dag_id_flush_update(bmain, dsl->scene, id);
- do_flush = TRUE;
+ do_flush = true;
}
}
}
@@ -2574,10 +2575,11 @@ void DAG_ids_flush_tagged(Main *bmain)
BLI_freelistN(&listbase);
}
-void DAG_ids_check_recalc(Main *bmain, Scene *scene, int time)
+void DAG_ids_check_recalc(Main *bmain, Scene *scene, bool time)
{
ListBase *lbarray[MAX_LIBARRAY];
- int a, updated = 0;
+ int a;
+ bool updated = false;
/* loop over all ID types */
a = set_listbasepointers(bmain, lbarray);
@@ -2595,7 +2597,7 @@ void DAG_ids_check_recalc(Main *bmain, Scene *scene, int time)
#endif
bmain->id_tag_update[id->name[0]])
{
- updated = 1;
+ updated = true;
break;
}
}
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index eeedd07d401..cdff6e249a7 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -1538,7 +1538,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba
if (!for_orco)
curve_calc_modifiers_pre(scene, ob, &nubase, for_render, use_render_resolution);
- BKE_curve_bevelList_make(ob, &nubase, for_render != FALSE);
+ BKE_curve_bevelList_make(ob, &nubase, for_render != false);
/* If curve has no bevel will return nothing */
BKE_curve_bevel_make(scene, ob, &dlbev, for_render, use_render_resolution);
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 24ccc663878..a778a074722 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -297,12 +297,12 @@ DynamicPaintSurface *get_activeSurface(DynamicPaintCanvasSettings *canvas)
void dynamicPaint_resetPreview(DynamicPaintCanvasSettings *canvas)
{
DynamicPaintSurface *surface = canvas->surfaces.first;
- int done = FALSE;
+ bool done = false;
for (; surface; surface = surface->next) {
if (!done && dynamicPaint_surfaceHasColorPreview(surface)) {
surface->flags |= MOD_DPAINT_PREVIEW;
- done = TRUE;
+ done = true;
}
else
surface->flags &= ~MOD_DPAINT_PREVIEW;
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 752ae293a35..b7c5c605254 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -932,9 +932,10 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm,
DMVertexAttribs attribs;
GPUVertexAttribs gattribs;
- int i, matnr, new_matnr, do_draw, fi;
+ int i, matnr, new_matnr, fi;
+ bool do_draw;
- do_draw = FALSE;
+ do_draw = false;
matnr = -1;
memset(&attribs, 0, sizeof(attribs));
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 038b9cbafca..1810e41a39c 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -447,7 +447,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, bool *
static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple **last,
const bool do_sel_only)
{
- short found = FALSE;
+ bool found = false;
/* init outputs */
*first = NULL;
@@ -467,7 +467,7 @@ static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple
for (i = 0; i < fcu->totvert; bezt++, i++) {
if (BEZSELECTED(bezt)) {
*first = bezt;
- found = TRUE;
+ found = true;
break;
}
}
@@ -477,7 +477,7 @@ static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple
for (i = 0; i < fcu->totvert; bezt--, i++) {
if (BEZSELECTED(bezt)) {
*last = bezt;
- found = TRUE;
+ found = true;
break;
}
}
@@ -486,7 +486,7 @@ static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple
/* just full array */
*first = fcu->bezt;
*last = ARRAY_LAST_ITEM(fcu->bezt, BezTriple, sizeof(BezTriple), fcu->totvert);
- found = TRUE;
+ found = true;
}
return found;
@@ -529,7 +529,7 @@ bool calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, floa
BezTriple *bezt;
for (bezt = fcu->bezt, i = 0; i < fcu->totvert; bezt++, i++) {
- if ((do_sel_only == FALSE) || BEZSELECTED(bezt)) {
+ if ((do_sel_only == false) || BEZSELECTED(bezt)) {
if (include_handles) {
yminv = min_ffff(yminv, bezt->vec[1][1], bezt->vec[0][1], bezt->vec[2][1]);
ymaxv = max_ffff(ymaxv, bezt->vec[1][1], bezt->vec[0][1], bezt->vec[2][1]);
@@ -539,7 +539,7 @@ bool calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, floa
ymaxv = max_ff(ymaxv, bezt->vec[1][1]);
}
- foundvert = TRUE;
+ foundvert = true;
}
}
}
@@ -561,7 +561,7 @@ bool calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, floa
if (fpt->vec[1] > ymaxv)
ymaxv = fpt->vec[1];
- foundvert = TRUE;
+ foundvert = true;
}
}
}
@@ -593,7 +593,7 @@ bool calc_fcurve_range(FCurve *fcu, float *start, float *end,
const bool do_sel_only, const bool do_min_length)
{
float min = 999999999.0f, max = -999999999.0f;
- short foundvert = FALSE;
+ bool foundvert = false;
if (fcu->totvert) {
if (fcu->bezt) {
@@ -608,19 +608,19 @@ bool calc_fcurve_range(FCurve *fcu, float *start, float *end,
min = min_ff(min, bezt_first->vec[1][0]);
max = max_ff(max, bezt_last->vec[1][0]);
- foundvert = TRUE;
+ foundvert = true;
}
}
else if (fcu->fpt) {
min = min_ff(min, fcu->fpt[0].vec[0]);
max = max_ff(max, fcu->fpt[fcu->totvert - 1].vec[0]);
- foundvert = TRUE;
+ foundvert = true;
}
}
- if (foundvert == FALSE) {
+ if (foundvert == false) {
min = max = 0.0f;
}
@@ -1309,7 +1309,8 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar)
bPoseChannel *pchan;
float mat[4][4];
float oldEul[3] = {0.0f, 0.0f, 0.0f};
- short use_eulers = FALSE, rot_order = ROT_MODE_EUL;
+ bool use_eulers = false;
+ short rot_order = ROT_MODE_EUL;
/* check if this target has valid data */
if ((ob == NULL) || (GS(ob->id.name) != ID_OB)) {
@@ -1337,7 +1338,7 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar)
if (pchan->rotmode > 0) {
copy_v3_v3(oldEul, pchan->eul);
rot_order = pchan->rotmode;
- use_eulers = TRUE;
+ use_eulers = true;
}
if (dtar->flag & DTAR_FLAG_LOCALSPACE) {
@@ -1364,7 +1365,7 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar)
if (ob->rotmode > 0) {
copy_v3_v3(oldEul, ob->rot);
rot_order = ob->rotmode;
- use_eulers = TRUE;
+ use_eulers = true;
}
if (dtar->flag & DTAR_FLAG_LOCALSPACE) {
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index c60c1ea2b5f..6bef88b7f43 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -217,14 +217,14 @@ VFont *BKE_vfont_load(Main *bmain, const char *name)
BLI_strncpy(filename, name, sizeof(filename));
pf = get_builtin_packedfile();
- is_builtin = TRUE;
+ is_builtin = true;
}
else {
BLI_split_file_part(name, filename, sizeof(filename));
pf = newPackedFile(NULL, name, bmain->name);
temp_pf = newPackedFile(NULL, name, bmain->name);
- is_builtin = FALSE;
+ is_builtin = false;
}
if (pf) {
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 2a61b2e7453..e84db7e1f82 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -154,17 +154,17 @@ Group *BKE_group_copy(Group *group)
}
/* external */
-static int group_object_add_internal(Group *group, Object *ob)
+static bool group_object_add_internal(Group *group, Object *ob)
{
GroupObject *go;
if (group == NULL || ob == NULL) {
- return FALSE;
+ return false;
}
/* check if the object has been added already */
if (BLI_findptr(&group->gobject, ob, offsetof(GroupObject, ob))) {
- return FALSE;
+ return false;
}
go = MEM_callocN(sizeof(GroupObject), "groupobject");
@@ -172,7 +172,7 @@ static int group_object_add_internal(Group *group, Object *ob)
go->ob = ob;
- return TRUE;
+ return true;
}
bool BKE_group_object_add(Group *group, Object *object, Scene *scene, Base *base)
@@ -296,7 +296,7 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
{
static ListBase nlastrips = {NULL, NULL};
static bAction *action = NULL;
- static int done = FALSE;
+ static bool done = false;
bActionStrip *strip, *nstrip;
if (mode == 's') {
@@ -310,7 +310,7 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
action = target->action;
target->action = NULL;
target->nlaflag |= OB_NLA_OVERRIDE;
- done = TRUE;
+ done = true;
}
nstrip = MEM_dupallocN(strip);
BLI_addtail(&target->nlastrips, nstrip);
@@ -325,7 +325,7 @@ static void group_replaces_nla(Object *parent, Object *target, char mode)
BLI_listbase_clear(&nlastrips); /* not needed, but yah... :) */
action = NULL;
- done = FALSE;
+ done = false;
}
}
}
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 603ddf7ac2e..23d55ad90df 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -806,7 +806,7 @@ IDProperty *IDP_GetProperties(ID *id, const bool create_if_needed)
}
/**
- * \param is_strict When FALSE treat missing items as a match */
+ * \param is_strict When false treat missing items as a match */
bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is_strict)
{
if (prop1 == NULL && prop2 == NULL)
@@ -871,7 +871,7 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is
bool IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)
{
- return IDP_EqualsProperties_ex(prop1, prop2, TRUE);
+ return IDP_EqualsProperties_ex(prop1, prop2, true);
}
/**
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index b74424a1d28..76643678a0b 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -382,7 +382,7 @@ void BKE_image_make_local(struct Image *ima)
Tex *tex;
Brush *brush;
Mesh *me;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -403,14 +403,14 @@ void BKE_image_make_local(struct Image *ima)
for (tex = bmain->tex.first; tex; tex = tex->id.next) {
if (tex->ima == ima) {
- if (tex->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (tex->id.lib) is_lib = true;
+ else is_local = true;
}
}
for (brush = bmain->brush.first; brush; brush = brush->id.next) {
if (brush->clone.image == ima) {
- if (brush->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (brush->id.lib) is_lib = true;
+ else is_local = true;
}
}
for (me = bmain->mesh.first; me; me = me->id.next) {
@@ -424,8 +424,8 @@ void BKE_image_make_local(struct Image *ima)
for (a = 0; a < me->totface; a++, tface++) {
if (tface->tpage == ima) {
- if (me->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (me->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -442,8 +442,8 @@ void BKE_image_make_local(struct Image *ima)
for (a = 0; a < me->totpoly; a++, mtpoly++) {
if (mtpoly->tpage == ima) {
- if (me->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (me->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -452,7 +452,7 @@ void BKE_image_make_local(struct Image *ima)
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &ima->id);
extern_local_image(ima);
}
@@ -739,7 +739,7 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char
/* both byte and float buffers are filling in sRGB space, need to linearize float buffer after BKE_image_buf_fill* functions */
IMB_buffer_float_from_float(rect_float, rect_float, ibuf->channels, IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB,
- TRUE, ibuf->x, ibuf->y, ibuf->x, ibuf->x);
+ true, ibuf->x, ibuf->y, ibuf->x, ibuf->x);
}
return ibuf;
@@ -1156,7 +1156,7 @@ int BKE_imtype_requires_linear_float(const char imtype)
case R_IMF_IMTYPE_RADHDR:
case R_IMF_IMTYPE_OPENEXR:
case R_IMF_IMTYPE_MULTILAYER:
- return TRUE;
+ return true;
}
return 0;
}
@@ -1372,7 +1372,7 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF
}
else {
- return FALSE;
+ return false;
}
}
@@ -1895,7 +1895,7 @@ bool BKE_imbuf_alpha_test(ImBuf *ibuf)
float *buf = ibuf->rect_float;
for (tot = ibuf->x * ibuf->y; tot--; buf += 4) {
if (buf[3] < 1.0f) {
- return TRUE;
+ return true;
}
}
}
@@ -1903,12 +1903,12 @@ bool BKE_imbuf_alpha_test(ImBuf *ibuf)
unsigned char *buf = (unsigned char *)ibuf->rect;
for (tot = ibuf->x * ibuf->y; tot--; buf += 4) {
if (buf[3] != 255) {
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
/* note: imf->planes is ignored here, its assumed the image channels
@@ -2055,7 +2055,7 @@ int BKE_imbuf_write(ImBuf *ibuf, const char *name, ImageFormatData *imf)
/* same as BKE_imbuf_write() but crappy workaround not to perminantly modify
* _some_, values in the imbuf */
int BKE_imbuf_write_as(ImBuf *ibuf, const char *name, ImageFormatData *imf,
- const short save_copy)
+ const bool save_copy)
{
ImBuf ibuf_back = *ibuf;
int ok;
@@ -2098,12 +2098,14 @@ static void do_makepicstring(char *string, const char *base, const char *relbase
do_add_image_extension(string, imtype, im_format);
}
-void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, const ImageFormatData *im_format, const short use_ext, const short use_frames)
+void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame,
+ const ImageFormatData *im_format, const bool use_ext, const bool use_frames)
{
do_makepicstring(string, base, relbase, frame, im_format->imtype, im_format, use_ext, use_frames);
}
-void BKE_makepicstring_from_type(char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames)
+void BKE_makepicstring_from_type(char *string, const char *base, const char *relbase, int frame,
+ const char imtype, const bool use_ext, const bool use_frames)
{
do_makepicstring(string, base, relbase, frame, imtype, NULL, use_ext, use_frames);
}
@@ -2441,7 +2443,7 @@ void BKE_image_backup_render(Scene *scene, Image *ima)
static void image_create_multilayer(Image *ima, ImBuf *ibuf, int framenr)
{
const char *colorspace = ima->colorspace_settings.name;
- int predivide = ima->alpha_mode == IMA_ALPHA_PREMUL;
+ bool predivide = (ima->alpha_mode == IMA_ALPHA_PREMUL);
ima->rr = RE_MultilayerConvert(ibuf->userdata, colorspace, predivide, ibuf->x, ibuf->y);
@@ -3004,16 +3006,16 @@ static ImBuf *image_get_cached_ibuf(Image *ima, ImageUser *iuser, int *r_frame,
BLI_INLINE bool image_quick_test(Image *ima, ImageUser *iuser)
{
if (ima == NULL)
- return FALSE;
+ return false;
if (iuser) {
if (iuser->ok == 0)
- return FALSE;
+ return false;
}
else if (ima->ok == 0)
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
/* Checks optional ImageUser and verifies/creates ImBuf.
@@ -3157,7 +3159,7 @@ bool BKE_image_has_ibuf(Image *ima, ImageUser *iuser)
/* quick reject tests */
if (!image_quick_test(ima, iuser))
- return FALSE;
+ return false;
BLI_spin_lock(&image_spin);
@@ -3215,15 +3217,15 @@ void BKE_image_pool_free(ImagePool *pool)
MEM_freeN(pool);
}
-BLI_INLINE ImBuf *image_pool_find_entry(ImagePool *pool, Image *image, int frame, int index, int *found)
+BLI_INLINE ImBuf *image_pool_find_entry(ImagePool *pool, Image *image, int frame, int index, bool *found)
{
ImagePoolEntry *entry;
- *found = FALSE;
+ *found = false;
for (entry = pool->image_buffers.first; entry; entry = entry->next) {
if (entry->image == image && entry->frame == frame && entry->index == index) {
- *found = TRUE;
+ *found = true;
return entry->ibuf;
}
}
@@ -3234,7 +3236,8 @@ BLI_INLINE ImBuf *image_pool_find_entry(ImagePool *pool, Image *image, int frame
ImBuf *BKE_image_pool_acquire_ibuf(Image *ima, ImageUser *iuser, ImagePool *pool)
{
ImBuf *ibuf;
- int index, frame, found;
+ int index, frame;
+ bool found;
if (!image_quick_test(ima, iuser))
return NULL;
@@ -3291,7 +3294,7 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, bool
const int len = (iuser->fie_ima * iuser->frames) / 2;
if (r_is_in_range) {
- *r_is_in_range = FALSE;
+ *r_is_in_range = false;
}
if (len == 0) {
@@ -3308,7 +3311,7 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, bool
if (cfra == 0) cfra = len;
if (r_is_in_range) {
- *r_is_in_range = TRUE;
+ *r_is_in_range = true;
}
}
@@ -3320,7 +3323,7 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, bool
}
else {
if (r_is_in_range) {
- *r_is_in_range = TRUE;
+ *r_is_in_range = true;
}
}
@@ -3470,7 +3473,7 @@ unsigned char *BKE_image_get_pixels_for_frame(struct Image *image, int frame)
unsigned char *pixels = NULL;
iuser.framenr = frame;
- iuser.ok = TRUE;
+ iuser.ok = true;
ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock);
@@ -3497,7 +3500,7 @@ float *BKE_image_get_float_pixels_for_frame(struct Image *image, int frame)
float *pixels = NULL;
iuser.framenr = frame;
- iuser.ok = TRUE;
+ iuser.ok = true;
ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock);
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 9dbaaa939ca..11c00576b61 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -546,10 +546,10 @@ static char *key_block_get_data(Key *key, KeyBlock *actkb, KeyBlock *kb, char **
/* currently only the first value of 'ofs' may be set. */
-static short key_pointer_size(const Key *key, const int mode, int *poinsize, int *ofs)
+static bool key_pointer_size(const Key *key, const int mode, int *poinsize, int *ofs)
{
if (key->from == NULL) {
- return FALSE;
+ return false;
}
switch (GS(key->from->name)) {
@@ -574,10 +574,10 @@ static short key_pointer_size(const Key *key, const int mode, int *poinsize, int
break;
default:
BLI_assert(!"invalid 'key->from' ID type");
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
static void cp_key(const int start, int end, const int tot, char *poin, Key *key, KeyBlock *actkb, KeyBlock *kb, float *weights, const int mode)
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index 3cade886a04..749e915e5ca 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -161,7 +161,7 @@ void BKE_lamp_make_local(Lamp *la)
{
Main *bmain = G.main;
Object *ob;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -177,13 +177,13 @@ void BKE_lamp_make_local(Lamp *la)
ob = bmain->object.first;
while (ob) {
if (ob->data == la) {
- if (ob->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ob->id.lib) is_lib = true;
+ else is_local = true;
}
ob = ob->id.next;
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &la->id);
}
else if (is_local && is_lib) {
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index f647926fc0f..55abd4b3f6c 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -314,7 +314,7 @@ void BKE_lattice_make_local(Lattice *lt)
{
Main *bmain = G.main;
Object *ob;
- int is_local = FALSE, is_lib = FALSE;
+ int is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -327,14 +327,14 @@ void BKE_lattice_make_local(Lattice *lt)
return;
}
- for (ob = bmain->object.first; ob && ELEM(FALSE, is_lib, is_local); ob = ob->id.next) {
+ for (ob = bmain->object.first; ob && ELEM(false, is_lib, is_local); ob = ob->id.next) {
if (ob->data == lt) {
- if (ob->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ob->id.lib) is_lib = true;
+ else is_local = true;
}
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &lt->id);
}
else if (is_local && is_lib) {
@@ -630,7 +630,7 @@ static bool calc_curve_deform(Scene *scene, Object *par, float co[3],
/* to be sure, mostly after file load */
if (ELEM(NULL, par->curve_cache, par->curve_cache->path)) {
#ifdef CYCLIC_DEPENDENCY_WORKAROUND
- BKE_displist_make_curveTypes(scene, par, FALSE);
+ BKE_displist_make_curveTypes(scene, par, false);
#endif
if (par->curve_cache->path == NULL) {
return 0; // happens on append and cyclic dependencies...
@@ -731,7 +731,7 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh
init_curve_deform(cuOb, target, &cd);
/* dummy bounds, keep if CU_DEFORM_BOUNDS_OFF is set */
- if (is_neg_axis == FALSE) {
+ if (is_neg_axis == false) {
cd.dmin[0] = cd.dmin[1] = cd.dmin[2] = 0.0f;
cd.dmax[0] = cd.dmax[1] = cd.dmax[2] = 1.0f;
}
@@ -756,7 +756,7 @@ void curve_deform_verts(Scene *scene, Object *cuOb, Object *target, DerivedMesh
}
}
else {
- use_vgroups = FALSE;
+ use_vgroups = false;
}
if (vgroup && vgroup[0] && use_vgroups) {
@@ -880,7 +880,7 @@ void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
{
LatticeDeformData *lattice_deform_data;
int a;
- int use_vgroups;
+ bool use_vgroups;
if (laOb->type != OB_LATTICE)
return;
@@ -902,7 +902,7 @@ void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
}
}
else {
- use_vgroups = FALSE;
+ use_vgroups = false;
}
if (vgroup && vgroup[0] && use_vgroups) {
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index 9f05284ef31..92628387dc6 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -318,7 +318,7 @@ static void maskrasterize_spline_differentiate_point_outset(float (*diff_feather
/* this function is not exact, sometimes it returns false positives,
* the main point of it is to clear out _almost_ all bucket/face non-intersections,
- * returning TRUE in corner cases is ok but missing an intersection is NOT.
+ * returning true in corner cases is ok but missing an intersection is NOT.
*
* method used
* - check if the center of the buckets bounding box is intersecting the face
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index eb8b385bbc7..01bbd1db003 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -80,7 +80,7 @@ void init_def_material(void)
/* not material itself */
void BKE_material_free(Material *ma)
{
- BKE_material_free_ex(ma, TRUE);
+ BKE_material_free_ex(ma, true);
}
/* not material itself */
@@ -294,7 +294,8 @@ void BKE_material_make_local(Material *ma)
Mesh *me;
Curve *cu;
MetaBall *mb;
- int a, is_local = FALSE, is_lib = FALSE;
+ int a;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -318,8 +319,8 @@ void BKE_material_make_local(Material *ma)
if (ob->mat) {
for (a = 0; a < ob->totcol; a++) {
if (ob->mat[a] == ma) {
- if (ob->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ob->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -331,8 +332,8 @@ void BKE_material_make_local(Material *ma)
if (me->mat) {
for (a = 0; a < me->totcol; a++) {
if (me->mat[a] == ma) {
- if (me->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (me->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -344,8 +345,8 @@ void BKE_material_make_local(Material *ma)
if (cu->mat) {
for (a = 0; a < cu->totcol; a++) {
if (cu->mat[a] == ma) {
- if (cu->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (cu->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -357,8 +358,8 @@ void BKE_material_make_local(Material *ma)
if (mb->mat) {
for (a = 0; a < mb->totcol; a++) {
if (mb->mat[a] == ma) {
- if (mb->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (mb->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
@@ -366,7 +367,7 @@ void BKE_material_make_local(Material *ma)
}
/* Only local users. */
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &ma->id);
extern_local_material(ma);
}
@@ -944,14 +945,14 @@ short find_material_index(Object *ob, Material *ma)
return 0;
}
-int object_add_material_slot(Object *ob)
+bool object_add_material_slot(Object *ob)
{
- if (ob == NULL) return FALSE;
- if (ob->totcol >= MAXMAT) return FALSE;
+ if (ob == NULL) return false;
+ if (ob->totcol >= MAXMAT) return false;
assign_material(ob, NULL, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF);
ob->actcol = ob->totcol;
- return TRUE;
+ return true;
}
static void do_init_render_material(Material *ma, int r_mode, float *amb)
@@ -1128,7 +1129,7 @@ static bool material_in_nodetree(bNodeTree *ntree, Material *mat)
return 0;
}
-int material_in_material(Material *parmat, Material *mat)
+bool material_in_material(Material *parmat, Material *mat)
{
if (parmat == mat)
return 1;
@@ -1196,7 +1197,7 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime)
ma->id.flag &= ~LIB_DOIT;
}
-int object_remove_material_slot(Object *ob)
+bool object_remove_material_slot(Object *ob)
{
Material *mao, ***matarar;
Object *obt;
@@ -1204,14 +1205,14 @@ int object_remove_material_slot(Object *ob)
short a, actcol;
if (ob == NULL || ob->totcol == 0) {
- return FALSE;
+ return false;
}
/* this should never happen and used to crash */
if (ob->actcol <= 0) {
printf("%s: invalid material index %d, report a bug!\n", __func__, ob->actcol);
BLI_assert(0);
- return FALSE;
+ return false;
}
/* take a mesh/curve/mball as starting point, remove 1 index,
@@ -1280,7 +1281,7 @@ int object_remove_material_slot(Object *ob)
}
}
- return TRUE;
+ return true;
}
@@ -1532,7 +1533,7 @@ void free_matcopybuf(void)
matcopybuf.ramp_spec = NULL;
if (matcopybuf.nodetree) {
- ntreeFreeTree_ex(matcopybuf.nodetree, FALSE);
+ ntreeFreeTree_ex(matcopybuf.nodetree, false);
MEM_freeN(matcopybuf.nodetree);
matcopybuf.nodetree = NULL;
}
@@ -1558,7 +1559,7 @@ void copy_matcopybuf(Material *ma)
matcopybuf.mtex[a] = MEM_dupallocN(mtex);
}
}
- matcopybuf.nodetree = ntreeCopyTree_ex(ma->nodetree, FALSE);
+ matcopybuf.nodetree = ntreeCopyTree_ex(ma->nodetree, false);
matcopybuf.preview = NULL;
BLI_listbase_clear(&matcopybuf.gpumaterial);
matcopied = 1;
@@ -1611,7 +1612,7 @@ void paste_matcopybuf(Material *ma)
}
}
- ma->nodetree = ntreeCopyTree_ex(matcopybuf.nodetree, FALSE);
+ ma->nodetree = ntreeCopyTree_ex(matcopybuf.nodetree, false);
}
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 39da0676f5e..9efd0dee19a 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -252,7 +252,7 @@ void BKE_mball_make_local(MetaBall *mb)
{
Main *bmain = G.main;
Object *ob;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -269,12 +269,12 @@ void BKE_mball_make_local(MetaBall *mb)
for (ob = G.main->object.first; ob && ELEM(0, is_lib, is_local); ob = ob->id.next) {
if (ob->data == mb) {
- if (ob->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ob->id.lib) is_lib = true;
+ else is_local = true;
}
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &mb->id);
extern_local_mball(mb);
}
@@ -356,7 +356,7 @@ void BKE_mball_texspace_calc(Object *ob)
DispList *dl;
BoundBox *bb;
float *data, min[3], max[3] /*, loc[3], size[3] */;
- int tot, do_it = FALSE;
+ int tot, do_it = false;
if (ob->bb == NULL) ob->bb = MEM_callocN(sizeof(BoundBox), "mb boundbox");
bb = ob->bb;
@@ -369,7 +369,7 @@ void BKE_mball_texspace_calc(Object *ob)
dl = ob->curve_cache->disp.first;
while (dl) {
tot = dl->nr;
- if (tot) do_it = TRUE;
+ if (tot) do_it = true;
data = dl->verts;
while (tot--) {
/* Also weird... but longer. From utildefines. */
@@ -1111,11 +1111,11 @@ static int otherface(int edge, int face)
static void makecubetable(void)
{
- static int is_done = FALSE;
+ static bool is_done = false;
int i, e, c, done[12], pos[8];
if (is_done) return;
- is_done = TRUE;
+ is_done = true;
for (i = 0; i < 256; i++) {
for (e = 0; e < 12; e++) done[e] = 0;
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index b7ebd5c013d..7d8d98a4573 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -526,7 +526,7 @@ Mesh *BKE_mesh_copy_ex(Main *bmain, Mesh *me)
CustomData_copy(&me->fdata, &men->fdata, CD_MASK_MESH, CD_DUPLICATE, men->totface);
}
else {
- mesh_tessface_clear_intern(men, FALSE);
+ mesh_tessface_clear_intern(men, false);
}
BKE_mesh_update_customdata_pointers(men, do_tessface);
@@ -623,7 +623,7 @@ void BKE_mesh_make_local(Mesh *me)
{
Main *bmain = G.main;
Object *ob;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -639,12 +639,12 @@ void BKE_mesh_make_local(Mesh *me)
for (ob = bmain->object.first; ob && ELEM(0, is_lib, is_local); ob = ob->id.next) {
if (me == ob->data) {
- if (ob->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ob->id.lib) is_lib = true;
+ else is_local = true;
}
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &me->id);
expand_local_mesh(me);
}
@@ -1126,7 +1126,7 @@ static void make_edges_mdata_extend(MEdge **r_alledge, int *r_totedge,
/* --- */
for (ehi = BLI_edgehashIterator_new(eh);
- BLI_edgehashIterator_isDone(ehi) == FALSE;
+ BLI_edgehashIterator_isDone(ehi) == false;
BLI_edgehashIterator_step(ehi), ++medge, e_index++)
{
BLI_edgehashIterator_getKey(ehi, &medge->v1, &medge->v2);
@@ -1596,19 +1596,19 @@ void BKE_mesh_to_curve_nurblist(DerivedMesh *dm, ListBase *nurblist, const int e
/* each iteration find a polyline and add this as a nurbs poly spline */
ListBase polyline = {NULL, NULL}; /* store a list of VertLink's */
- int closed = FALSE;
+ bool closed = false;
int totpoly = 0;
MEdge *med_current = ((EdgeLink *)edges.last)->edge;
unsigned int startVert = med_current->v1;
unsigned int endVert = med_current->v2;
- int ok = TRUE;
+ bool ok = true;
appendPolyLineVert(&polyline, startVert); totpoly++;
appendPolyLineVert(&polyline, endVert); totpoly++;
BLI_freelinkN(&edges, edges.last); totedges--;
while (ok) { /* while connected edges are found... */
- ok = FALSE;
+ ok = false;
i = totedges;
while (i) {
EdgeLink *edl;
@@ -1621,25 +1621,25 @@ void BKE_mesh_to_curve_nurblist(DerivedMesh *dm, ListBase *nurblist, const int e
endVert = med->v2;
appendPolyLineVert(&polyline, med->v2); totpoly++;
BLI_freelinkN(&edges, edl); totedges--;
- ok = TRUE;
+ ok = true;
}
else if (med->v2 == endVert) {
endVert = med->v1;
appendPolyLineVert(&polyline, endVert); totpoly++;
BLI_freelinkN(&edges, edl); totedges--;
- ok = TRUE;
+ ok = true;
}
else if (med->v1 == startVert) {
startVert = med->v2;
prependPolyLineVert(&polyline, startVert); totpoly++;
BLI_freelinkN(&edges, edl); totedges--;
- ok = TRUE;
+ ok = true;
}
else if (med->v2 == startVert) {
startVert = med->v1;
prependPolyLineVert(&polyline, startVert); totpoly++;
BLI_freelinkN(&edges, edl); totedges--;
- ok = TRUE;
+ ok = true;
}
}
}
@@ -1648,7 +1648,7 @@ void BKE_mesh_to_curve_nurblist(DerivedMesh *dm, ListBase *nurblist, const int e
if (startVert == endVert) {
BLI_freelinkN(&polyline, polyline.last);
totpoly--;
- closed = TRUE;
+ closed = true;
}
/* --- nurbs --- */
@@ -1920,7 +1920,7 @@ void BKE_mesh_tessface_ensure(Mesh *mesh)
void BKE_mesh_tessface_clear(Mesh *mesh)
{
- mesh_tessface_clear_intern(mesh, TRUE);
+ mesh_tessface_clear_intern(mesh, true);
}
void BKE_mesh_do_versions_cd_flag_init(Mesh *mesh)
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 7b56784b1dd..848483d2877 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -73,7 +73,7 @@ typedef struct SortPoly {
int numverts;
int loopstart;
unsigned int index;
- int invalid; /* Poly index. */
+ bool invalid; /* Poly index. */
} SortPoly;
static void edge_store_assign(uint32_t verts[2], const uint32_t v1, const uint32_t v2)
@@ -256,7 +256,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
}
for (i = 1; i < totvert; i++, mv++) {
- int fix_normal = TRUE;
+ bool fix_normal = true;
for (j = 0; j < 3; j++) {
if (!finite(mv->co[j])) {
@@ -265,25 +265,25 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
if (do_fixes) {
zero_v3(mv->co);
- verts_fixed = TRUE;
+ verts_fixed = true;
}
}
if (mv->no[j] != 0)
- fix_normal = FALSE;
+ fix_normal = false;
}
if (fix_normal) {
PRINT_ERR("\tVertex %u: has zero normal, assuming Z-up normal\n", i);
if (do_fixes) {
mv->no[2] = SHRT_MAX;
- verts_fixed = TRUE;
+ verts_fixed = true;
}
}
}
for (i = 0, me = medges; i < totedge; i++, me++) {
- int remove = FALSE;
+ int remove = false;
if (me->v1 == me->v2) {
PRINT_ERR("\tEdge %u: has matching verts, both %u\n", i, me->v1);
remove = do_fixes;
@@ -303,7 +303,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
remove = do_fixes;
}
- if (remove == FALSE) {
+ if (remove == false) {
BLI_edgehash_insert(edge_hash, me->v1, me->v2, SET_INT_IN_POINTER(i));
}
else {
@@ -312,7 +312,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
}
if (mfaces && !mpolys) {
-# define REMOVE_FACE_TAG(_mf) { _mf->v3 = 0; do_face_free = TRUE; } (void)0
+# define REMOVE_FACE_TAG(_mf) { _mf->v3 = 0; do_face_free = true; } (void)0
# define CHECK_FACE_VERT_INDEX(a, b) \
if (mf->a == mf->b) { \
PRINT_ERR(" face %u: verts invalid, " STRINGIFY(a) "/" STRINGIFY(b) " both %u\n", i, mf->a); \
@@ -322,7 +322,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
if (!BLI_edgehash_haskey(edge_hash, mf->a, mf->b)) { \
PRINT_ERR(" face %u: edge " STRINGIFY(a) "/" STRINGIFY(b) \
" (%u,%u) is missing edge data\n", i, mf->a, mf->b); \
- do_edge_recalc = TRUE; \
+ do_edge_recalc = true; \
} (void)0
MFace *mf;
@@ -336,7 +336,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
PRINT_ERR("No Polys, only tesselated Faces\n");
for (i = 0, mf = mfaces, sf = sort_faces; i < totface; i++, mf++) {
- int remove = FALSE;
+ int remove = false;
int fidx;
unsigned int fv[4];
@@ -349,7 +349,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
}
} while (fidx--);
- if (remove == FALSE) {
+ if (remove == false) {
if (mf->v4) {
CHECK_FACE_VERT_INDEX(v1, v2);
CHECK_FACE_VERT_INDEX(v1, v3);
@@ -367,7 +367,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
CHECK_FACE_VERT_INDEX(v2, v3);
}
- if (remove == FALSE) {
+ if (remove == false) {
if (totedge) {
if (mf->v4) {
CHECK_FACE_EDGE(v1, v2);
@@ -411,7 +411,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
sf++;
for (i = 1; i < totsortface; i++, sf++) {
- int remove = FALSE;
+ int remove = false;
/* on a valid mesh, code below will never run */
if (memcmp(sf->es, sf_prev->es, sizeof(sf_prev->es)) == 0) {
@@ -475,18 +475,18 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
/* Invalid loop data. */
PRINT_ERR("\tPoly %u is invalid (loopstart: %u, totloop: %u)\n",
sp->index, mp->loopstart, mp->totloop);
- sp->invalid = TRUE;
+ sp->invalid = true;
}
else if (mp->loopstart + mp->totloop > totloop) {
/* Invalid loop data. */
PRINT_ERR("\tPoly %u uses loops out of range (loopstart: %u, loopend: %u, max nbr of loops: %u)\n",
sp->index, mp->loopstart, mp->loopstart + mp->totloop - 1, totloop - 1);
- sp->invalid = TRUE;
+ sp->invalid = true;
}
else {
/* Poly itself is valid, for now. */
int v1, v2; /* v1 is prev loop vert idx, v2 is current loop one. */
- sp->invalid = FALSE;
+ sp->invalid = false;
sp->verts = v = MEM_mallocN(sizeof(int) * mp->totloop, "Vert idx of SortPoly");
sp->numverts = mp->totloop;
sp->loopstart = mp->loopstart;
@@ -496,7 +496,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
if (ml->v >= totvert) {
/* Invalid vert idx. */
PRINT_ERR("\tLoop %u has invalid vert reference (%u)\n", sp->loopstart + j, ml->v);
- sp->invalid = TRUE;
+ sp->invalid = true;
}
mverts[ml->v].flag |= ME_VERT_TMP_TAG;
@@ -509,7 +509,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
for (j = 0; j < mp->totloop; j++, v++) {
if ((mverts[*v].flag & ME_VERT_TMP_TAG) == 0) {
PRINT_ERR("\tPoly %u has duplicate vert reference at corner (%u)\n", i, j);
- sp->invalid = TRUE;
+ sp->invalid = true;
}
mverts[*v].flag &= ~ME_VERT_TMP_TAG;
}
@@ -526,9 +526,9 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
/* Edge not existing. */
PRINT_ERR("\tPoly %u needs missing edge (%u, %u)\n", sp->index, v1, v2);
if (do_fixes)
- do_edge_recalc = TRUE;
+ do_edge_recalc = true;
else
- sp->invalid = TRUE;
+ sp->invalid = true;
}
else if (ml->e >= totedge) {
/* Invalid edge idx.
@@ -541,7 +541,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
}
else {
PRINT_ERR("\tLoop %u has invalid edge reference (%u)\n", sp->loopstart + j, ml->e);
- sp->invalid = TRUE;
+ sp->invalid = true;
}
}
else {
@@ -557,7 +557,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
}
else {
PRINT_ERR("\tPoly %u has invalid edge reference (%u)\n", sp->index, ml->e);
- sp->invalid = TRUE;
+ sp->invalid = true;
}
}
}
@@ -576,7 +576,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
if (dlt > 1) {
PRINT_ERR("\tPoly %u is invalid, it multi-uses vertex %u (%u times)\n",
sp->index, *prev_v, dlt);
- sp->invalid = TRUE;
+ sp->invalid = true;
}
prev_v = v;
}
@@ -584,7 +584,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
if (v - prev_v > 1) { /* Don't forget final verts! */
PRINT_ERR("\tPoly %u is invalid, it multi-uses vertex %u (%u times)\n",
sp->index, *prev_v, (int)(v - prev_v));
- sp->invalid = TRUE;
+ sp->invalid = true;
}
}
@@ -599,7 +599,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
for (i = 1; i < totpoly; i++, sp++) {
int p1_nv = sp->numverts, p2_nv = prev_sp->numverts;
int *p1_v = sp->verts, *p2_v = prev_sp->verts;
- short p1_sub = TRUE, p2_sub = TRUE;
+ short p1_sub = true, p2_sub = true;
if (sp->invalid)
break;
/* Test same polys. */
@@ -616,13 +616,13 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
while ((p1_nv && p2_nv) && (p1_sub || p2_sub)) {
if (*p1_v < *p2_v) {
if (p1_sub)
- p1_sub = FALSE;
+ p1_sub = false;
p1_nv--;
p1_v++;
}
else if (*p2_v < *p1_v) {
if (p2_sub)
- p2_sub = FALSE;
+ p2_sub = false;
p2_nv--;
p2_v++;
}
@@ -635,23 +635,23 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
}
}
if (p1_nv && p1_sub)
- p1_sub = FALSE;
+ p1_sub = false;
else if (p2_nv && p2_sub)
- p2_sub = FALSE;
+ p2_sub = false;
if (p1_sub && p2_sub) {
PRINT("\tPolys %u and %u use same vertices, considering poly %u as invalid.\n",
prev_sp->index, sp->index, sp->index);
- sp->invalid = TRUE;
+ sp->invalid = true;
}
/* XXX In fact, these might be valid? :/ */
else if (p1_sub) {
PRINT("\t%u is a sub-poly of %u, considering it as invalid.\n", sp->index, prev_sp->index);
- sp->invalid = TRUE;
+ sp->invalid = true;
}
else if (p2_sub) {
PRINT("\t%u is a sub-poly of %u, considering it as invalid.\n", prev_sp->index, sp->index);
- prev_sp->invalid = TRUE;
+ prev_sp->invalid = true;
prev_sp = sp; /* sp is new reference poly. */
}
#else
@@ -670,7 +670,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
else {
is_valid = false;
}
- sp->invalid = TRUE;
+ sp->invalid = true;
}
#endif
else {
@@ -755,14 +755,14 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
PRINT_ERR("\tVertex deform %u, group %d has weight: %f\n", i, dw->def_nr, dw->weight);
if (do_fixes) {
dw->weight = 0.0f;
- vert_weights_fixed = TRUE;
+ vert_weights_fixed = true;
}
}
else if (dw->weight < 0.0f || dw->weight > 1.0f) {
PRINT_ERR("\tVertex deform %u, group %d has weight: %f\n", i, dw->def_nr, dw->weight);
if (do_fixes) {
CLAMP(dw->weight, 0.0f, 1.0f);
- vert_weights_fixed = TRUE;
+ vert_weights_fixed = true;
}
}
@@ -776,7 +776,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
j--;
dw = dv->dw + j;
- vert_weights_fixed = TRUE;
+ vert_weights_fixed = true;
}
else { /* all freed */
break;
@@ -812,7 +812,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
if (mesh && mesh->mselect) {
MSelect *msel;
- int free_msel = FALSE;
+ bool free_msel = false;
for (i = 0, msel = mesh->mselect; i < mesh->totselect; i++, msel++) {
int tot_elem = 0;
@@ -820,7 +820,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
if (msel->index < 0) {
PRINT_ERR("\tMesh select element %d type %d index is negative, "
"resetting selection stack.\n", i, msel->type);
- free_msel = TRUE;
+ free_msel = true;
break;
}
@@ -840,7 +840,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
PRINT_ERR("\tMesh select element %d type %d index %d is larger than data array size %d, "
"resetting selection stack.\n", i, msel->type, msel->index, tot_elem);
- free_msel = TRUE;
+ free_msel = true;
break;
}
}
@@ -1095,12 +1095,12 @@ void BKE_mesh_strip_loose_polysloops(Mesh *me)
int *new_idx = MEM_mallocN(sizeof(int) * me->totloop, __func__);
for (a = b = 0, p = me->mpoly; a < me->totpoly; a++, p++) {
- int invalid = FALSE;
+ bool invalid = false;
int i = p->loopstart;
int stop = i + p->totloop;
if (stop > me->totloop || stop < i) {
- invalid = TRUE;
+ invalid = true;
}
else {
l = &me->mloop[i];
@@ -1108,7 +1108,7 @@ void BKE_mesh_strip_loose_polysloops(Mesh *me)
/* If one of the poly's loops is invalid, the whole poly is invalid! */
for (; i--; l++) {
if (l->e == INVALID_LOOP_EDGE_MARKER) {
- invalid = TRUE;
+ invalid = true;
break;
}
}
@@ -1431,7 +1431,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, bool update, const bool select)
med = CustomData_get_layer(&edata, CD_MEDGE);
for (ehi = BLI_edgehashIterator_new(eh), i = 0;
- BLI_edgehashIterator_isDone(ehi) == FALSE;
+ BLI_edgehashIterator_isDone(ehi) == false;
BLI_edgehashIterator_step(ehi), ++i, ++med)
{
if (update && (med_orig = BLI_edgehashIterator_getValue(ehi))) {
diff --git a/source/blender/blenkernel/intern/modifiers_bmesh.c b/source/blender/blenkernel/intern/modifiers_bmesh.c
index a9ff569e70a..8c79dee7a8b 100644
--- a/source/blender/blenkernel/intern/modifiers_bmesh.c
+++ b/source/blender/blenkernel/intern/modifiers_bmesh.c
@@ -79,7 +79,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal)
int cd_edge_bweight_offset;
int cd_edge_crease_offset;
- if (is_init == FALSE) {
+ if (is_init == false) {
/* check if we have an origflag */
has_orig_hflag |= CustomData_has_layer(&bm->vdata, CD_ORIGINDEX) ? BM_VERT : 0;
has_orig_hflag |= CustomData_has_layer(&bm->edata, CD_ORIGINDEX) ? BM_EDGE : 0;
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 81744af76f1..d4179be78ef 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -1191,7 +1191,7 @@ void BKE_movieclip_reload(MovieClip *clip)
/* clear cache */
free_buffers(clip);
- clip->tracking.stabilization.ok = FALSE;
+ clip->tracking.stabilization.ok = false;
/* update clip source */
detect_clip_source(clip);
@@ -1231,7 +1231,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
scopes->marker = NULL;
scopes->track = NULL;
- scopes->track_locked = TRUE;
+ scopes->track_locked = true;
if (clip) {
MovieTrackingTrack *act_track = BKE_tracking_track_get_active(&clip->tracking);
@@ -1245,12 +1245,12 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
scopes->track = track;
if (marker->flag & MARKER_DISABLED) {
- scopes->track_disabled = TRUE;
+ scopes->track_disabled = true;
}
else {
ImBuf *ibuf = BKE_movieclip_get_ibuf(clip, user);
- scopes->track_disabled = FALSE;
+ scopes->track_disabled = false;
if (ibuf && (ibuf->rect || ibuf->rect_float)) {
ImBuf *search_ibuf;
@@ -1296,7 +1296,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
if ((track->flag & TRACK_LOCKED) == 0) {
float pat_min[2], pat_max[2];
- scopes->track_locked = FALSE;
+ scopes->track_locked = false;
/* XXX: would work fine with non-transformed patterns, but would likely fail
* with transformed patterns, but that would be easier to debug when
@@ -1310,7 +1310,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
}
scopes->framenr = user->framenr;
- scopes->ok = TRUE;
+ scopes->ok = true;
}
static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, int proxy_render_size, bool undistorted, bool threaded)
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index cba905ad487..b6c87f286f0 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -699,7 +699,7 @@ void multiresModifier_del_levels(MultiresModifierData *mmd, Object *ob, int dire
multires_set_tot_level(ob, mmd, lvl);
}
-static DerivedMesh *multires_dm_create_local(Object *ob, DerivedMesh *dm, int lvl, int totlvl, int simple, int alloc_paint_mask)
+static DerivedMesh *multires_dm_create_local(Object *ob, DerivedMesh *dm, int lvl, int totlvl, int simple, bool alloc_paint_mask)
{
MultiresModifierData mmd = {{NULL}};
MultiresFlags flags = MULTIRES_USE_LOCAL_MMD;
@@ -1302,7 +1302,7 @@ void multires_set_space(DerivedMesh *dm, Object *ob, int from, int to)
}
totlvl = mmd->totlvl;
- ccgdm = multires_dm_create_local(ob, dm, totlvl, totlvl, mmd->simple, FALSE);
+ ccgdm = multires_dm_create_local(ob, dm, totlvl, totlvl, mmd->simple, false);
subsurf = subsurf_dm_create_local(ob, dm, totlvl,
mmd->simple, mmd->flags & eMultiresModifierFlag_ControlEdges, mmd->flags & eMultiresModifierFlag_PlainUv, 0);
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index b2d698890ad..2122526988a 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1027,16 +1027,16 @@ void nodeFromView(bNode *node, float x, float y, float *rx, float *ry)
}
}
-int nodeAttachNodeCheck(bNode *node, bNode *parent)
+bool nodeAttachNodeCheck(bNode *node, bNode *parent)
{
bNode *parent_recurse;
for (parent_recurse = node; parent_recurse; parent_recurse = parent_recurse->parent) {
if (parent_recurse == parent) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void nodeAttachNode(bNode *node, bNode *parent)
@@ -1044,7 +1044,7 @@ void nodeAttachNode(bNode *node, bNode *parent)
float locx, locy;
BLI_assert(parent->type == NODE_FRAME);
- BLI_assert(nodeAttachNodeCheck(parent, node) == FALSE);
+ BLI_assert(nodeAttachNodeCheck(parent, node) == false);
nodeToView(node, 0.0f, 0.0f, &locx, &locy);
@@ -1203,11 +1203,11 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, Main *bmain, bool do_
bNodeTree *ntreeCopyTree_ex(bNodeTree *ntree, const bool do_id_user)
{
- return ntreeCopyTree_internal(ntree, G.main, do_id_user, TRUE, TRUE);
+ return ntreeCopyTree_internal(ntree, G.main, do_id_user, true, true);
}
bNodeTree *ntreeCopyTree(bNodeTree *ntree)
{
- return ntreeCopyTree_ex(ntree, TRUE);
+ return ntreeCopyTree_ex(ntree, true);
}
/* use when duplicating scenes */
@@ -1234,7 +1234,7 @@ void ntreeSwitchID_ex(bNodeTree *ntree, ID *id_from, ID *id_to, const bool do_id
}
void ntreeSwitchID(bNodeTree *ntree, ID *id_from, ID *id_to)
{
- ntreeSwitchID_ex(ntree, id_from, id_to, TRUE);
+ ntreeSwitchID_ex(ntree, id_from, id_to, true);
}
void ntreeUserIncrefID(bNodeTree *ntree)
@@ -1265,7 +1265,7 @@ int BKE_node_preview_used(bNode *node)
return (node->typeinfo->flag & NODE_PREVIEW) != 0;
}
-bNodePreview *BKE_node_preview_verify(bNodeInstanceHash *previews, bNodeInstanceKey key, int xsize, int ysize, int create)
+bNodePreview *BKE_node_preview_verify(bNodeInstanceHash *previews, bNodeInstanceKey key, int xsize, int ysize, bool create)
{
bNodePreview *preview;
@@ -1779,7 +1779,7 @@ void ntreeFreeTree_ex(bNodeTree *ntree, const bool do_id_user)
/* same as ntreeFreeTree_ex but always manage users */
void ntreeFreeTree(bNodeTree *ntree)
{
- ntreeFreeTree_ex(ntree, TRUE);
+ ntreeFreeTree_ex(ntree, true);
}
void ntreeFreeCache(bNodeTree *ntree)
@@ -1876,7 +1876,7 @@ bNodeTree *ntreeFromID(ID *id)
void ntreeMakeLocal(bNodeTree *ntree)
{
Main *bmain = G.main;
- int lib = FALSE, local = FALSE;
+ bool lib = false, local = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -1896,9 +1896,9 @@ void ntreeMakeLocal(bNodeTree *ntree)
for (node = tntree->nodes.first; node; node = node->next) {
if (node->id == (ID *)ntree) {
if (owner_id->lib)
- lib = TRUE;
+ lib = true;
else
- local = TRUE;
+ local = true;
}
}
} FOREACH_NODETREE_END
@@ -1971,7 +1971,7 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
/* Make full copy.
* Note: previews are not copied here.
*/
- ltree = ntreeCopyTree_internal(ntree, NULL, FALSE, FALSE, FALSE);
+ ltree = ntreeCopyTree_internal(ntree, NULL, false, false, false);
ltree->flag |= NTREE_IS_LOCALIZED;
for (node = ltree->nodes.first; node; node = node->next) {
@@ -2028,7 +2028,7 @@ void ntreeLocalMerge(bNodeTree *localtree, bNodeTree *ntree)
if (ntree->typeinfo->local_merge)
ntree->typeinfo->local_merge(localtree, ntree);
- ntreeFreeTree_ex(localtree, FALSE);
+ ntreeFreeTree_ex(localtree, false);
MEM_freeN(localtree);
}
}
@@ -2170,7 +2170,7 @@ static void ntree_interface_identifier_base(bNodeTree *ntree, char *base)
{
/* generate a valid RNA identifier */
sprintf(base, "NodeTreeInterface_%s", ntree->id.name + 2);
- RNA_identifier_sanitize(base, FALSE);
+ RNA_identifier_sanitize(base, false);
}
/* check if the identifier is already in use */
@@ -2390,9 +2390,9 @@ bool nodeSetActiveID(bNodeTree *ntree, short idtype, ID *id)
for (node = ntree->nodes.first; node; node = node->next) {
if (node->id && GS(node->id->name) == idtype) {
- if (id && ok == FALSE && node->id == id) {
+ if (id && ok == false && node->id == id) {
node->flag |= NODE_ACTIVE_ID;
- ok = TRUE;
+ ok = true;
}
else {
node->flag &= ~NODE_ACTIVE_ID;
@@ -2543,7 +2543,7 @@ void BKE_node_clipboard_clear(void)
#endif
}
-/* return FALSE when one or more ID's are lost */
+/* return false when one or more ID's are lost */
bool BKE_node_clipboard_validate(void)
{
bool ok = true;
@@ -2763,10 +2763,10 @@ bool BKE_node_instance_hash_tag_key(bNodeInstanceHash *hash, bNodeInstanceKey ke
if (entry) {
entry->tag = 1;
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
void BKE_node_instance_hash_remove_untagged(bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp)
@@ -2803,7 +2803,7 @@ static int node_get_deplist_recurs(bNodeTree *ntree, bNode *node, bNode ***nsort
bNodeLink *link;
int level = 0xFFF;
- node->done = TRUE;
+ node->done = true;
/* check linked nodes */
for (link = ntree->links.first; link; link = link->next) {
@@ -2840,7 +2840,7 @@ void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, in
/* first clear data */
for (node = ntree->nodes.first; node; node = node->next) {
- node->done = FALSE;
+ node->done = false;
(*totnodes)++;
}
if (*totnodes == 0) {
@@ -2865,7 +2865,7 @@ static void ntree_update_node_level(bNodeTree *ntree)
/* first clear tag */
for (node = ntree->nodes.first; node; node = node->next) {
- node->done = FALSE;
+ node->done = false;
}
/* recursive check */
@@ -2937,7 +2937,7 @@ void ntreeUpdateTree(Main *bmain, bNodeTree *ntree)
/* avoid reentrant updates, can be caused by RNA update callbacks */
if (ntree->is_updating)
return;
- ntree->is_updating = TRUE;
+ ntree->is_updating = true;
if (ntree->update & (NTREE_UPDATE_LINKS | NTREE_UPDATE_NODES)) {
/* set the bNodeSocket->link pointers */
@@ -2985,7 +2985,7 @@ void ntreeUpdateTree(Main *bmain, bNodeTree *ntree)
}
ntree->update = 0;
- ntree->is_updating = FALSE;
+ ntree->is_updating = false;
}
void nodeUpdate(bNodeTree *ntree, bNode *node)
@@ -2993,7 +2993,7 @@ void nodeUpdate(bNodeTree *ntree, bNode *node)
/* avoid reentrant updates, can be caused by RNA update callbacks */
if (ntree->is_updating)
return;
- ntree->is_updating = TRUE;
+ ntree->is_updating = true;
if (node->typeinfo->updatefunc)
node->typeinfo->updatefunc(ntree, node);
@@ -3003,7 +3003,7 @@ void nodeUpdate(bNodeTree *ntree, bNode *node)
/* clear update flag */
node->update = 0;
- ntree->is_updating = FALSE;
+ ntree->is_updating = false;
}
bool nodeUpdateID(bNodeTree *ntree, ID *id)
@@ -3034,7 +3034,7 @@ bool nodeUpdateID(bNodeTree *ntree, ID *id)
nodeUpdateInternalLinks(ntree, node);
}
- ntree->is_updating = FALSE;
+ ntree->is_updating = false;
return changed;
}
@@ -3138,7 +3138,7 @@ static void node_type_base_defaults(bNodeType *ntype)
/* allow this node for any tree type */
static int node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *UNUSED(ntree))
{
- return TRUE;
+ return true;
}
/* use the basic poll function */
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 6a0ed272189..23af5bdf7ba 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1189,7 +1189,7 @@ SoftBody *copy_softbody(SoftBody *sb, bool copy_caches)
sbn = MEM_dupallocN(sb);
- if (copy_caches == FALSE) {
+ if (copy_caches == false) {
sbn->totspring = sbn->totpoint = 0;
sbn->bpoint = NULL;
sbn->bspring = NULL;
@@ -1292,7 +1292,7 @@ static ParticleSystem *copy_particlesystem(ParticleSystem *psys)
BLI_listbase_clear(&psysn->childcachebufs);
psysn->renderdata = NULL;
- psysn->pointcache = BKE_ptcache_copy_list(&psysn->ptcaches, &psys->ptcaches, FALSE);
+ psysn->pointcache = BKE_ptcache_copy_list(&psysn->ptcaches, &psys->ptcaches, false);
/* XXX - from reading existing code this seems correct but intended usage of
* pointcache should /w cloth should be added in 'ParticleSystem' - campbell */
@@ -1353,7 +1353,7 @@ void BKE_object_copy_particlesystems(Object *obn, Object *ob)
void BKE_object_copy_softbody(Object *obn, Object *ob)
{
if (ob->soft)
- obn->soft = copy_softbody(ob->soft, FALSE);
+ obn->soft = copy_softbody(ob->soft, false);
}
static void copy_object_pose(Object *obn, Object *ob)
@@ -1444,7 +1444,7 @@ void BKE_object_transform_copy(Object *ob_tar, const Object *ob_src)
copy_v3_v3(ob_tar->size, ob_src->size);
}
-Object *BKE_object_copy_ex(Main *bmain, Object *ob, int copy_caches)
+Object *BKE_object_copy_ex(Main *bmain, Object *ob, bool copy_caches)
{
Object *obn;
ModifierData *md;
@@ -1486,7 +1486,7 @@ Object *BKE_object_copy_ex(Main *bmain, Object *ob, int copy_caches)
BKE_pose_rebuild(obn, obn->data);
}
defgroup_copy_list(&obn->defbase, &ob->defbase);
- BKE_copy_constraints(&obn->constraints, &ob->constraints, TRUE);
+ BKE_copy_constraints(&obn->constraints, &ob->constraints, true);
obn->mode = 0;
obn->sculpt = NULL;
@@ -1532,7 +1532,7 @@ Object *BKE_object_copy_ex(Main *bmain, Object *ob, int copy_caches)
/* copy objects, will re-initialize cached simulation data */
Object *BKE_object_copy(Object *ob)
{
- return BKE_object_copy_ex(G.main, ob, FALSE);
+ return BKE_object_copy_ex(G.main, ob, false);
}
static void extern_local_object(Object *ob)
@@ -1555,7 +1555,7 @@ void BKE_object_make_local(Object *ob)
Main *bmain = G.main;
Scene *sce;
Base *base;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -1573,12 +1573,12 @@ void BKE_object_make_local(Object *ob)
else {
for (sce = bmain->scene.first; sce && ELEM(0, is_lib, is_local); sce = sce->id.next) {
if (BKE_scene_base_find(sce, ob)) {
- if (sce->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (sce->id.lib) is_lib = true;
+ else is_local = true;
}
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &ob->id);
extern_local_object(ob);
}
@@ -1721,7 +1721,7 @@ void BKE_object_make_proxy(Object *ob, Object *target, Object *gob)
mul_mat3_m4_v3(ob->obmat, tvec);
sub_v3_v3(ob->obmat[3], tvec);
}
- BKE_object_apply_mat4(ob, ob->obmat, FALSE, TRUE);
+ BKE_object_apply_mat4(ob, ob->obmat, false, true);
}
else {
BKE_object_transform_copy(ob, target);
@@ -1949,7 +1949,7 @@ void BKE_object_to_mat3(Object *ob, float mat[3][3]) /* no parent */
BKE_object_scale_to_mat3(ob, smat);
/* rot */
- BKE_object_rot_to_mat3(ob, rmat, TRUE);
+ BKE_object_rot_to_mat3(ob, rmat, true);
mul_m3_m3m3(mat, rmat, smat);
}
@@ -2431,7 +2431,7 @@ void BKE_object_apply_mat4(Object *ob, float mat[4][4], const bool use_compat, c
mul_m4_m4m4(diff_mat, parent_mat, ob->parentinv);
invert_m4_m4(imat, diff_mat);
mul_m4_m4m4(rmat, imat, mat); /* get the parent relative matrix */
- BKE_object_apply_mat4(ob, rmat, use_compat, FALSE);
+ BKE_object_apply_mat4(ob, rmat, use_compat, false);
/* same as below, use rmat rather than mat */
mat4_to_loc_rot_size(ob->loc, rot, ob->size, rmat);
@@ -2586,7 +2586,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
/* XXX pchan->bone may be NULL for duplicated bones, see duplicateEditBoneObjects() comment
* (editarmature.c:2592)... Skip in this case too! */
- if (pchan->bone && !((use_hidden == FALSE) && (PBONE_VISIBLE(arm, pchan->bone) == FALSE))) {
+ if (pchan->bone && !((use_hidden == false) && (PBONE_VISIBLE(arm, pchan->bone) == false))) {
mul_v3_m4v3(vec, ob->obmat, pchan->pose_head);
minmax_v3v3_v3(min_r, max_r, vec);
mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail);
@@ -3232,9 +3232,9 @@ static KeyBlock *insert_meshkey(Scene *scene, Object *ob, const char *name, cons
newkey = 1;
}
- if (newkey || from_mix == FALSE) {
+ if (newkey || from_mix == false) {
/* create from mesh */
- kb = BKE_keyblock_add_ctime(key, name, FALSE);
+ kb = BKE_keyblock_add_ctime(key, name, false);
BKE_key_convert_from_mesh(me, kb);
}
else {
@@ -3243,7 +3243,7 @@ static KeyBlock *insert_meshkey(Scene *scene, Object *ob, const char *name, cons
float *data = BKE_key_evaluate_object(scene, ob, &totelem);
/* create new block with prepared data */
- kb = BKE_keyblock_add_ctime(key, name, FALSE);
+ kb = BKE_keyblock_add_ctime(key, name, false);
kb->data = data;
kb->totelem = totelem;
}
@@ -3264,8 +3264,8 @@ static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, cons
newkey = 1;
}
- if (newkey || from_mix == FALSE) {
- kb = BKE_keyblock_add_ctime(key, name, FALSE);
+ if (newkey || from_mix == false) {
+ kb = BKE_keyblock_add_ctime(key, name, false);
if (!newkey) {
KeyBlock *basekb = (KeyBlock *)key->block.first;
kb->data = MEM_dupallocN(basekb->data);
@@ -3281,7 +3281,7 @@ static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, cons
float *data = BKE_key_evaluate_object(scene, ob, &totelem);
/* create new block with prepared data */
- kb = BKE_keyblock_add_ctime(key, name, FALSE);
+ kb = BKE_keyblock_add_ctime(key, name, false);
kb->totelem = totelem;
kb->data = data;
}
@@ -3303,9 +3303,9 @@ static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, con
newkey = 1;
}
- if (newkey || from_mix == FALSE) {
+ if (newkey || from_mix == false) {
/* create from curve */
- kb = BKE_keyblock_add_ctime(key, name, FALSE);
+ kb = BKE_keyblock_add_ctime(key, name, false);
if (!newkey) {
KeyBlock *basekb = (KeyBlock *)key->block.first;
kb->data = MEM_dupallocN(basekb->data);
@@ -3321,7 +3321,7 @@ static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, con
float *data = BKE_key_evaluate_object(scene, ob, &totelem);
/* create new block with prepared data */
- kb = BKE_keyblock_add_ctime(key, name, FALSE);
+ kb = BKE_keyblock_add_ctime(key, name, false);
kb->totelem = totelem;
kb->data = data;
}
diff --git a/source/blender/blenkernel/intern/object_deform.c b/source/blender/blenkernel/intern/object_deform.c
index f313c098f4b..e53bd26b9a2 100644
--- a/source/blender/blenkernel/intern/object_deform.c
+++ b/source/blender/blenkernel/intern/object_deform.c
@@ -144,16 +144,16 @@ bool *BKE_objdef_selected_get(Object *ob, int defbase_tot, int *r_dg_flags_sel_t
for (i = 0, defgroup = ob->defbase.first; i < defbase_tot && defgroup; defgroup = defgroup->next, i++) {
bPoseChannel *pchan = BKE_pose_channel_find_name(pose, defgroup->name);
if (pchan && (pchan->bone->flag & BONE_SELECTED)) {
- dg_selection[i] = TRUE;
+ dg_selection[i] = true;
(*r_dg_flags_sel_tot) += 1;
}
else {
- dg_selection[i] = FALSE;
+ dg_selection[i] = false;
}
}
}
else {
- memset(dg_selection, FALSE, sizeof(*dg_selection) * defbase_tot);
+ memset(dg_selection, false, sizeof(*dg_selection) * defbase_tot);
}
return dg_selection;
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c
index 3458f149aa2..6f278ae1244 100644
--- a/source/blender/blenkernel/intern/ocean.c
+++ b/source/blender/blenkernel/intern/ocean.c
@@ -1003,7 +1003,7 @@ static void cache_filename(char *string, const char *path, const char *relbase,
BLI_join_dirfile(cachepath, sizeof(cachepath), path, fname);
- BKE_makepicstring_from_type(string, cachepath, relbase, frame, R_IMF_IMTYPE_OPENEXR, 1, TRUE);
+ BKE_makepicstring_from_type(string, cachepath, relbase, frame, R_IMF_IMTYPE_OPENEXR, true, true);
}
/* silly functions but useful to inline when the args do a lot of indirections */
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index b120ec0d1f1..71504bb9fbe 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -253,7 +253,7 @@ void packAll(Main *bmain, ReportList *reports)
}
for (vfont = bmain->vfont.first; vfont; vfont = vfont->id.next) {
- if (vfont->packedfile == NULL && vfont->id.lib == NULL && BKE_vfont_is_builtin(vfont) == FALSE) {
+ if (vfont->packedfile == NULL && vfont->id.lib == NULL && BKE_vfont_is_builtin(vfont) == false) {
vfont->packedfile = newPackedFile(reports, vfont->name, bmain->name);
tot ++;
}
@@ -303,8 +303,9 @@ static char *find_new_name(char *name)
int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, int guimode)
{
- int file, number, remove_tmp = FALSE;
+ int file, number;
int ret_value = RET_OK;
+ bool remove_tmp = false;
char name[FILE_MAX];
char tempname[FILE_MAX];
/* void *data; */
@@ -319,7 +320,7 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i
BLI_snprintf(tempname, sizeof(tempname), "%s.%03d_", name, number);
if (!BLI_exists(tempname)) {
if (BLI_copy(name, tempname) == RET_OK) {
- remove_tmp = TRUE;
+ remove_tmp = true;
}
break;
}
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 4d84dd5fbb1..d7ae8e30698 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -348,7 +348,7 @@ bool paint_is_grid_face_hidden(const unsigned int *grid_hidden,
BLI_BITMAP_GET(grid_hidden, (y + 1) * gridsize + x));
}
-/* Return TRUE if all vertices in the face are visible, FALSE otherwise */
+/* Return true if all vertices in the face are visible, false otherwise */
bool paint_is_bmesh_face_hidden(BMFace *f)
{
BMLoop *l_iter;
@@ -418,12 +418,12 @@ static void sculptsession_bm_to_me_update_data_only(Object *ob, bool reorder)
}
if (reorder)
BM_log_mesh_elems_reorder(ss->bm, ss->bm_log);
- BM_mesh_bm_to_me(ss->bm, ob->data, FALSE);
+ BM_mesh_bm_to_me(ss->bm, ob->data, false);
}
}
}
-void sculptsession_bm_to_me(Object *ob, int reorder)
+void sculptsession_bm_to_me(Object *ob, bool reorder)
{
if (ob && ob->sculpt) {
sculptsession_bm_to_me_update_data_only(ob, reorder);
@@ -467,7 +467,7 @@ void free_sculptsession(Object *ob)
DerivedMesh *dm = ob->derivedFinal;
if (ss->bm) {
- sculptsession_bm_to_me(ob, TRUE);
+ sculptsession_bm_to_me(ob, true);
BM_mesh_free(ss->bm);
}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index fbad836f922..df7de5be6b6 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -843,7 +843,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
if (data->elems)
MEM_freeN(data->elems);
- data->do_simplify = TRUE;
+ data->do_simplify = true;
data->elems = elems;
data->index_mf_to_mpoly = index_mf_to_mpoly;
data->index_mp_to_orig = index_mp_to_orig;
@@ -974,7 +974,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
return newtot;
}
-int psys_render_simplify_params(ParticleSystem *psys, ChildParticle *cpa, float *params)
+bool psys_render_simplify_params(ParticleSystem *psys, ChildParticle *cpa, float *params)
{
ParticleRenderData *data;
ParticleRenderElem *elem;
@@ -3710,7 +3710,7 @@ void BKE_particlesettings_make_local(ParticleSettings *part)
{
Main *bmain = G.main;
Object *ob;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -3725,17 +3725,17 @@ void BKE_particlesettings_make_local(ParticleSettings *part)
}
/* test objects */
- for (ob = bmain->object.first; ob && ELEM(FALSE, is_lib, is_local); ob = ob->id.next) {
+ for (ob = bmain->object.first; ob && ELEM(false, is_lib, is_local); ob = ob->id.next) {
ParticleSystem *psys = ob->particlesystem.first;
for (; psys; psys = psys->next) {
if (psys->part == part) {
- if (ob->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ob->id.lib) is_lib = true;
+ else is_local = true;
}
}
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &part->id);
expand_local_particlesettings(part);
}
@@ -4103,7 +4103,7 @@ static void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *pte
}
}
/* get's hair (or keyed) particles state at the "path time" specified in state->time */
-void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *state, int vel)
+void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *state, const bool vel)
{
PARTICLE_PSMD;
ParticleSystem *psys = sim->psys;
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 5a81bbf01a8..119f7b0f939 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -1581,7 +1581,7 @@ void BKE_pbvh_raycast_project_ray_root (PBVH *bvh, bool original, float ray_star
typedef struct {
DMSetMaterial setMaterial;
- int wireframe;
+ bool wireframe;
} PBVHNodeDrawData;
void BKE_pbvh_node_draw(PBVHNode *node, void *data_v)
@@ -1678,7 +1678,7 @@ static void pbvh_node_check_diffuse_changed(PBVH *bvh, PBVHNode *node)
}
void BKE_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3],
- DMSetMaterial setMaterial, int wireframe)
+ DMSetMaterial setMaterial, bool wireframe)
{
PBVHNodeDrawData draw_data = {setMaterial, wireframe};
PBVHNode **nodes;
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 0ea554cf89d..7c4b687d412 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -225,7 +225,7 @@ static void pbvh_bmesh_node_split(PBVH *bvh, GHash *prim_bbc, int node_index)
}
/* Recursively split the node if it exceeds the leaf_limit */
-static int pbvh_bmesh_node_limit_ensure(PBVH *bvh, int node_index)
+static bool pbvh_bmesh_node_limit_ensure(PBVH *bvh, int node_index)
{
GHash *prim_bbc;
GHash *bm_faces;
@@ -238,7 +238,7 @@ static int pbvh_bmesh_node_limit_ensure(PBVH *bvh, int node_index)
bm_faces_size = BLI_ghash_size(bm_faces);
if (bm_faces_size <= bvh->leaf_limit) {
/* Node limit not exceeded */
- return FALSE;
+ return false;
}
/* For each BMFace, store the AABB and AABB centroid */
@@ -266,7 +266,7 @@ static int pbvh_bmesh_node_limit_ensure(PBVH *bvh, int node_index)
BLI_ghash_free(prim_bbc, NULL, NULL);
MEM_freeN(bbc_array);
- return TRUE;
+ return true;
}
/**********************************************************************/
@@ -765,10 +765,10 @@ static void pbvh_bmesh_split_edge(EdgeQueueContext *eq_ctx, PBVH *bvh,
BM_edge_kill(bvh->bm, e);
}
-static int pbvh_bmesh_subdivide_long_edges(EdgeQueueContext *eq_ctx, PBVH *bvh,
- BLI_Buffer *edge_loops)
+static bool pbvh_bmesh_subdivide_long_edges(EdgeQueueContext *eq_ctx, PBVH *bvh,
+ BLI_Buffer *edge_loops)
{
- int any_subdivided = FALSE;
+ bool any_subdivided = false;
while (!BLI_heap_is_empty(eq_ctx->q->heap)) {
BMVert **pair = BLI_heap_popmin(eq_ctx->q->heap);
@@ -796,7 +796,7 @@ static int pbvh_bmesh_subdivide_long_edges(EdgeQueueContext *eq_ctx, PBVH *bvh,
if (BM_edge_calc_length_squared(e) <= eq_ctx->q->limit_len_squared)
continue;
- any_subdivided = TRUE;
+ any_subdivided = true;
pbvh_bmesh_split_edge(eq_ctx, bvh, e, edge_loops);
}
@@ -940,14 +940,14 @@ static void pbvh_bmesh_collapse_edge(PBVH *bvh, BMEdge *e, BMVert *v1,
BM_vert_kill(bvh->bm, v2);
}
-static int pbvh_bmesh_collapse_short_edges(EdgeQueueContext *eq_ctx,
- PBVH *bvh,
- BLI_Buffer *edge_loops,
- BLI_Buffer *deleted_faces)
+static bool pbvh_bmesh_collapse_short_edges(EdgeQueueContext *eq_ctx,
+ PBVH *bvh,
+ BLI_Buffer *edge_loops,
+ BLI_Buffer *deleted_faces)
{
float min_len_squared = bvh->bm_min_edge_len * bvh->bm_min_edge_len;
GHash *deleted_verts;
- int any_collapsed = FALSE;
+ bool any_collapsed = false;
deleted_verts = BLI_ghash_ptr_new("deleted_verts");
@@ -982,7 +982,7 @@ static int pbvh_bmesh_collapse_short_edges(EdgeQueueContext *eq_ctx,
if (BM_edge_calc_length_squared(e) >= min_len_squared)
continue;
- any_collapsed = TRUE;
+ any_collapsed = true;
pbvh_bmesh_collapse_edge(bvh, e, v1, v2,
deleted_verts, edge_loops,
@@ -1523,7 +1523,7 @@ void pbvh_bmesh_verify(PBVH *bvh)
void *nip = BLI_ghashIterator_getValue(&gh_iter);
int ni = GET_INT_FROM_POINTER(nip);
PBVHNode *n = &bvh->nodes[ni];
- int found;
+ bool found;
/* Check that the vert's node is a leaf */
BLI_assert(n->flag & PBVH_Leaf);
@@ -1538,7 +1538,7 @@ void pbvh_bmesh_verify(PBVH *bvh)
* adjacent faces */
BM_ITER_ELEM (f, &bm_iter, v, BM_FACES_OF_VERT) {
if (BLI_ghash_lookup(bvh->bm_face_to_node, f) == nip) {
- found = TRUE;
+ found = true;
break;
}
}
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index df6534946fd..20107aa41a8 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1409,7 +1409,7 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
if (scene && (duplis-- > 0) && (ob->transflag & OB_DUPLI)) {
ListBase *lb_dupli_ob;
/* don't update the dupli groups, we only want their pid's */
- if ((lb_dupli_ob = object_duplilist_ex(G.main->eval_ctx, scene, ob, FALSE))) {
+ if ((lb_dupli_ob = object_duplilist_ex(G.main->eval_ctx, scene, ob, false))) {
DupliObject *dob;
for (dob= lb_dupli_ob->first; dob; dob= dob->next) {
if (dob->ob != ob) { /* avoids recursive loops with dupliframes: bug 22988 */
@@ -3039,7 +3039,7 @@ void BKE_ptcache_free_list(ListBase *ptcaches)
}
}
-static PointCache *ptcache_copy(PointCache *cache, int copy_data)
+static PointCache *ptcache_copy(PointCache *cache, bool copy_data)
{
PointCache *ncache;
@@ -3047,7 +3047,7 @@ static PointCache *ptcache_copy(PointCache *cache, int copy_data)
BLI_listbase_clear(&ncache->mem_cache);
- if (copy_data == FALSE) {
+ if (copy_data == false) {
ncache->cached_frames = NULL;
/* flag is a mix of user settings and simulator/baking state */
@@ -3082,7 +3082,7 @@ static PointCache *ptcache_copy(PointCache *cache, int copy_data)
}
/* returns first point cache */
-PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old, int copy_data)
+PointCache *BKE_ptcache_copy_list(ListBase *ptcaches_new, ListBase *ptcaches_old, bool copy_data)
{
PointCache *cache = ptcaches_old->first;
@@ -3144,7 +3144,8 @@ static void ptcache_dt_to_str(char *str, double dtime)
static void *ptcache_bake_thread(void *ptr)
{
- int use_timer = FALSE, sfra, efra;
+ bool use_timer = false;
+ int sfra, efra;
double stime, ptime, ctime, fetd;
char run[32], cur[32], etd[32];
@@ -3165,7 +3166,7 @@ static void *ptcache_bake_thread(void *ptr)
fetd = (ctime-ptime)*(efra-*data->cfra_ptr)/data->step;
if (use_timer || fetd > 60.0) {
- use_timer = TRUE;
+ use_timer = true;
ptcache_dt_to_str(cur, ctime-ptime);
ptcache_dt_to_str(run, ctime-stime);
@@ -3183,7 +3184,7 @@ static void *ptcache_bake_thread(void *ptr)
printf("\nBake %s %s (%i frames simulated).\n", (data->break_operation ? "canceled after" : "finished in"), run, *data->cfra_ptr-sfra);
}
- data->thread_ended = TRUE;
+ data->thread_ended = true;
return NULL;
}
@@ -3212,7 +3213,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
thread_data.scene = baker->scene;
thread_data.main = baker->main;
- G.is_break = FALSE;
+ G.is_break = false;
/* set caches to baking mode and figure out start frame */
if (pid) {
@@ -3304,8 +3305,8 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
CFRA = startframe;
scene->r.framelen = 1.0;
- thread_data.break_operation = FALSE;
- thread_data.thread_ended = FALSE;
+ thread_data.break_operation = false;
+ thread_data.thread_ended = false;
old_progress = -1;
WM_cursor_wait(1);
@@ -3317,7 +3318,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
BLI_init_threads(&threads, ptcache_bake_thread, 1);
BLI_insert_thread(&threads, (void*)&thread_data);
- while (thread_data.thread_ended == FALSE) {
+ while (thread_data.thread_ended == false) {
if (bake)
progress = (int)(100.0f * (float)(CFRA - startframe)/(float)(thread_data.endframe-startframe));
@@ -3335,7 +3336,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
/* NOTE: breaking baking should leave calculated frames in cache, not clear it */
if (blender_test_break() && !thread_data.break_operation) {
- thread_data.break_operation = TRUE;
+ thread_data.break_operation = true;
if (baker->progressend)
baker->progressend(baker->progresscontext);
WM_cursor_wait(1);
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index 3d0713f9514..90b5d8cf1a1 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -291,15 +291,15 @@ Report *BKE_reports_last_displayable(ReportList *reports)
return NULL;
}
-int BKE_reports_contain(ReportList *reports, ReportType level)
+bool BKE_reports_contain(ReportList *reports, ReportType level)
{
Report *report;
if (reports != NULL) {
for (report = reports->list.first; report; report = report->next)
if (report->type >= level)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool BKE_report_write_file_fp(FILE *fp, ReportList *reports, const char *header)
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 4b4cb054337..3f92f5881e4 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -762,7 +762,7 @@ RigidBodyWorld *BKE_rigidbody_world_copy(RigidBodyWorld *rbw)
if (rbwn->constraints)
id_us_plus(&rbwn->constraints->id);
- rbwn->pointcache = BKE_ptcache_copy_list(&rbwn->ptcaches, &rbw->ptcaches, FALSE);
+ rbwn->pointcache = BKE_ptcache_copy_list(&rbwn->ptcaches, &rbw->ptcaches, false);
rbwn->objects = NULL;
rbwn->physics_world = NULL;
@@ -1049,7 +1049,7 @@ static void rigidbody_update_sim_ob(Scene *scene, RigidBodyWorld *rbw, Object *o
/* make transformed objects temporarily kinmatic so that they can be moved by the user during simulation */
if (ob->flag & SELECT && G.moving & G_TRANSFORM_OBJ) {
- RB_body_set_kinematic_state(rbo->physics_object, TRUE);
+ RB_body_set_kinematic_state(rbo->physics_object, true);
RB_body_set_mass(rbo->physics_object, 0.0f);
}
@@ -1275,7 +1275,7 @@ void BKE_rigidbody_aftertrans_update(Object *ob, float loc[3], float rot[3], flo
if (rbo->physics_object) {
/* allow passive objects to return to original transform */
if (rbo->type == RBO_TYPE_PASSIVE)
- RB_body_set_kinematic_state(rbo->physics_object, TRUE);
+ RB_body_set_kinematic_state(rbo->physics_object, true);
RB_body_set_loc_rot(rbo->physics_object, rbo->pos, rbo->orn);
}
// RB_TODO update rigid body physics object's loc/rot for dynamic objects here as well (needs to be done outside bullet's update loop)
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index e501010fc56..9aca3ac87b6 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1582,7 +1582,7 @@ void BKE_scene_update_tagged(EvaluationContext *eval_ctx, Main *bmain, Scene *sc
/* notify editors and python about recalc */
BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_POST);
- DAG_ids_check_recalc(bmain, scene, FALSE);
+ DAG_ids_check_recalc(bmain, scene, false);
/* clear recalc flags */
DAG_ids_clear_recalc(bmain);
@@ -1665,7 +1665,7 @@ void BKE_scene_update_for_newframe_ex(EvaluationContext *eval_ctx, Main *bmain,
BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_POST);
BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_POST);
- DAG_ids_check_recalc(bmain, sce, TRUE);
+ DAG_ids_check_recalc(bmain, sce, true);
/* clear recalc flags */
DAG_ids_clear_recalc(bmain);
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index ab725ae04a9..f471580547c 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -261,7 +261,7 @@ void BKE_spacedata_draw_locks(int set)
if (set)
art->do_lock = art->lock;
else
- art->do_lock = FALSE;
+ art->do_lock = false;
}
}
}
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 9e59ec8d8d5..b5d4c00dca6 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -2068,7 +2068,7 @@ static void do_glow_effect_byte(Sequence *seq, int render_size, float facf0, flo
inbuf = MEM_mallocN(4 * sizeof(float) * x * y, "glow effect input");
outbuf = MEM_mallocN(4 * sizeof(float) * x * y, "glow effect output");
- IMB_buffer_float_from_byte(inbuf, rect1, IB_PROFILE_SRGB, IB_PROFILE_SRGB, FALSE, x, y, x, x);
+ IMB_buffer_float_from_byte(inbuf, rect1, IB_PROFILE_SRGB, IB_PROFILE_SRGB, false, x, y, x, x);
IMB_buffer_float_premultiply(inbuf, x, y);
RVIsolateHighlights_float(inbuf, outbuf, x, y, glow->fMini * 3.0f, glow->fBoost * facf0, glow->fClamp);
@@ -2077,7 +2077,7 @@ static void do_glow_effect_byte(Sequence *seq, int render_size, float facf0, flo
RVAddBitmaps_float(inbuf, outbuf, outbuf, x, y);
IMB_buffer_float_unpremultiply(outbuf, x, y);
- IMB_buffer_byte_from_float(out, outbuf, 4, 0.0f, IB_PROFILE_SRGB, IB_PROFILE_SRGB, FALSE, x, y, x, x);
+ IMB_buffer_byte_from_float(out, outbuf, 4, 0.0f, IB_PROFILE_SRGB, IB_PROFILE_SRGB, false, x, y, x, x);
MEM_freeN(inbuf);
MEM_freeN(outbuf);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index dbb865aa8ce..e834c017ea0 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -1580,7 +1580,7 @@ void BKE_sequencer_proxy_rebuild(SeqIndexBuildContext *context, short *stop, sho
}
*progress = (float) (cfra - seq->startdisp - seq->startstill) / (seq->enddisp - seq->endstill - seq->startdisp - seq->startstill);
- *do_update = TRUE;
+ *do_update = true;
if (*stop || G.is_break)
break;
@@ -2571,7 +2571,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
re = RE_NewRender(scene->id.name);
BKE_scene_update_for_newframe(context->eval_ctx, context->bmain, scene, scene->lay);
- RE_BlenderFrame(re, context->bmain, scene, NULL, camera, scene->lay, frame, FALSE);
+ RE_BlenderFrame(re, context->bmain, scene, NULL, camera, scene->lay, frame, false);
/* restore previous state after it was toggled on & off by RE_BlenderFrame */
G.is_rendering = is_rendering;
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 0035de0d825..275bd693518 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -197,7 +197,7 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
/*
* This function raycast a single vertex and updates the hit if the "hit" is considered valid.
- * Returns TRUE if "hit" was updated.
+ * Returns true if "hit" was updated.
* Opts control whether an hit is valid or not
* Supported options are:
* MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE (front faces hits are ignored)
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 5e7f1983fe8..f993d74959d 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -232,7 +232,7 @@ static void smoke_pos_to_cell(SmokeDomainSettings *sds, float pos[3])
}
/* set domain transformations and base resolution from object derivedmesh */
-static void smoke_set_domain_from_derivedmesh(SmokeDomainSettings *sds, Object *ob, DerivedMesh *dm, int init_resolution)
+static void smoke_set_domain_from_derivedmesh(SmokeDomainSettings *sds, Object *ob, DerivedMesh *dm, bool init_resolution)
{
size_t i;
float min[3] = {FLT_MAX, FLT_MAX, FLT_MAX}, max[3] = {-FLT_MAX, -FLT_MAX, -FLT_MAX};
@@ -317,7 +317,7 @@ static int smokeModifier_init(SmokeModifierData *smd, Object *ob, Scene *scene,
SmokeDomainSettings *sds = smd->domain;
int res[3];
/* set domain dimensions from derivedmesh */
- smoke_set_domain_from_derivedmesh(sds, ob, dm, TRUE);
+ smoke_set_domain_from_derivedmesh(sds, ob, dm, true);
/* reset domain values */
zero_v3_int(sds->shift);
zero_v3(sds->shift_f);
@@ -2468,7 +2468,7 @@ static void step(Scene *scene, Object *ob, SmokeModifierData *smd, DerivedMesh *
/* update object state */
invert_m4_m4(sds->imat, ob->obmat);
copy_m4_m4(sds->obmat, ob->obmat);
- smoke_set_domain_from_derivedmesh(sds, ob, domain_dm, (sds->flags & MOD_SMOKE_ADAPTIVE_DOMAIN));
+ smoke_set_domain_from_derivedmesh(sds, ob, domain_dm, (sds->flags & MOD_SMOKE_ADAPTIVE_DOMAIN) != 0);
/* use global gravity if enabled */
if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index fb5fc97fd46..a2fb66eb926 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -1688,7 +1688,7 @@ static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,
else
sb_threads[i].ifirst = 0;
sb_threads[i].do_effector = do_effector;
- sb_threads[i].do_deflector = FALSE;// not used here
+ sb_threads[i].do_deflector = false;// not used here
sb_threads[i].fieldfactor = 0.0f;// not used here
sb_threads[i].windfactor = 0.0f;// not used here
sb_threads[i].nr= i;
diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c
index 332eef17ae7..08daa09cc85 100644
--- a/source/blender/blenkernel/intern/speaker.c
+++ b/source/blender/blenkernel/intern/speaker.c
@@ -74,7 +74,7 @@ void BKE_speaker_make_local(Speaker *spk)
{
Main *bmain = G.main;
Object *ob;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -90,13 +90,13 @@ void BKE_speaker_make_local(Speaker *spk)
ob = bmain->object.first;
while (ob) {
if (ob->data == spk) {
- if (ob->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ob->id.lib) is_lib = true;
+ else is_local = true;
}
ob = ob->id.next;
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &spk->id);
}
else if (is_local && is_lib) {
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 4fc241b8ea5..946f92ff4d5 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -1742,7 +1742,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
if (ccgdm->pbvh && ccgdm->multires.mmd && !fast) {
if (dm->numTessFaceData) {
BKE_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL,
- setMaterial, FALSE);
+ setMaterial, false);
glShadeModel(GL_FLAT);
}
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 1d2caaa0640..22267c93680 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -996,7 +996,8 @@ void txt_move_left(Text *text, const bool sel)
void txt_move_right(Text *text, const bool sel)
{
TextLine **linep;
- int *charp, do_tab = FALSE, i;
+ int *charp, i;
+ bool do_tab = false;
if (!text) return;
if (sel) txt_curs_sel(text, &linep, &charp);
@@ -1013,10 +1014,10 @@ void txt_move_right(Text *text, const bool sel)
// do nice right only if there are only spaces
// spaces hardcoded in DNA_text_types.h
if (text->flags & TXT_TABSTOSPACES && (*linep)->line[*charp] == ' ') {
- do_tab = TRUE;
+ do_tab = true;
for (i = 0; i < *charp; i++)
if ((*linep)->line[i] != ' ') {
- do_tab = FALSE;
+ do_tab = false;
break;
}
}
@@ -2577,7 +2578,7 @@ static void txt_convert_tab_to_spaces(Text *text)
txt_insert_buf(text, sb);
}
-static int txt_add_char_intern(Text *text, unsigned int add, int replace_tabs)
+static bool txt_add_char_intern(Text *text, unsigned int add, bool replace_tabs)
{
char *tmp, ch[BLI_UTF8_MAX];
size_t add_len;
@@ -2620,12 +2621,12 @@ static int txt_add_char_intern(Text *text, unsigned int add, int replace_tabs)
return 1;
}
-int txt_add_char(Text *text, unsigned int add)
+bool txt_add_char(Text *text, unsigned int add)
{
- return txt_add_char_intern(text, add, text->flags & TXT_TABSTOSPACES);
+ return txt_add_char_intern(text, add, (text->flags & TXT_TABSTOSPACES) != 0);
}
-int txt_add_raw_char(Text *text, unsigned int add)
+bool txt_add_raw_char(Text *text, unsigned int add)
{
return txt_add_char_intern(text, add, 0);
}
@@ -2636,7 +2637,7 @@ void txt_delete_selected(Text *text)
txt_make_dirty(text);
}
-int txt_replace_char(Text *text, unsigned int add)
+bool txt_replace_char(Text *text, unsigned int add)
{
unsigned int del;
size_t del_size = 0, add_size;
@@ -2709,7 +2710,7 @@ void txt_indent(Text *text)
curc_old = text->curc;
num = 0;
- while (TRUE) {
+ while (true) {
/* don't indent blank lines */
if (text->curl->len != 0) {
@@ -2758,7 +2759,7 @@ void txt_unindent(Text *text)
int num = 0;
const char *remove = "\t";
int indentlen = 1;
- int unindented_first = FALSE;
+ bool unindented_first = false;
/* hardcoded: TXT_TABSIZE = 4 spaces: */
int spaceslen = TXT_TABSIZE;
@@ -2773,11 +2774,12 @@ void txt_unindent(Text *text)
indentlen = spaceslen;
}
- while (TRUE) {
+ while (true) {
int i = 0;
if (BLI_strncasecmp(text->curl->line, remove, indentlen) == 0) {
- if (num == 0) unindented_first = TRUE;
+ if (num == 0)
+ unindented_first = true;
while (i < text->curl->len) {
text->curl->line[i] = text->curl->line[i + indentlen];
i++;
@@ -2822,7 +2824,7 @@ void txt_comment(Text *text)
if (!text->sell) return; // Need to change this need to check if only one line is selected to more than one
num = 0;
- while (TRUE) {
+ while (true) {
tmp = MEM_mallocN(text->curl->len + 2, "textline_string");
text->curc = 0;
@@ -2869,7 +2871,7 @@ void txt_uncomment(Text *text)
if (!text->curl) return;
if (!text->sell) return;
- while (TRUE) {
+ while (true) {
int i = 0;
if (text->curl->line[i] == remove) {
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index d192ca71c12..d7248c521c4 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -789,7 +789,8 @@ void BKE_texture_make_local(Tex *tex)
Lamp *la;
Brush *br;
ParticleSettings *pa;
- int a, is_local = FALSE, is_lib = FALSE;
+ int a;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -808,8 +809,8 @@ void BKE_texture_make_local(Tex *tex)
while (ma) {
for (a = 0; a < MAX_MTEX; a++) {
if (ma->mtex[a] && ma->mtex[a]->tex == tex) {
- if (ma->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (ma->id.lib) is_lib = true;
+ else is_local = true;
}
}
ma = ma->id.next;
@@ -818,8 +819,8 @@ void BKE_texture_make_local(Tex *tex)
while (la) {
for (a = 0; a < MAX_MTEX; a++) {
if (la->mtex[a] && la->mtex[a]->tex == tex) {
- if (la->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (la->id.lib) is_lib = true;
+ else is_local = true;
}
}
la = la->id.next;
@@ -828,8 +829,8 @@ void BKE_texture_make_local(Tex *tex)
while (wrld) {
for (a = 0; a < MAX_MTEX; a++) {
if (wrld->mtex[a] && wrld->mtex[a]->tex == tex) {
- if (wrld->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (wrld->id.lib) is_lib = true;
+ else is_local = true;
}
}
wrld = wrld->id.next;
@@ -837,12 +838,12 @@ void BKE_texture_make_local(Tex *tex)
br = bmain->brush.first;
while (br) {
if (br->mtex.tex == tex) {
- if (br->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (br->id.lib) is_lib = true;
+ else is_local = true;
}
if (br->mask_mtex.tex == tex) {
- if (br->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (br->id.lib) is_lib = true;
+ else is_local = true;
}
br = br->id.next;
}
@@ -850,14 +851,14 @@ void BKE_texture_make_local(Tex *tex)
while (pa) {
for (a = 0; a < MAX_MTEX; a++) {
if (pa->mtex[a] && pa->mtex[a]->tex == tex) {
- if (pa->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (pa->id.lib) is_lib = true;
+ else is_local = true;
}
}
pa = pa->id.next;
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &tex->id);
extern_local_texture(tex);
}
@@ -1034,7 +1035,7 @@ Tex *give_current_material_texture(Material *ma)
return tex;
}
-int give_active_mtex(ID *id, MTex ***mtex_ar, short *act)
+bool give_active_mtex(ID *id, MTex ***mtex_ar, short *act)
{
switch (GS(id->name)) {
case ID_MA:
@@ -1056,10 +1057,10 @@ int give_active_mtex(ID *id, MTex ***mtex_ar, short *act)
default:
*mtex_ar = NULL;
if (act) *act = 0;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
void set_active_mtex(ID *id, short act)
@@ -1307,7 +1308,7 @@ PointDensity *BKE_add_pointdensity(void)
pd->falloff_curve->preset = CURVE_PRESET_LINE;
pd->falloff_curve->cm->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
curvemap_reset(pd->falloff_curve->cm, &pd->falloff_curve->clipr, pd->falloff_curve->preset, CURVEMAP_SLOPE_POSITIVE);
- curvemapping_changed(pd->falloff_curve, FALSE);
+ curvemapping_changed(pd->falloff_curve, false);
return pd;
}
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 3d24bc55fff..a96960c0345 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -2500,7 +2500,7 @@ void BKE_tracking_dopesheet_tag_update(MovieTracking *tracking)
{
MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
- dopesheet->ok = FALSE;
+ dopesheet->ok = false;
}
/* Do dopesheet update, if update is not needed nothing will happen. */
@@ -2523,5 +2523,5 @@ void BKE_tracking_dopesheet_update(MovieTracking *tracking)
/* frame coverage */
tracking_dopesheet_calc_coverage(tracking);
- dopesheet->ok = TRUE;
+ dopesheet->ok = true;
}
diff --git a/source/blender/blenkernel/intern/tracking_solver.c b/source/blender/blenkernel/intern/tracking_solver.c
index 5a28d8d264e..44a4c11ec92 100644
--- a/source/blender/blenkernel/intern/tracking_solver.c
+++ b/source/blender/blenkernel/intern/tracking_solver.c
@@ -456,7 +456,7 @@ static void reconstruct_update_solve_cb(void *customdata, double progress, const
if (progressdata->progress) {
*progressdata->progress = progress;
- *progressdata->do_update = TRUE;
+ *progressdata->do_update = true;
}
BLI_snprintf(progressdata->stats_message, progressdata->message_size, "Solving camera | %s", message);
diff --git a/source/blender/blenkernel/intern/tracking_stabilize.c b/source/blender/blenkernel/intern/tracking_stabilize.c
index 567386733a3..f198f686b52 100644
--- a/source/blender/blenkernel/intern/tracking_stabilize.c
+++ b/source/blender/blenkernel/intern/tracking_stabilize.c
@@ -245,7 +245,7 @@ static float stabilization_calculate_autoscale_factor(MovieTracking *tracking, i
stab->scale = 1.0f;
}
- stab->ok = TRUE;
+ stab->ok = true;
return stab->scale;
}
@@ -289,7 +289,7 @@ void BKE_tracking_stabilization_data_get(MovieTracking *tracking, int framenr, i
stabilization_calculate_data(tracking, framenr, width, height, firstmedian, median,
translation, scale, angle);
- stab->ok = TRUE;
+ stab->ok = true;
}
else {
stabilization_calculate_data(tracking, framenr, width, height, firstmedian, median,
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 00c51f5b52d..6a05014385d 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -471,7 +471,7 @@ static const char *unit_find_str(const char *str, const char *substr)
/* previous char cannot be a letter */
if (str_found == str ||
/* weak unicode support!, so "µm" won't match up be replaced by "m"
- * since non ascii utf8 values will NEVER return TRUE */
+ * since non ascii utf8 values will NEVER return true */
isalpha_or_utf8(*BLI_str_prev_char_utf8(str_found)) == 0)
{
/* next char cannot be alphanum */
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 0104efb4892..5065c3ae04f 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -75,7 +75,7 @@ void BKE_world_free_ex(World *wrld, bool do_id_user)
void BKE_world_free(World *wrld)
{
- BKE_world_free_ex(wrld, TRUE);
+ BKE_world_free_ex(wrld, true);
}
World *add_world(Main *bmain, const char *name)
@@ -166,7 +166,7 @@ void BKE_world_make_local(World *wrld)
{
Main *bmain = G.main;
Scene *sce;
- int is_local = FALSE, is_lib = FALSE;
+ bool is_local = false, is_lib = false;
/* - only lib users: do nothing
* - only local users: set flag
@@ -179,14 +179,14 @@ void BKE_world_make_local(World *wrld)
return;
}
- for (sce = bmain->scene.first; sce && ELEM(FALSE, is_lib, is_local); sce = sce->id.next) {
+ for (sce = bmain->scene.first; sce && ELEM(false, is_lib, is_local); sce = sce->id.next) {
if (sce->world == wrld) {
- if (sce->id.lib) is_lib = TRUE;
- else is_local = TRUE;
+ if (sce->id.lib) is_lib = true;
+ else is_local = true;
}
}
- if (is_local && is_lib == FALSE) {
+ if (is_local && is_lib == false) {
id_clear_lib_data(bmain, &wrld->id);
}
else if (is_local && is_lib) {
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 3ddbb9e45c4..fcfd4f9dd85 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -1142,7 +1142,7 @@ int BKE_ffmpeg_append(RenderData *rd, int start_frame, int frame, int *pixels, i
if (ffmpeg_autosplit) {
if (avio_tell(outfile->pb) > FFMPEG_AUTOSPLIT_SIZE) {
- end_ffmpeg_impl(TRUE);
+ end_ffmpeg_impl(true);
ffmpeg_autosplit_count++;
success &= start_ffmpeg_impl(rd, rectx, recty, reports);
}
@@ -1168,7 +1168,7 @@ static void end_ffmpeg_impl(int is_autosplit)
#endif
#ifdef WITH_AUDASPACE
- if (is_autosplit == FALSE) {
+ if (is_autosplit == false) {
if (audio_mixdown_device) {
AUD_closeReadDevice(audio_mixdown_device);
audio_mixdown_device = 0;
@@ -1240,7 +1240,7 @@ static void end_ffmpeg_impl(int is_autosplit)
void BKE_ffmpeg_end(void)
{
- end_ffmpeg_impl(FALSE);
+ end_ffmpeg_impl(false);
}
/* properties */
@@ -1609,17 +1609,17 @@ bool BKE_ffmpeg_alpha_channel_is_supported(RenderData *rd)
int codec = rd->ffcodecdata.codec;
if (codec == AV_CODEC_ID_QTRLE)
- return TRUE;
+ return true;
if (codec == AV_CODEC_ID_PNG)
- return TRUE;
+ return true;
#ifdef FFMPEG_FFV1_ALPHA_SUPPORTED
if (codec == AV_CODEC_ID_FFV1)
- return TRUE;
+ return true;
#endif
- return FALSE;
+ return false;
}
#endif
diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c
index acbbcb0b043..746b99ffb52 100644
--- a/source/blender/blenkernel/intern/writeframeserver.c
+++ b/source/blender/blenkernel/intern/writeframeserver.c
@@ -252,7 +252,7 @@ static int handle_request(RenderData *rd, char *req)
}
if (strcmp(path, "/close.txt") == 0) {
safe_puts(good_bye);
- G.is_break = TRUE; /* Abort render */
+ G.is_break = true; /* Abort render */
return -1;
}
return -1;