diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-19 17:28:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-19 17:28:19 +0400 |
commit | af3e348430218e609c80d86c8dd418bed15e70e8 (patch) | |
tree | a93e0453c8fe47a954594060cc5bbda90214a7f3 /source/blender/editors | |
parent | 2f5173887e0c7f6ba19664f16b177e575d82a241 (diff) |
code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars.
Diffstat (limited to 'source/blender/editors')
54 files changed, 243 insertions, 238 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 2e683d4d57b..dd9a0600725 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -2968,7 +2968,7 @@ static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poi Scene *scene = CTX_data_scene(C); PointerRNA id_ptr, ptr; PropertyRNA *prop; - short flag = 0, done = 0; + short flag = 0, done = FALSE; float cfra; /* get current frame */ @@ -3006,7 +3006,7 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi Scene *scene = CTX_data_scene(C); PointerRNA id_ptr, ptr; PropertyRNA *prop; - short flag = 0, done = 0; + short flag = 0, done = FALSE; float cfra; /* get current frame */ diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index df8c1d29079..159c4681951 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -840,7 +840,7 @@ static short rearrange_animchannel_islands(ListBase *list, AnimChanRearrangeFp r { ListBase islands = {NULL, NULL}; Link *channel, *chanNext = NULL; - short done = 0; + short done = FALSE; /* don't waste effort on an empty list */ if (list->first == NULL) @@ -866,7 +866,7 @@ static short rearrange_animchannel_islands(ListBase *list, AnimChanRearrangeFp r /* perform rearranging */ if (rearrange_func(&islands, island)) { island->flag |= REORDER_ISLAND_MOVED; - done = 1; + done = TRUE; } } } diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 0cc92394a40..416df6bccba 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -141,7 +141,7 @@ short ANIM_add_driver(ReportList *reports, ID *id, const char rna_path[], int ar PropertyRNA *prop; FCurve *fcu; int array_index_max; - int done = 0; + int done = FALSE; /* validate pointer first - exit if failure */ RNA_id_pointer_create(id, &id_ptr); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 7ce2988b067..ac5af846900 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -3325,9 +3325,9 @@ static int armature_extrude_exec(bContext *C, wmOperator *op) for (ebone = arm->edbo->first; ((ebone) && (ebone != first)); ebone = ebone->next) { if (EBONE_VISIBLE(arm, ebone)) { /* we extrude per definition the tip */ - do_extrude = 0; + do_extrude = FALSE; if (ebone->flag & (BONE_TIPSEL | BONE_SELECTED)) - do_extrude = 1; + do_extrude = TRUE; else if (ebone->flag & BONE_ROOTSEL) { /* but, a bone with parent deselected we do the root... */ if (ebone->parent && (ebone->parent->flag & BONE_TIPSEL)) ; @@ -3361,7 +3361,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op) totbone++; newbone = MEM_callocN(sizeof(EditBone), "extrudebone"); - if (do_extrude == 1) { + if (do_extrude == TRUE) { copy_v3_v3(newbone->head, ebone->tail); copy_v3_v3(newbone->tail, newbone->head); newbone->parent = ebone; diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index e9c960c4080..f18fa2f8bf8 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1451,7 +1451,7 @@ static int pose_group_assign_exec(bContext *C, wmOperator *op) ScrArea *sa = CTX_wm_area(C); Object *ob; bPose *pose; - short done = 0; + short done = FALSE; /* since this call may also be used from the buttons window, we need to check for where to get the object */ if (sa->spacetype == SPACE_BUTS) @@ -1476,7 +1476,7 @@ static int pose_group_assign_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) { pchan->agrp_index = pose->active_group; - done = 1; + done = TRUE; } CTX_DATA_END; @@ -1514,7 +1514,7 @@ static int pose_group_unassign_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa = CTX_wm_area(C); Object *ob; - short done = 0; + short done = FALSE; /* since this call may also be used from the buttons window, we need to check for where to get the object */ if (sa->spacetype == SPACE_BUTS) @@ -1531,7 +1531,7 @@ static int pose_group_unassign_exec(bContext *C, wmOperator *UNUSED(op)) { if (pchan->agrp_index) { pchan->agrp_index = 0; - done = 1; + done = TRUE; } } CTX_DATA_END; diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 316c4699c0b..3f056f9638c 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -1818,7 +1818,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold)) static void filterGraph(ReebGraph *rg, short options, float threshold_internal, float threshold_external) { - int done = 1; + int done = TRUE; calculateGraphLength(rg); @@ -1833,7 +1833,7 @@ static void filterGraph(ReebGraph *rg, short options, float threshold_internal, if (threshold_internal > 0 || threshold_external > 0) { /* filter until there's nothing more to do */ while (done == 1) { - done = 0; /* no work done yet */ + done = FALSE; /* no work done yet */ done = filterInternalExternalReebGraph(rg, threshold_internal, threshold_external); } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 82b6ef641b6..4f0274fbd46 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -5222,7 +5222,7 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA but->block->auto_open = FALSE; if (type == BUTTON_ACTIVATE_OVER) { - data->used_mouse = 1; + data->used_mouse = TRUE; } button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); @@ -5845,7 +5845,7 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut * else { if (ISKEYBOARD(event->type)) { /* keyboard menu hierarchy navigation, going back to previous level */ - but->active->used_mouse = 0; + but->active->used_mouse = FALSE; button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); } else { diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 958ee9f5420..4c2d86de502 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2679,7 +2679,7 @@ void ui_layout_add_but(uiLayout *layout, uiBut *but) if (layout->context) { but->context = layout->context; - but->context->used = 1; + but->context->used = TRUE; } } diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index f2a43580fd8..dfd2d0cc4d0 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -368,7 +368,7 @@ static void UI_OT_reset_default_button(wmOperatorType *ot) static int copy_to_selected_list(bContext *C, PointerRNA *ptr, ListBase *lb, int *use_path) { - *use_path = 0; + *use_path = FALSE; if (RNA_struct_is_a(ptr->type, &RNA_EditBone)) *lb = CTX_data_collection_get(C, "selected_editable_bones"); @@ -381,7 +381,7 @@ static int copy_to_selected_list(bContext *C, PointerRNA *ptr, ListBase *lb, int if (id && GS(id->name) == ID_OB) { *lb = CTX_data_collection_get(C, "selected_editable_objects"); - *use_path = 1; + *use_path = TRUE; } else return 0; diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index dc2c3b4eea9..cbe44505263 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -754,14 +754,14 @@ static int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag) } /* we interpolate */ - done = 0; + done = FALSE; ps = panelsort; for (a = 0; a < tot; a++, ps++) { if ((ps->pa->flag & PNL_SELECT) == 0) { if ((ps->orig->ofsx != ps->pa->ofsx) || (ps->orig->ofsy != ps->pa->ofsy)) { ps->orig->ofsx = floorf(0.5f + fac * (float)ps->pa->ofsx + (1.0f - fac) * (float)ps->orig->ofsx); ps->orig->ofsy = floorf(0.5f + fac * (float)ps->pa->ofsy + (1.0f - fac) * (float)ps->orig->ofsy); - done = 1; + done = TRUE; } } } diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 1589bbc123f..bf57dda44bf 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1746,7 +1746,7 @@ void init_userdef_do_versions(void) rgba_char_args_set_fl(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3); } - U.use_16bit_textures = 1; + U.use_16bit_textures = TRUE; } if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 2)) { diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index ed010dc973a..2eea7f50f33 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -419,14 +419,14 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) /* check if we should restore aspect ratio (if view size changed) */ if (v2d->keepzoom & V2D_KEEPASPECT) { - short do_x = 0, do_y = 0, do_cur /* , do_win */ /* UNUSED */; + short do_x = FALSE, do_y = FALSE, do_cur /* , do_win */ /* UNUSED */; float /* curRatio, */ /* UNUSED */ winRatio; /* when a window edge changes, the aspect ratio can't be used to * find which is the best new 'cur' rect. thats why it stores 'old' */ - if (winx != v2d->oldwinx) do_x = 1; - if (winy != v2d->oldwiny) do_y = 1; + if (winx != v2d->oldwinx) do_x = TRUE; + if (winy != v2d->oldwiny) do_y = TRUE; /* curRatio= height / width; */ /* UNUSED */ winRatio = winy / winx; @@ -435,11 +435,11 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) if (do_x == do_y) { if (do_x && do_y) { /* here is 1,1 case, so all others must be 0,0 */ - if (ABS(winx - v2d->oldwinx) > ABS(winy - v2d->oldwiny)) do_y = 0; - else do_x = 0; + if (ABS(winx - v2d->oldwinx) > ABS(winy - v2d->oldwiny)) do_y = FALSE; + else do_x = FALSE; } - else if (winRatio > 1.0f) do_x = 0; - else do_x = 1; + else if (winRatio > 1.0f) do_x = FALSE; + else do_x = TRUE; } do_cur = do_x; /* do_win= do_y; */ /* UNUSED */ diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index 63704f5b8e6..c223c146b4b 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -231,7 +231,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind MLoop *ml; MEdge *med; char *linkflag; - int a, b, doit = 1, mark = 0; + int a, b, do_it = TRUE, mark = 0; ehash = BLI_edgehash_new(); seamhash = BLI_edgehash_new(); @@ -259,8 +259,8 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind } } - while (doit) { - doit = 0; + while (do_it) { + do_it = FALSE; /* expand selection */ mp = me->mpoly; @@ -283,7 +283,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind if (mark) { linkflag[a] = 1; hash_add_face(ehash, mp, me->mloop + mp->loopstart); - doit = 1; + do_it = TRUE; } } } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 57f663aa571..1b3e4adff3a 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -722,7 +722,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent BMVert *v1; BMIter iter; float min[3], max[3]; - int done = 0; + int done = FALSE; short use_proj; em_setup_viewcontext(C, &vc); @@ -735,7 +735,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent BM_ITER_MESH (v1, &iter, vc.em->bm, BM_VERTS_OF_MESH) { if (BM_elem_flag_test(v1, BM_ELEM_SELECT)) { minmax_v3v3_v3(min, max, v1->co); - done = 1; + done = TRUE; } } @@ -753,7 +753,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent mval_f[1] = (float)event->mval[1]; /* check for edges that are half selected, use for rotation */ - done = 0; + done = FALSE; BM_ITER_MESH (eed, &iter, vc.em->bm, BM_EDGES_OF_MESH) { if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) { float co1[3], co2[3]; @@ -776,7 +776,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent nor[1] += -(co2[0] - co1[0]); } } - done = 1; + done = TRUE; } if (done) { diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 69aae5c4f06..fe5fafb0ca0 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -735,7 +735,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) if (BKE_scene_use_new_shading_nodes(scene)) { ED_node_shader_default(scene, &la->id); - la->use_nodes = 1; + la->use_nodes = TRUE; } return OPERATOR_FINISHED; @@ -901,7 +901,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); const short use_global = RNA_boolean_get(op->ptr, "use_global"); - /* int islamp= 0; */ /* UNUSED */ + /* int is_lamp = FALSE; */ /* UNUSED */ if (CTX_data_edit_object(C)) return OPERATOR_CANCELLED; @@ -909,7 +909,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN (C, Base *, base, selected_bases) { - /* if (base->object->type==OB_LAMP) islamp= 1; */ + /* if (base->object->type==OB_LAMP) is_lamp = TRUE; */ /* deselect object -- it could be used in other scenes */ base->object->flag &= ~SELECT; diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index cea9a0aae6b..b89562e772b 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -434,7 +434,7 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image *ima, MPassKnownData bkr->baked_faces++; if (bkr->do_update) - *bkr->do_update = 1; + *bkr->do_update = TRUE; if (bkr->progress) *bkr->progress = ((float)bkr->baked_objects + (float)bkr->baked_faces / tot_face) / bkr->tot_obj; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index c97ad9c62f9..107b19b0ed7 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -764,7 +764,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) Base *base; Curve *cu, *cu1; Nurb *nu; - int do_scene_sort = 0; + int do_scene_sort = FALSE; if (scene->id.lib) return; @@ -949,7 +949,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) /* Copy the constraint channels over */ copy_constraints(&base->object->constraints, &ob->constraints, TRUE); - do_scene_sort = 1; + do_scene_sort = TRUE; } else if (event == 23) { base->object->softflag = ob->softflag; @@ -1284,7 +1284,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) Curve *cu; Nurb *nu; int clear = (strcmp(op->idname, "OBJECT_OT_shade_flat") == 0); - int done = 0; + int done = FALSE; CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { @@ -1295,7 +1295,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); - done = 1; + done = TRUE; } else if (ELEM(ob->type, OB_SURF, OB_CURVE)) { cu = ob->data; @@ -1308,7 +1308,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); - done = 1; + done = TRUE; } } CTX_DATA_END; @@ -1369,7 +1369,7 @@ static void UNUSED_FUNCTION(image_aspect) (Scene * scene, View3D * v3d) for (base = FIRSTBASE; base; base = base->next) { if (TESTBASELIB(v3d, base)) { ob = base->object; - done = 0; + done = FALSE; for (a = 1; a <= ob->totcol; a++) { ma = give_current_material(ob, a); @@ -1398,7 +1398,7 @@ static void UNUSED_FUNCTION(image_aspect) (Scene * scene, View3D * v3d) if (x > y) ob->size[0] = ob->size[1] * x / y; else ob->size[1] = ob->size[0] * y / x; - done = 1; + done = TRUE; DAG_id_tag_update(&ob->id, OB_RECALC_OB); } } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 191677989b9..0aa7e1083c3 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1530,7 +1530,7 @@ static void oceanbake_update(void *customdata, float progress, int *cancel) if (oceanbake_breakjob(oj)) *cancel = 1; - *(oj->do_update) = 1; + *(oj->do_update) = TRUE; *(oj->progress) = progress; } @@ -1546,7 +1546,7 @@ static void oceanbake_startjob(void *customdata, short *stop, short *do_update, BKE_bake_ocean(oj->ocean, oj->och, oceanbake_update, (void *)oj); - *do_update = 1; + *do_update = TRUE; *stop = 0; } diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index b7dc3fd7bea..d618d17f797 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -429,7 +429,7 @@ void ED_object_generic_keymap(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyM RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit_falloff"); // Object mode - if (do_pet == 1) { + if (do_pet == TRUE) { kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_proportional_edit_objects"); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index b3e16c8d4eb..2b622b21d2c 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1108,7 +1108,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); unsigned int lay, local; - /* int islamp= 0; */ /* UNUSED */ + /* int is_lamp = FALSE; */ /* UNUSED */ lay = move_to_layer_init(C, op); lay &= 0xFFFFFF; @@ -1125,7 +1125,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) base->object->lay = lay; base->object->flag &= ~SELECT; base->flag &= ~SELECT; - /* if (base->object->type==OB_LAMP) islamp= 1; */ + /* if (base->object->type==OB_LAMP) is_lamp = TRUE; */ } CTX_DATA_END; } @@ -1138,7 +1138,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) local = base->lay & 0xFF000000; base->lay = lay + local; base->object->lay = lay; - /* if (base->object->type==OB_LAMP) islamp= 1; */ + /* if (base->object->type==OB_LAMP) is_lamp = TRUE; */ } CTX_DATA_END; } diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 5a56672f766..d9d5852eb6d 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -750,8 +750,8 @@ static void fluidbake_updatejob(void *customdata, float progress) { FluidBakeJob *fb= (FluidBakeJob *)customdata; - *(fb->do_update)= 1; - *(fb->progress)= progress; + *(fb->do_update) = TRUE; + *(fb->progress) = progress; } static void fluidbake_startjob(void *customdata, short *stop, short *do_update, float *progress) @@ -765,7 +765,7 @@ static void fluidbake_startjob(void *customdata, short *stop, short *do_update, G.afbreek= 0; /* XXX shared with render - replace with job 'stop' switch */ elbeemSimulate(); - *do_update= 1; + *do_update = TRUE; *stop = 0; } diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 595b51d22c4..7b4dda1a48f 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -340,7 +340,7 @@ static void image_renderinfo_cb(void *rjv, RenderStats *rs) RE_ReleaseResult(rj->re); /* make jobs timer to send notifier */ - *(rj->do_update) = 1; + *(rj->do_update) = TRUE; } @@ -352,7 +352,7 @@ static void render_progress_update(void *rjv, float progress) *rj->progress = progress; /* make jobs timer to send notifier */ - *(rj->do_update) = 1; + *(rj->do_update) = TRUE; } } @@ -372,7 +372,7 @@ static void image_rect_update(void *rjv, RenderResult *rr, volatile rcti *renrec image_buffer_rect_update(rj->scene, rr, ibuf, renrect); /* make jobs timer to send notifier */ - *(rj->do_update) = 1; + *(rj->do_update) = TRUE; } BKE_image_release_ibuf(ima, lock); } diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index f7024444e86..6357cb48a3d 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -473,7 +473,7 @@ static int ed_preview_draw_rect(ScrArea *sa, Scene *sce, ID *id, int split, int Render *re; RenderResult rres; char name[32]; - int do_gamma_correct = 0, do_predivide = 0; + int do_gamma_correct = FALSE, do_predivide = FALSE; int offx = 0, newx = rect->xmax - rect->xmin, newy = rect->ymax - rect->ymin; if (id && GS(id->name) != ID_TE) { @@ -583,7 +583,7 @@ static void shader_preview_draw(void *spv, RenderResult *UNUSED(rr), volatile st { ShaderPreview *sp = spv; - *(sp->do_update) = 1; + *(sp->do_update) = TRUE; } /* called by renderer, checks job value */ @@ -737,7 +737,7 @@ static void shader_preview_startjob(void *customdata, short *stop, short *do_upd else shader_preview_render(sp, sp->id, 0, 0); - *do_update = 1; + *do_update = TRUE; } static void shader_preview_free(void *customdata) @@ -910,7 +910,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat icon_copy_rect(ibuf, sp->sizex, sp->sizey, sp->pr_rect); - *do_update = 1; + *do_update = TRUE; } else if (idtype == ID_BR) { Brush *br = (Brush *)id; @@ -924,7 +924,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat icon_copy_rect(br->icon_imbuf, sp->sizex, sp->sizey, sp->pr_rect); - *do_update = 1; + *do_update = TRUE; } else { /* re-use shader job */ diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 95312c07df1..21cd02c96f2 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -379,7 +379,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op)) if (BKE_scene_use_new_shading_nodes(scene)) { ED_node_shader_default(scene, &ma->id); - ma->use_nodes = 1; + ma->use_nodes = TRUE; } } @@ -479,7 +479,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op)) if (BKE_scene_use_new_shading_nodes(scene)) { ED_node_shader_default(scene, &wo->id); - wo->use_nodes = 1; + wo->use_nodes = TRUE; } } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 0f286d91613..9771fef2d58 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -145,7 +145,7 @@ void ED_area_do_refresh(bContext *C, ScrArea *sa) if (sa->type && sa->type->refresh) { sa->type->refresh(C, sa); } - sa->do_refresh = 0; + sa->do_refresh = FALSE; } /* based on screen region draw tags, set draw tags in azones, and future region tabs etc */ @@ -162,7 +162,7 @@ void ED_area_overdraw_flush(ScrArea *sa, ARegion *ar) /* test if inside */ if (BLI_in_rcti(&ar->winrct, xs, ys)) { - az->do_draw = 1; + az->do_draw = TRUE; } } } @@ -384,7 +384,7 @@ void ED_area_overdraw(bContext *C) } } - az->do_draw = 0; + az->do_draw = FALSE; } } } @@ -487,7 +487,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar) ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_PIXEL); - ar->do_draw = 0; + ar->do_draw = FALSE; memset(&ar->drawrct, 0, sizeof(ar->drawrct)); uiFreeInactiveBlocks(C, &ar->uiblocks); @@ -559,7 +559,7 @@ void ED_area_tag_redraw_regiontype(ScrArea *sa, int regiontype) void ED_area_tag_refresh(ScrArea *sa) { if (sa) - sa->do_refresh = 1; + sa->do_refresh = TRUE; } /* *************************************************************** */ diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index d714f82b58b..3a2498d3fa2 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -421,7 +421,7 @@ bScreen *ED_screen_add(wmWindow *win, Scene *scene, const char *name) sc = BKE_libblock_alloc(&G.main->screen, ID_SCR, name); sc->scene = scene; - sc->do_refresh = 1; + sc->do_refresh = TRUE; sc->redraws_flag = TIME_ALL_3D_WIN | TIME_ALL_ANIM_WIN; sc->winid = win->winid; @@ -970,16 +970,16 @@ void ED_screen_do_listen(bContext *C, wmNotifier *note) switch (note->category) { case NC_WM: if (note->data == ND_FILEREAD) - win->screen->do_draw = 1; + win->screen->do_draw = TRUE; break; case NC_WINDOW: - win->screen->do_draw = 1; + win->screen->do_draw = TRUE; break; case NC_SCREEN: if (note->data == ND_SUBWINACTIVE) uiFreeActiveButtons(C, win->screen); if (note->action == NA_EDITED) - win->screen->do_draw = win->screen->do_refresh = 1; + win->screen->do_draw = win->screen->do_refresh = TRUE; break; case NC_SCENE: if (note->data == ND_MODE) @@ -1055,7 +1055,7 @@ void ED_screen_draw(wmWindow *win) glDisable(GL_BLEND); } - win->screen->do_draw = 0; + win->screen->do_draw = FALSE; } /* helper call for below, dpi changes headers */ @@ -1108,7 +1108,7 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win) if (G.debug & G_DEBUG_EVENTS) { printf("%s: set screen\n", __func__); } - win->screen->do_refresh = 0; + win->screen->do_refresh = FALSE; win->screen->context = ed_screen_context; } @@ -1276,11 +1276,11 @@ void ED_screen_set_subwinactive(bContext *C, wmEvent *event) if (oldswin != scr->subwinactive) { for (sa = scr->areabase.first; sa; sa = sa->next) { - int do_draw = 0; + int do_draw = FALSE; for (ar = sa->regionbase.first; ar; ar = ar->next) if (ar->swinid == oldswin || ar->swinid == scr->subwinactive) - do_draw = 1; + do_draw = TRUE; if (do_draw) { for (ar = sa->regionbase.first; ar; ar = ar->next) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 9cbe69d29da..e2a9bf37916 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1468,7 +1468,7 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event) } } - CTX_wm_window(C)->screen->do_draw = 1; + CTX_wm_window(C)->screen->do_draw = TRUE; } @@ -1913,7 +1913,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) ActKeyColumn *ak; float cfra; short next = RNA_boolean_get(op->ptr, "next"); - short done = 0; + short done = FALSE; /* sanity checks */ if (scene == NULL) @@ -1944,7 +1944,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) if (CFRA != (int)ak->cfra) { /* this changes the frame, so set the frame and we're done */ CFRA = (int)ak->cfra; - done = 1; + done = TRUE; } else { /* make this the new starting point for the search */ diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 256df21b79a..77289360f98 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -333,7 +333,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float sj->stop = stop; sj->do_update = do_update; - *do_update = 1; // wait for opengl rect + *do_update = TRUE; /* wait for opengl rect */ while (*stop == 0) { @@ -377,7 +377,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float MEM_freeN(sj->dumprect); sj->dumprect = NULL; - *do_update = 1; + *do_update = TRUE; rd.cfra++; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 9effba5b433..d5c7b66f695 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -2433,8 +2433,8 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* Note about IsectPoly2Df_twoside, checking the face or uv flipping doesnt work, * could check the poly direction but better to do this */ - if ((do_backfacecull && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) || - (do_backfacecull == 0 && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot))) + if ((do_backfacecull == TRUE && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) || + (do_backfacecull == FALSE && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot))) { has_x_isect = has_isect = 1; @@ -2453,7 +2453,9 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* Is this UV visible from the view? - raytrace */ /* project_paint_PickFace is less complex, use for testing */ //if (project_paint_PickFace(ps, pixelScreenCo, w, &side) == face_index) { - if (ps->do_occlude == 0 || !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) { + if ((ps->do_occlude == FALSE) || + !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) + { mask = project_paint_uvpixel_mask(ps, face_index, side, w); @@ -2629,8 +2631,9 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i pixelScreenCo[2] = pixelScreenCo[2] / pixelScreenCo[3]; /* Use the depth for bucket point occlusion */ } - if (ps->do_occlude == 0 || !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) { - + if ((ps->do_occlude == FALSE) || + !project_bucket_point_occluded(ps, bucketFaceNodes, face_index, pixelScreenCo)) + { /* Only bother calculating the weights if we intersect */ if (ps->do_mask_normal || ps->dm_mtface_clone) { #if 1 @@ -3005,7 +3008,7 @@ static void project_paint_begin(ProjPaintState *ps) ps->dm_mtface_clone = CustomData_get_layer_n(&ps->dm->faceData, CD_MTFACE, layer_num); if (ps->dm_mtface_clone == NULL || ps->dm_mtface_clone == ps->dm_mtface) { - ps->do_layer_clone = 0; + ps->do_layer_clone = FALSE; ps->dm_mtface_clone = NULL; printf("ACK!\n"); } @@ -3018,7 +3021,7 @@ static void project_paint_begin(ProjPaintState *ps) ps->dm_mtface_stencil = CustomData_get_layer_n(&ps->dm->faceData, CD_MTFACE, layer_num); if (ps->dm_mtface_stencil == NULL || ps->dm_mtface_stencil == ps->dm_mtface) { - ps->do_layer_stencil = 0; + ps->do_layer_stencil = FALSE; ps->dm_mtface_stencil = NULL; } } @@ -3850,7 +3853,7 @@ static void *do_projectpaint_thread(void *ph_v) float falloff; int bucket_index; int is_floatbuf = 0; - int use_color_correction = 0; + int use_color_correction = FALSE; const short tool = ps->tool; rctf bucket_bounds; @@ -4808,7 +4811,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps) ps->normal_angle_range = ps->normal_angle - ps->normal_angle_inner; if (ps->normal_angle_range <= 0.0f) - ps->do_mask_normal = 0; /* no need to do blending */ + ps->do_mask_normal = FALSE; /* no need to do blending */ } static void paint_brush_init_tex(Brush *brush) diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 5d63a223c08..5ed384d22af 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -277,7 +277,7 @@ static int console_move_exec(bContext *C, wmOperator *op) ConsoleLine *ci = console_history_verify(C); int type = RNA_enum_get(op->ptr, "type"); - int done = 0; + int done = FALSE; int pos; switch (type) { @@ -448,7 +448,7 @@ static int console_delete_exec(bContext *C, wmOperator *op) int stride; const short type = RNA_enum_get(op->ptr, "type"); - int done = 0; + int done = FALSE; if (ci->len == 0) { return OPERATOR_CANCELLED; @@ -466,7 +466,7 @@ static int console_delete_exec(bContext *C, wmOperator *op) if (stride) { memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - ci->cursor) + 1); ci->len -= stride; - done = 1; + done = TRUE; } } break; @@ -482,7 +482,7 @@ static int console_delete_exec(bContext *C, wmOperator *op) ci->cursor -= stride; /* same as above */ memmove(ci->line + ci->cursor, ci->line + ci->cursor + stride, (ci->len - ci->cursor) + 1); ci->len -= stride; - done = 1; + done = TRUE; } } break; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 107acbf49b1..d84214413da 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1299,7 +1299,7 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update, float limg->flags |= MOVIEFILE_ICON; } } - *do_update = 1; + *do_update = TRUE; PIL_sleep_ms(10); limg = limg->next; } @@ -1319,7 +1319,7 @@ static void thumbnails_update(void *tjv) tj->filelist->filelist[limg->index].flags &= ~MOVIEFILE; tj->filelist->filelist[limg->index].flags |= MOVIEFILE_ICON; } - limg->done=1; + limg->done = TRUE; } limg = limg->next; } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 97b6c32d81d..bf0d940c049 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -775,7 +775,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf bSensor *sens; bController *cont; unsigned int lay; - int a, nr, doit; + int a, nr, do_it; /* we need a sorted object list */ /* set scavisflags flags in Objects to indicate these should be evaluated */ @@ -815,9 +815,9 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf /* BUTS_XXX_STATE are similar to BUTS_XXX_LINK for selecting the object */ if (scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK|BUTS_SENS_STATE|BUTS_ACT_STATE)) { - doit= 1; - while (doit) { - doit= 0; + do_it = TRUE; + while (do_it) { + do_it = FALSE; ob= bmain->object.first; while (ob) { @@ -830,13 +830,13 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf if (sens->links[a]) { obt= (Object *)sens->links[a]->mynew; if (obt && (obt->scavisflag & OB_VIS_CONT)) { - doit= 1; + do_it = TRUE; ob->scavisflag |= OB_VIS_SENS; break; } } } - if (doit) break; + if (do_it) break; sens= sens->next; } } @@ -849,13 +849,13 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf if (cont->links[a]) { obt= (Object *)cont->links[a]->mynew; if (obt && (obt->scavisflag & OB_VIS_ACT)) { - doit= 1; + do_it = TRUE; ob->scavisflag |= OB_VIS_CONT; break; } } } - if (doit) break; + if (do_it) break; cont= cont->next; } } @@ -868,7 +868,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf if (sens->links[a]) { obt= (Object *)sens->links[a]->mynew; if (obt && (obt->scavisflag & OB_VIS_CONT)==0) { - doit= 1; + do_it = TRUE; obt->scavisflag |= OB_VIS_CONT; } } @@ -885,7 +885,7 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf if (cont->links[a]) { obt= (Object *)cont->links[a]->mynew; if (obt && (obt->scavisflag & OB_VIS_ACT)==0) { - doit= 1; + do_it = TRUE; obt->scavisflag |= OB_VIS_ACT; } } @@ -3333,7 +3333,7 @@ static void draw_sensor_joystick(uiLayout *layout, PointerRNA *ptr) uiItemR(layout, ptr, "use_all_events", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events") == FALSE); uiItemR(col, ptr, "button_number", 0, NULL, ICON_NONE); break; case SENS_JOY_AXIS: @@ -3343,7 +3343,7 @@ static void draw_sensor_joystick(uiLayout *layout, PointerRNA *ptr) uiItemR(layout, ptr, "use_all_events", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events") == FALSE); uiItemR(col, ptr, "axis_direction", 0, NULL, ICON_NONE); break; case SENS_JOY_HAT: @@ -3351,7 +3351,7 @@ static void draw_sensor_joystick(uiLayout *layout, PointerRNA *ptr) uiItemR(layout, ptr, "use_all_events", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_events") == FALSE); uiItemR(col, ptr, "hat_direction", 0, NULL, ICON_NONE); break; case SENS_JOY_AXIS_SINGLE: @@ -3371,13 +3371,13 @@ static void draw_sensor_keyboard(uiLayout *layout, PointerRNA *ptr) row = uiLayoutRow(layout, 0); uiItemL(row, "Key:", ICON_NONE); col = uiLayoutColumn(row, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_keys")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_keys") == FALSE); uiItemR(col, ptr, "key", UI_ITEM_R_EVENT, "", ICON_NONE); col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "use_all_keys", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_keys")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_all_keys") == FALSE); row = uiLayoutRow(col, 0); uiItemL(row, "First Modifier:", ICON_NONE); uiItemR(row, ptr, "modifier_key_1", UI_ITEM_R_EVENT, "", ICON_NONE); @@ -3843,7 +3843,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext col = uiLayoutColumn(row, 1); uiItemR(col, ptr, "use_force_distance", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); sub = uiLayoutColumn(col, 0); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_force_distance")==1); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_force_distance") == TRUE); uiItemR(sub, ptr, "distance", 0, "", ICON_NONE); uiItemR(layout, ptr, "damping", UI_ITEM_R_SLIDER, NULL, ICON_NONE); @@ -3976,7 +3976,7 @@ static void draw_actuator_filter_2d(uiLayout *layout, PointerRNA *ptr) case ACT_2DFILTER_MOTIONBLUR: split=uiLayoutSplit(layout, 0.75, 1); row= uiLayoutRow(split, 0); - uiLayoutSetActive(row, RNA_boolean_get(ptr, "use_motion_blur")==1); + uiLayoutSetActive(row, RNA_boolean_get(ptr, "use_motion_blur") == TRUE); uiItemR(row, ptr, "motion_blur_factor", 0, NULL, ICON_NONE); uiItemR(split, ptr, "use_motion_blur", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); break; @@ -4080,21 +4080,21 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr) col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "use_servo_limit_x", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); sub = uiLayoutColumn(col, 1); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_x")==1); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_x") == TRUE); uiItemR(sub, ptr, "force_max_x", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_min_x", 0, NULL, ICON_NONE); col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "use_servo_limit_y", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); sub = uiLayoutColumn(col, 1); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_y")==1); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_y") == TRUE); uiItemR(sub, ptr, "force_max_y", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_min_y", 0, NULL, ICON_NONE); col = uiLayoutColumn(row, 0); uiItemR(col, ptr, "use_servo_limit_z", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); sub = uiLayoutColumn(col, 1); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_z")==1); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_servo_limit_z") == TRUE); uiItemR(sub, ptr, "force_max_z", 0, NULL, ICON_NONE); uiItemR(sub, ptr, "force_min_z", 0, NULL, ICON_NONE); @@ -4122,7 +4122,7 @@ static void draw_actuator_parent(uiLayout *layout, PointerRNA *ptr) row = uiLayoutRow(layout, 0); uiItemR(row, ptr, "use_compound", 0, NULL, ICON_NONE); sub= uiLayoutRow(row, 0); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_compound")==1); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_compound") == TRUE); uiItemR(sub, ptr, "use_ghost", 0, NULL, ICON_NONE); } } @@ -4305,7 +4305,7 @@ static void draw_actuator_sound(uiLayout *layout, PointerRNA *ptr, bContext *C) uiItemR(layout, ptr, "use_sound_3d", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_sound_3d")==1); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_sound_3d") == TRUE); row = uiLayoutRow(col, 0); uiItemR(row, ptr, "gain_3d_min", 0, NULL, ICON_NONE); @@ -4565,7 +4565,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) subsplit= uiLayoutSplit(split, 0.85, 0); col= uiLayoutColumn(subsplit, 0); row= uiLayoutRow(col, 0); - uiLayoutSetActive(row, RNA_boolean_get(&settings_ptr, "use_all_states")==0); + uiLayoutSetActive(row, RNA_boolean_get(&settings_ptr, "use_all_states") == FALSE); uiTemplateLayers(row, &settings_ptr, "states_visible", &settings_ptr, "used_states", 0); row= uiLayoutRow(col, 0); uiTemplateLayers(row, &settings_ptr, "states_initial", &settings_ptr, "used_states", 0); diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 95a56176523..63e518e5aaa 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -335,11 +335,11 @@ static void nla_panel_properties(const bContext *C, Panel *pa) * - blend in/out can only be set when autoblending is off */ column = uiLayoutColumn(layout, 1); - uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence") == 0); + uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence") == FALSE); uiItemR(column, &strip_ptr, "use_auto_blend", 0, NULL, ICON_NONE); // XXX as toggle? sub = uiLayoutColumn(column, 1); - uiLayoutSetActive(sub, RNA_boolean_get(&strip_ptr, "use_auto_blend") == 0); + uiLayoutSetActive(sub, RNA_boolean_get(&strip_ptr, "use_auto_blend") == FALSE); uiItemR(sub, &strip_ptr, "blend_in", 0, NULL, ICON_NONE); uiItemR(sub, &strip_ptr, "blend_out", 0, NULL, ICON_NONE); @@ -383,7 +383,7 @@ static void nla_panel_actclip(const bContext *C, Panel *pa) /* action usage */ column = uiLayoutColumn(layout, 1); - uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_time") == 0); + uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_time") == FALSE); uiItemL(column, "Playback Settings:", ICON_NONE); uiItemR(column, &strip_ptr, "scale", 0, NULL, ICON_NONE); uiItemR(column, &strip_ptr, "repeat", 0, NULL, ICON_NONE); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index c12cd6f2d39..096c16298e3 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -676,7 +676,7 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View short indent = 0, offset = 0, sel = 0, group = 0, nonSolo = 0; int expand = -1, protect = -1, special = -1, mute = -1; char name[128]; - short doDraw = 0; + short do_draw = FALSE; /* determine what needs to be drawn */ switch (ale->type) { @@ -716,8 +716,8 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View sel = SEL_NLT(nlt); BLI_strncpy(name, nlt->name, sizeof(name)); - // draw manually still - doDraw = 1; + /* draw manually still */ + do_draw = TRUE; } break; case ANIMTYPE_NLAACTION: /* NLA Action-Line */ @@ -733,8 +733,8 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View else BLI_strncpy(name, "<No Action>", sizeof(name)); - // draw manually still - doDraw = 1; + /* draw manually still */ + do_draw = TRUE; } break; @@ -745,7 +745,7 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View } /* if special types, draw manually for now... */ - if (doDraw) { + if (do_draw) { if (ale->id) { /* special exception for textures */ if (GS(ale->id->name) == ID_TE) { diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 8a7e2a8a904..5c9994e46d3 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -503,7 +503,7 @@ static int nlaedit_add_transition_exec(bContext *C, wmOperator *op) bAnimListElem *ale; int filter; - int done = 0; + int done = FALSE; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -822,7 +822,7 @@ static int nlaedit_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) bAnimListElem *ale; int filter; - short done = 0; + short done = FALSE; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index ac12f2ffd31..d42393f3611 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1379,7 +1379,7 @@ static void node_composit_buts_defocus(uiLayout *layout, bContext *UNUSED(C), Po uiItemR(layout, ptr, "use_gamma_correction", 0, NULL, ICON_NONE); col = uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_zbuffer")==1); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_zbuffer") == TRUE); uiItemR(col, ptr, "f_stop", 0, NULL, ICON_NONE); uiItemR(layout, ptr, "blur_max", 0, NULL, ICON_NONE); @@ -1394,7 +1394,7 @@ static void node_composit_buts_defocus(uiLayout *layout, bContext *UNUSED(C), Po col = uiLayoutColumn(layout, 0); uiItemR(col, ptr, "use_zbuffer", 0, NULL, ICON_NONE); sub = uiLayoutColumn(col, 0); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_zbuffer")==0); + uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_zbuffer") == FALSE); uiItemR(sub, ptr, "z_scale", 0, NULL, ICON_NONE); } @@ -1456,7 +1456,7 @@ static void node_composit_buts_lensdist(uiLayout *layout, bContext *UNUSED(C), P uiItemR(col, ptr, "use_projector", 0, NULL, ICON_NONE); col = uiLayoutColumn(col, 0); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_projector")==0); + uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_projector") == FALSE); uiItemR(col, ptr, "use_jitter", 0, NULL, ICON_NONE); uiItemR(col, ptr, "use_fit", 0, NULL, ICON_NONE); } @@ -1627,7 +1627,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C) uiItemR(col, ptr, "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "use_unspill", 0, NULL, ICON_NONE); - if (RNA_boolean_get(ptr, "use_unspill")== 1) { + if (RNA_boolean_get(ptr, "use_unspill") == TRUE) { uiItemR(col, ptr, "unspill_red", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "unspill_green", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "unspill_blue", UI_ITEM_R_SLIDER, NULL, ICON_NONE); @@ -1818,7 +1818,7 @@ static void node_composit_buts_file_output_details(uiLayout *layout, bContext *C uiItemR(col, &active_input_ptr, "use_node_format", 0, NULL, 0); col= uiLayoutColumn(layout, 0); - uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_node_format")==0); + uiLayoutSetActive(col, RNA_boolean_get(&active_input_ptr, "use_node_format") == FALSE); uiTemplateImageSettings(col, &imfptr); } } @@ -2976,8 +2976,8 @@ void node_draw_link_straight(View2D *v2d, SpaceNode *snode, bNodeLink *link, int /* note; this is used for fake links in groups too */ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) { - int do_shaded= 0, th_col1= TH_HEADER, th_col2= TH_HEADER; - int do_triple= 0, th_col3= TH_WIRE; + int do_shaded= FALSE, th_col1= TH_HEADER, th_col2= TH_HEADER; + int do_triple= FALSE, th_col3= TH_WIRE; if (link->fromsock==NULL && link->tosock==NULL) return; @@ -2985,7 +2985,7 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) /* new connection */ if (!link->fromsock || !link->tosock) { th_col1 = TH_ACTIVE; - do_triple = 1; + do_triple = TRUE; } else { /* going to give issues once... */ @@ -2997,7 +2997,7 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) /* a bit ugly... but thats how we detect the internal group links */ if (!link->fromnode || !link->tonode) { UI_ThemeColorBlend(TH_BACK, TH_WIRE, 0.5f); - do_shaded= 0; + do_shaded = FALSE; } else { /* check cyclic */ @@ -3013,8 +3013,8 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) if (link->tonode->flag & SELECT) th_col2= TH_EDGE_SELECT; } - do_shaded= 1; - do_triple= 1; + do_shaded = TRUE; + do_triple = TRUE; } else { th_col1 = TH_REDALERT; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index f71ce3f960c..8847dc3650a 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -125,7 +125,7 @@ static void compo_redrawjob(void *cjv, char *UNUSED(str)) { CompoJob *cj= cjv; - *(cj->do_update)= 1; + *(cj->do_update) = TRUE; } static void compo_freejob(void *cjv) @@ -169,7 +169,7 @@ static void compo_startjob(void *cjv, short *stop, short *do_update, float *prog CompoJob *cj= cjv; bNodeTree *ntree= cj->localtree; - if (cj->scene->use_nodes==0) + if (cj->scene->use_nodes == FALSE) return; cj->stop= stop; @@ -2366,7 +2366,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) ntreeUpdateTree(snode->edittree); } else { - int do_update = 0; + int do_update = FALSE; for (linkdata=nldrag->links.first; linkdata; linkdata=linkdata->next) { link = linkdata->data; @@ -2377,11 +2377,12 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) link->tosock= NULL; snode->edittree->update |= NTREE_UPDATE_LINKS; - do_update = 1; + do_update = TRUE; } } - if (do_update) + if (do_update) { ntreeUpdateTree(snode->edittree); + } } } else { @@ -2408,7 +2409,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) ntreeUpdateTree(snode->edittree); } else { - int do_update = 0; + int do_update = FALSE; for (linkdata=nldrag->links.first; linkdata; linkdata=linkdata->next) { link = linkdata->data; @@ -2419,11 +2420,12 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) link->fromsock= NULL; snode->edittree->update |= NTREE_UPDATE_LINKS; - do_update = 1; + do_update = TRUE; } } - if (do_update) + if (do_update) { ntreeUpdateTree(snode->edittree); + } } } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 1590d08b4a1..2d1ba69cdd3 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -840,7 +840,7 @@ static int insert_gap(Scene *scene, int gap, int cfra) { Sequence *seq; Editing *ed = BKE_sequencer_editing_get(scene, FALSE); - int done = 0; + int done = FALSE; /* all strips >= cfra are shifted */ @@ -851,7 +851,7 @@ static int insert_gap(Scene *scene, int gap, int cfra) if (seq->startdisp >= cfra) { seq->start += gap; calc_sequence(scene, seq); - done = 1; + done = TRUE; } } SEQ_END @@ -971,7 +971,7 @@ static void UNUSED_FUNCTION(no_gaps) (Scene * scene) if (evaluate_seq_frame(scene, cfra) ) first = 1; } else { - done = 1; + done = TRUE; while (evaluate_seq_frame(scene, cfra) == 0) { done = insert_gap(scene, -1, cfra); if (done == 0) break; diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index a59570a09e1..811a89b07a8 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -1100,7 +1100,7 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq) actseq->tmp = SET_INT_IN_POINTER(TRUE); - for (seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) { + for (seq_begin(ed, &iter, TRUE); iter.valid; seq_next(&iter)) { seq = iter.seq; /* Ignore all seqs already selected! */ @@ -1129,7 +1129,7 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq) /* Unfortunately, we must restart checks from the beginning. */ seq_end(&iter); - seq_begin(ed, &iter, 1); + seq_begin(ed, &iter, TRUE); } /* Video strips bellow active one, or any strip for audio (order do no matters here!). */ diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 04408173928..3ebc4eb974c 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2888,7 +2888,7 @@ static int text_insert_exec(bContext *C, wmOperator *op) SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); char *str; - int done = 0; + int done = FALSE; size_t i = 0; unsigned int code; diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 9e44d5207c0..01d27aaa0b3 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -354,7 +354,7 @@ static void time_draw_keyframes(const bContext *C, SpaceTime *stime, ARegion *ar time_draw_idblock_keyframes(v2d, (ID *)ob, onlysel); } else { - short active_done = 0; + short active_done = FALSE; /* draw keyframes from all selected objects */ CTX_DATA_BEGIN (C, Object *, obsel, selected_objects) @@ -364,7 +364,7 @@ static void time_draw_keyframes(const bContext *C, SpaceTime *stime, ARegion *ar /* if this object is the active one, set flag so that we don't draw again */ if (obsel == ob) - active_done = 1; + active_done = TRUE; } CTX_DATA_END; diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 2211b1ddb62..6a070070379 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1667,7 +1667,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, GLfloat tmp; float smat[4][4], imat[4][4], bmat[4][4]; int index = -1; - short do_dashed = 3, draw_wire = 0; + short do_dashed = 3, draw_wire = FALSE; int flag; /* being set below */ diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index b5c44fd1a8c..de1d9f22667 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -233,7 +233,7 @@ static Material *give_current_material_or_def(Object *ob, int matnr) static struct TextureDrawState { Object *ob; - int islit, istex; + int is_lit, is_tex; int color_profile; unsigned char obcol[4]; } Gtexdraw = {NULL, 0, 0, 0, {0, 0, 0, 0}}; @@ -263,12 +263,12 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m c_has_texface = -1; } else { - textured = gtexdraw.istex; + textured = gtexdraw.is_tex; litob = gtexdraw.ob; } /* convert number of lights into boolean */ - if (gtexdraw.islit) lit = 1; + if (gtexdraw.is_lit) lit = 1; if (ma) { alphablend = ma->game.alpha_blend; @@ -343,7 +343,7 @@ static int set_draw_settings_cached(int clearcache, MTFace *texface, Material *m static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob) { unsigned char obcol[4]; - int istex, solidtex; + int is_tex, solidtex; // XXX scene->obedit warning @@ -351,27 +351,27 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O * with face selection in weight paint is not lit. */ if ((v3d->drawtype <= OB_WIRE) && (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT))) { solidtex = FALSE; - Gtexdraw.islit = 0; + Gtexdraw.is_lit = 0; } else if (v3d->drawtype == OB_SOLID || ((ob->mode & OB_MODE_EDIT) && v3d->drawtype != OB_TEXTURE)) { /* draw with default lights in solid draw mode and edit mode */ solidtex = TRUE; - Gtexdraw.islit = -1; + Gtexdraw.is_lit = -1; } else { /* draw with lights in the scene otherwise */ solidtex = FALSE; - Gtexdraw.islit = GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp); + Gtexdraw.is_lit = GPU_scene_object_lights(scene, ob, v3d->lay, rv3d->viewmat, !rv3d->is_persp); } rgba_float_to_uchar(obcol, ob->col); glCullFace(GL_BACK); glEnable(GL_CULL_FACE); - if (solidtex || v3d->drawtype == OB_TEXTURE) istex = 1; - else istex = 0; + if (solidtex || v3d->drawtype == OB_TEXTURE) is_tex = 1; + else is_tex = 0; Gtexdraw.ob = ob; - Gtexdraw.istex = istex; + Gtexdraw.is_tex = is_tex; Gtexdraw.color_profile = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT; memcpy(Gtexdraw.obcol, obcol, sizeof(obcol)); set_draw_settings_cached(1, NULL, NULL, Gtexdraw); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 00622f368f0..e69538345bb 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1967,7 +1967,7 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob) Lattice *lt = ob->data; DispList *dl; int u, v, w; - int use_wcol = 0, is_edit = (lt->editlatt != NULL); + int use_wcol = FALSE, is_edit = (lt->editlatt != NULL); /* now we default make displist, this will modifiers work for non animated case */ if (ob->disp.first == NULL) @@ -3543,7 +3543,7 @@ static int draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D Object *obedit = scene->obedit; Mesh *me = ob->data; BMEditMesh *em = me->edit_btmesh; - int do_alpha_after = 0, drawlinked = 0, retval = 0, glsl, check_alpha, i; + int do_alpha_after = FALSE, drawlinked = 0, retval = 0, glsl, check_alpha, i; /* If we are drawing shadows and any of the materials don't cast a shadow, * then don't draw the object */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index d9126b3809a..f18ba29b1f4 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1848,7 +1848,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas /* generate displist, test for new object */ if (dob_prev && dob_prev->ob != dob->ob) { - if (use_displist == 1) + if (use_displist == TRUE) glDeleteLists(displist, 1); use_displist = -1; @@ -1870,7 +1870,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas !(bb_tmp = BKE_object_boundbox_get(dob->ob))) { // printf("draw_dupli_objects_color: skipping displist for %s\n", dob->ob->id.name+2); - use_displist = 0; + use_displist = FALSE; } else { // printf("draw_dupli_objects_color: using displist for %s\n", dob->ob->id.name+2); @@ -1886,7 +1886,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR); glEndList(); - use_displist = 1; + use_displist = TRUE; BKE_object_boundbox_flag(dob->ob, OB_BB_DISABLED, 0); } } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 4bfb6dd9fd6..8ba0d75c786 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2051,7 +2051,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in int center = RNA_boolean_get(op->ptr, "center"); float size, min[3], max[3], afm[3]; - int ok = 1, onedone = 0; + int ok = 1, onedone = FALSE; if (center) { /* in 2.4x this also move the cursor to (0, 0, 0) (with shift+c). */ @@ -2066,7 +2066,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in for (base = scene->base.first; base; base = base->next) { if (BASE_VISIBLE(v3d, base)) { - onedone = 1; + onedone = TRUE; if (skip_camera && base->object == v3d->camera) { continue; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 583736716c6..0bbd03c10bb 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -405,7 +405,7 @@ static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, int BLI_lasso_is_point_inside(data->mcords, data->moves, x1, y1, IS_CLIPPED)) { BM_edge_select_set(data->vc->em->bm, eed, data->select); - data->done = 1; + data->done = TRUE; } } else { @@ -443,7 +443,7 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves, data.mcords = mcords; data.moves = moves; data.select = select; - data.done = 0; + data.done = FALSE; data.pass = 0; if (extend == 0 && select) @@ -1180,19 +1180,19 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int View3D *v3d = vc->v3d; Base *base, *basact = NULL; static int lastmval[2] = {-100, -100}; - int a, donearest = 0; + int a, do_nearest = FALSE; /* define if we use solid nearest select or not */ if (v3d->drawtype > OB_WIRE) { - donearest = 1; + do_nearest = TRUE; if (ABS(mval[0] - lastmval[0]) < 3 && ABS(mval[1] - lastmval[1]) < 3) { if (!has_bones) /* hrms, if theres bones we always do nearest */ - donearest = 0; + do_nearest = FALSE; } } lastmval[0] = mval[0]; lastmval[1] = mval[1]; - if (donearest) { + if (do_nearest) { unsigned int min = 0xFFFFFFFF; int selcol = 0, notcol = 0; @@ -1623,7 +1623,7 @@ static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, int x0 if (data->pass == 0) { if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)) { BM_edge_select_set(data->vc->em->bm, eed, data->select); - data->done = 1; + data->done = TRUE; } } else { @@ -1651,7 +1651,7 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten data.rect = rect; data.select = select; data.pass = 0; - data.done = 0; + data.done = FALSE; if (extend == 0 && select) EDBM_flag_disable_all(vc->em, BM_ELEM_SELECT); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index d07ae468f35..4573e66ca39 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2111,7 +2111,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td) bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_ROTLIMIT); bConstraintOb cob; bConstraint *con; - int dolimit = 0; + int do_limit = FALSE; /* Evaluate valid constraints */ for (con= td->con; con; con= con->next) { @@ -2133,9 +2133,9 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td) continue; /* only do conversion if necessary, to preserve quats and eulers */ - if (!dolimit) { + if (do_limit == FALSE) { constraintob_from_transdata(&cob, td); - dolimit= 1; + do_limit = TRUE; } /* do space conversions */ @@ -2157,7 +2157,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td) } } - if (dolimit) { + if (do_limit) { /* copy results from cob->matrix */ if (td->ext->rotOrder == ROT_MODE_QUAT) { /* quats */ @@ -5438,10 +5438,10 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d, /* snap key to nearest frame? */ if (autosnap == SACTSNAP_FRAME) { -#if 0 /* 'doTime' disabled for now */ +#if 0 /* 'do_time' disabled for now */ const Scene *scene= t->scene; - const short doTime= 0; //getAnimEdit_DrawTime(t); // NOTE: this works, but may be confusing behavior given the option's label, hence disabled + const short do_time= 0; //getAnimEdit_DrawTime(t); // NOTE: this works, but may be confusing behavior given the option's label, hence disabled const double secf= FPS; #endif double val; @@ -5452,10 +5452,10 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d, else val= *(td->val); -#if 0 /* 'doTime' disabled for now */ +#if 0 /* 'do_time' disabled for now */ /* do the snapping to nearest frame/second */ - if (doTime) { + if (do_time) { val= (float)(floor((val/secf) + 0.5f) * secf); } else @@ -5540,19 +5540,19 @@ static void headerTimeTranslate(TransInfo *t, char *str) else { const Scene *scene = t->scene; const short autosnap= getAnimEdit_SnapMode(t); - const short doTime = getAnimEdit_DrawTime(t); + const short do_time = getAnimEdit_DrawTime(t); const double secf= FPS; float val = t->values[0]; /* apply snapping + frame->seconds conversions */ if (autosnap == SACTSNAP_STEP) { - if (doTime) + if (do_time) val= floorf((double)val/secf + 0.5f); else val= floorf(val + 0.5f); } else { - if (doTime) + if (do_time) val= (float)((double)val / secf); } @@ -5572,7 +5572,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) Scene *scene = t->scene; int i; - const short doTime= getAnimEdit_DrawTime(t); + const short do_time= getAnimEdit_DrawTime(t); const double secf= FPS; const short autosnap= getAnimEdit_SnapMode(t); @@ -5594,7 +5594,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) deltax = t->values[0]; if (autosnap == SACTSNAP_STEP) { - if (doTime) + if (do_time) deltax= (float)(floor((deltax/secf) + 0.5f) * secf); else deltax= (float)(floor(deltax + 0.5f)); @@ -5608,7 +5608,7 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) deltax = val = t->values[0]; if (autosnap == SACTSNAP_STEP) { - if (doTime) + if (do_time) val= (float)(floor((deltax/secf) + 0.5f) * secf); else val= (float)(floor(val + 0.5f)); @@ -5846,7 +5846,7 @@ static void applyTimeScale(TransInfo *t) int i; const short autosnap= getAnimEdit_SnapMode(t); - const short doTime= getAnimEdit_DrawTime(t); + const short do_time= getAnimEdit_DrawTime(t); const double secf= FPS; @@ -5860,7 +5860,7 @@ static void applyTimeScale(TransInfo *t) float fac= t->values[0]; if (autosnap == SACTSNAP_STEP) { - if (doTime) + if (do_time) fac= (float)(floor(fac/secf + 0.5f) * secf); else fac= (float)(floor(fac + 0.5f)); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index c9eb975cb77..dad1c65298a 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4599,45 +4599,45 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, } } else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) { - short doLoc=0, doRot=0, doScale=0; + short do_loc = FALSE, do_rot = FALSE, do_scale = FALSE; /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ if (tmode == TFM_TRANSLATION) { - doLoc = 1; + do_loc = TRUE; } else if (tmode == TFM_ROTATION) { if (v3d->around == V3D_ACTIVE) { if (ob != OBACT) - doLoc = 1; + do_loc = TRUE; } else if (v3d->around == V3D_CURSOR) - doLoc = 1; + do_loc = TRUE; if ((v3d->flag & V3D_ALIGN)==0) - doRot = 1; + do_rot = TRUE; } else if (tmode == TFM_RESIZE) { if (v3d->around == V3D_ACTIVE) { if (ob != OBACT) - doLoc = 1; + do_loc = TRUE; } else if (v3d->around == V3D_CURSOR) - doLoc = 1; + do_loc = TRUE; if ((v3d->flag & V3D_ALIGN)==0) - doScale = 1; + do_scale = TRUE; } /* insert keyframes for the affected sets of channels using the builtin KeyingSets found */ - if (doLoc) { + if (do_loc) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_LOCATION_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } - if (doRot) { + if (do_rot) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_ROTATION_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } - if (doScale) { + if (do_scale) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_SCALING_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } @@ -4720,39 +4720,39 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o } /* only insert keyframe if needed? */ else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) { - short doLoc=0, doRot=0, doScale=0; + short do_loc = FALSE, do_rot = FALSE, do_scale = FALSE; /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ if (tmode == TFM_TRANSLATION) { if (targetless_ik) - doRot= 1; + do_rot = TRUE; else - doLoc = 1; + do_loc = TRUE; } else if (tmode == TFM_ROTATION) { if (ELEM(v3d->around, V3D_CURSOR, V3D_ACTIVE)) - doLoc = 1; + do_loc = TRUE; if ((v3d->flag & V3D_ALIGN)==0) - doRot = 1; + do_rot = TRUE; } else if (tmode == TFM_RESIZE) { if (ELEM(v3d->around, V3D_CURSOR, V3D_ACTIVE)) - doLoc = 1; + do_loc = TRUE; if ((v3d->flag & V3D_ALIGN)==0) - doScale = 1; + do_scale = TRUE; } - if (doLoc) { + if (do_loc) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_LOCATION_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } - if (doRot) { + if (do_rot) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_ROTATION_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } - if (doScale) { + if (do_scale) { KeyingSet *ks= ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_SCALING_ID); ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); } diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index a869af56537..7d0e9dd6005 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -662,9 +662,9 @@ static void partial_doughnut(float radring, float radhole, int start, int end, i float cos_theta, sin_theta; float cos_theta1, sin_theta1; float ring_delta, side_delta; - int i, j, docaps= 1; + int i, j, do_caps = TRUE; - if (start==0 && end==nrings) docaps= 0; + if (start == 0 && end == nrings) do_caps = FALSE; ring_delta= 2.0f*(float)M_PI/(float)nrings; side_delta= 2.0f*(float)M_PI/(float)nsides; @@ -678,7 +678,7 @@ static void partial_doughnut(float radring, float radhole, int start, int end, i cos_theta1= (float)cos(theta1); sin_theta1= (float)sin(theta1); - if (docaps && i==start) { // cap + if (do_caps && i==start) { // cap glBegin(GL_POLYGON); phi= 0.0; for (j= nsides; j >= 0; j--) { @@ -710,7 +710,7 @@ static void partial_doughnut(float radring, float radhole, int start, int end, i glEnd(); } - if (docaps && i==end) { // cap + if (do_caps && i==end) { // cap glBegin(GL_POLYGON); phi= 0.0; for (j= nsides; j >= 0; j--) { diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 04207643aa4..91f62291450 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -476,7 +476,7 @@ static int count_bone_select(bArmature *arm, ListBase *lb, int do_it) if (bone->flag & BONE_SELECTED) { bone->flag |= BONE_TRANSFORM; total++; - do_next= 0; // no transform on children if one parent bone is selected + do_next = FALSE; // no transform on children if one parent bone is selected } } } diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index ac0f8306259..9aaccb57fe2 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -209,19 +209,19 @@ static void undo_clean_stack(bContext *C) uel = undobase.first; while (uel) { void *editdata = uel->getdata(C); - int isvalid = 0; + int is_valid = FALSE; next = uel->next; /* for when objects are converted, renamed, or global undo changes pointers... */ if (uel->type == obedit->type) { if (strcmp(uel->id.name, obedit->id.name) == 0) { if (uel->validate_undo == NULL) - isvalid = 1; + is_valid = TRUE; else if (uel->validate_undo(uel->undodata, editdata)) - isvalid = 1; + is_valid = TRUE; } } - if (isvalid) + if (is_valid) uel->ob = obedit; else { if (uel == curundo) diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index cd88614f8fe..e7a9ab9ca73 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -165,15 +165,15 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) } } else { - int do_glob_undo = 0; + int do_glob_undo = FALSE; if (obact && obact->mode & OB_MODE_TEXTURE_PAINT) { if (!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname)) - do_glob_undo = 1; + do_glob_undo = TRUE; } else if (obact && obact->mode & OB_MODE_SCULPT) { if (!ED_undo_paint_step(C, UNDO_PAINT_MESH, step, undoname)) - do_glob_undo = 1; + do_glob_undo = TRUE; } else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) { if (step == 1) @@ -182,7 +182,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) PE_redo(CTX_data_scene(C)); } else { - do_glob_undo = 1; + do_glob_undo = TRUE; } if (do_glob_undo) { diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index b30821dc56a..872f959b8a2 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -827,7 +827,7 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final) UvEdge *edge = state->edges + i; if ((state->uvs[edge->uv1]->flag & STITCH_STITCHABLE) && (state->uvs[edge->uv2]->flag & STITCH_STITCHABLE)) { stitch_island_calculate_edge_rotation(edge, state, final_position, uvfinal_map, island_stitch_data); - island_stitch_data[state->uvs[edge->uv1]->island].use_edge_rotation = 1; + island_stitch_data[state->uvs[edge->uv1]->island].use_edge_rotation = TRUE; } } |