diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-21 19:48:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-21 19:53:48 +0400 |
commit | 4ae7ae6f2e49287f4565b8bd6bec486f37a826af (patch) | |
tree | fad0aeb96fdd585951bb775262dd1f97193830a4 /source/blender/editors | |
parent | 70ce11d640e0a85c863db08f269167a75c0eb251 (diff) |
Code Cleanup: use bool for return values and correct comments
also remove CDDM_Check, theres no need for it.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 8 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 6 | ||||
-rw-r--r-- | source/blender/editors/include/ED_node.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_uvedit.h | 8 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_intern.h | 6 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_select.c | 6 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_add.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 12 |
15 files changed, 33 insertions, 33 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 75363f4f567..4b807059e4a 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -149,9 +149,9 @@ static void acf_generic_dataexpand_backdrop(bAnimContext *ac, bAnimListElem *ale } /* helper method to test if group colors should be drawn */ -static short acf_show_channel_colors(bAnimContext *ac) +static bool acf_show_channel_colors(bAnimContext *ac) { - short showGroupColors = 0; + bool showGroupColors = false; if (ac->sl) { switch (ac->spacetype) { @@ -179,7 +179,7 @@ static void acf_generic_channel_color(bAnimContext *ac, bAnimListElem *ale, floa bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale); bActionGroup *grp = NULL; short indent = (acf->get_indent_level) ? acf->get_indent_level(ac, ale) : 0; - short showGroupColors = acf_show_channel_colors(ac); + bool showGroupColors = acf_show_channel_colors(ac); if (ale->type == ANIMTYPE_FCURVE) { FCurve *fcu = (FCurve *)ale->data; @@ -751,7 +751,7 @@ static bAnimChannelType ACF_OBJECT = static void acf_group_color(bAnimContext *ac, bAnimListElem *ale, float r_color[3]) { bActionGroup *agrp = (bActionGroup *)ale->data; - short showGroupColors = acf_show_channel_colors(ac); + bool showGroupColors = acf_show_channel_colors(ac); if (showGroupColors && agrp->customCol) { unsigned char cp[3]; diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 2cf8d9c27af..462e0b527fe 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -153,7 +153,7 @@ enum { /* minimum length of new segment before new point can be added */ #define MIN_EUCLIDEAN_PX (U.gp_euclideandist) -static int gp_stroke_added_check(tGPsdata *p) +static bool gp_stroke_added_check(tGPsdata *p) { return (p->gpf && p->gpf->strokes.last && p->flags & GP_PAINTFLAG_STROKEADDED); } @@ -196,7 +196,7 @@ static int gpencil_draw_poll(bContext *C) } /* check if projecting strokes into 3d-geometry in the 3D-View */ -static int gpencil_project_check(tGPsdata *p) +static bool gpencil_project_check(tGPsdata *p) { bGPdata *gpd = p->gpd; return ((gpd->sbuffer_sflag & GP_STROKE_3DSPACE) && (p->gpd->flag & (GP_DATA_DEPTH_VIEW | GP_DATA_DEPTH_STROKE))); @@ -1791,7 +1791,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event } /* gpencil modal operator stores area, which can be removed while using it (like fullscreen) */ -static int gpencil_area_exists(bContext *C, ScrArea *sa_test) +static bool gpencil_area_exists(bContext *C, ScrArea *sa_test) { bScreen *sc = CTX_wm_screen(C); return (BLI_findindex(&sc->areabase, sa_test) != -1); diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index de83df9cc05..2f4528c2c7f 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -98,7 +98,7 @@ int ED_node_is_texture(struct SpaceNode *snode); void ED_node_shader_default(const struct bContext *C, struct ID *id); void ED_node_composit_default(const struct bContext *C, struct Scene *scene); void ED_node_texture_default(const struct bContext *C, struct Tex *tex); -int ED_node_select_check(ListBase *lb); +bool ED_node_select_check(ListBase *lb); void ED_node_post_apply_transform(struct bContext *C, struct bNodeTree *ntree); void ED_node_set_active(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node); diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index 735227ae9b5..572042a0150 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -53,10 +53,10 @@ void ED_keymap_uvedit(struct wmKeyConfig *keyconf); void ED_uvedit_assign_image(struct Main *bmain, struct Scene *scene, struct Object *obedit, struct Image *ima, struct Image *previma); bool ED_uvedit_minmax(struct Scene *scene, struct Image *ima, struct Object *obedit, float min[2], float max[2]); -int ED_object_get_active_image(struct Object *ob, int mat_nr, struct Image **ima, struct ImageUser **iuser, struct bNode **node); +bool ED_object_get_active_image(struct Object *ob, int mat_nr, struct Image **ima, struct ImageUser **iuser, struct bNode **node); void ED_object_assign_active_image(struct Main *bmain, struct Object *ob, int mat_nr, struct Image *ima); -int ED_uvedit_test(struct Object *obedit); +bool ED_uvedit_test(struct Object *obedit); /* visibility and selection */ bool uvedit_face_visible_test(struct Scene *scene, struct Image *ima, struct BMFace *efa, struct MTexPoly *tf); @@ -88,8 +88,8 @@ void uvedit_uv_select_enable(struct BMEditMesh *em, struct Scene *scene, struct void uvedit_uv_select_disable(struct BMEditMesh *em, struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset); -int ED_uvedit_nearest_uv(struct Scene *scene, struct Object *obedit, struct Image *ima, - const float co[2], float r_uv[2]); +bool ED_uvedit_nearest_uv(struct Scene *scene, struct Object *obedit, struct Image *ima, + const float co[2], float r_uv[2]); /* uvedit_unwrap_ops.c */ void ED_uvedit_live_unwrap_begin(struct Scene *scene, struct Object *obedit); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 70292bb4e6b..e98a04fea37 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1188,7 +1188,7 @@ void uiDrawBlock(const bContext *C, uiBlock *block) /** * Check if the button is pushed, this is only meaningful for some button types. * - * \return (0 == UNSELECT), (1 == SELECT), (-1 == DO-NOHING) + * \return (0 == UNSELECT), (1 == SELECT), (-1 == DO-NOTHING) */ int ui_is_but_push_ex(uiBut *but, double *value) { diff --git a/source/blender/editors/mask/mask_intern.h b/source/blender/editors/mask/mask_intern.h index 51705aa5837..09ca2290781 100644 --- a/source/blender/editors/mask/mask_intern.h +++ b/source/blender/editors/mask/mask_intern.h @@ -96,9 +96,9 @@ void MASK_OT_select_linked(struct wmOperatorType *ot); void MASK_OT_select_more(struct wmOperatorType *ot); void MASK_OT_select_less(struct wmOperatorType *ot); -int ED_mask_spline_select_check(struct MaskSpline *spline); -int ED_mask_layer_select_check(struct MaskLayer *masklay); -int ED_mask_select_check(struct Mask *mask); +bool ED_mask_spline_select_check(struct MaskSpline *spline); +bool ED_mask_layer_select_check(struct MaskLayer *masklay); +bool ED_mask_select_check(struct Mask *mask); void ED_mask_spline_select_set(struct MaskSpline *spline, const short do_select); void ED_mask_layer_select_set(struct MaskLayer *masklay, const short do_select); diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index 613168e43a6..497aea27b26 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -55,7 +55,7 @@ #include "mask_intern.h" /* own include */ /* 'check' select */ -int ED_mask_spline_select_check(MaskSpline *spline) +bool ED_mask_spline_select_check(MaskSpline *spline) { int i; @@ -69,7 +69,7 @@ int ED_mask_spline_select_check(MaskSpline *spline) return FALSE; } -int ED_mask_layer_select_check(MaskLayer *masklay) +bool ED_mask_layer_select_check(MaskLayer *masklay) { MaskSpline *spline; @@ -86,7 +86,7 @@ int ED_mask_layer_select_check(MaskLayer *masklay) return FALSE; } -int ED_mask_select_check(Mask *mask) +bool ED_mask_select_check(Mask *mask) { MaskLayer *masklay; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 9051b20a4d6..f9e366a2646 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -176,7 +176,7 @@ int ED_operator_objectmode(bContext *C) } -static int ed_spacetype_test(bContext *C, int type) +static bool ed_spacetype_test(bContext *C, int type) { if (ED_operator_areaactive(C)) { SpaceLink *sl = (SpaceLink *)CTX_wm_space_data(C); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 9c9b8d84a21..70eb2619415 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -80,7 +80,7 @@ /* check if we can do partial updates and have them draw realtime * (without rebuilding the 'derivedFinal') */ -static int vertex_paint_use_fast_update_check(Object *ob) +static bool vertex_paint_use_fast_update_check(Object *ob) { DerivedMesh *dm = ob->derivedFinal; @@ -97,7 +97,7 @@ static int vertex_paint_use_fast_update_check(Object *ob) /* if the polygons from the mesh and the 'derivedFinal' match * we can assume that no modifiers are applied and that its worth adding tessellated faces * so 'vertex_paint_use_fast_update_check()' returns TRUE */ -static int vertex_paint_use_tessface_check(Object *ob, Mesh *me) +static bool vertex_paint_use_tessface_check(Object *ob, Mesh *me) { DerivedMesh *dm = ob->derivedFinal; diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 8b98f7ce5e6..5e7a5690acd 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -308,7 +308,7 @@ static void draw_fcurve_vertices(SpaceIpo *sipo, ARegion *ar, FCurve *fcu, short /* Handles ---------------- */ -static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu) +static bool draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu) { /* don't draw handle lines if handles are not to be shown */ if ( (sipo->flag & SIPO_NOHANDLES) || /* handles shouldn't be shown anywhere */ diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 66054042305..6df6b6bf0ff 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -929,7 +929,7 @@ typedef enum eGraphVertIndex { /* check if its ok to select a handle */ // XXX also need to check for int-values only? -static int fcurve_handle_sel_check(SpaceIpo *sipo, BezTriple *bezt) +static bool fcurve_handle_sel_check(SpaceIpo *sipo, BezTriple *bezt) { if (sipo->flag & SIPO_NOHANDLES) return 0; if ((sipo->flag & SIPO_SELVHANDLESONLY) && BEZSELECTED(bezt) == 0) return 0; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index c7a89811573..28027e74f13 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -2103,7 +2103,7 @@ void IMAGE_OT_invert(wmOperatorType *ot) /********************* pack operator *********************/ -static int image_pack_test(bContext *C, wmOperator *op) +static bool image_pack_test(bContext *C, wmOperator *op) { Image *ima = CTX_data_edit_image(C); int as_png = RNA_boolean_get(op->ptr, "as_png"); diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c index 2f9f63575fe..a1b1b453ee0 100644 --- a/source/blender/editors/space_node/node_add.c +++ b/source/blender/editors/space_node/node_add.c @@ -100,7 +100,7 @@ bNode *node_add_node(const bContext *C, const char *idname, int type, float locx } /* ********************** Add reroute operator ***************** */ -static int add_reroute_intersect_check(bNodeLink *link, float mcoords[][2], int tot, float result[2]) +static bool add_reroute_intersect_check(bNodeLink *link, float mcoords[][2], int tot, float result[2]) { float coord_array[NODE_LINK_RESOL + 1][2]; int i, b; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index a1d5a1b9b81..d6e85457ae0 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1255,7 +1255,7 @@ void NODE_OT_duplicate(wmOperatorType *ot) RNA_def_boolean(ot->srna, "keep_inputs", 0, "Keep Inputs", "Keep the input links to duplicated nodes"); } -int ED_node_select_check(ListBase *lb) +bool ED_node_select_check(ListBase *lb) { diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index b5bcd8158e1..7c8a0f24f0b 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -91,7 +91,7 @@ static void uv_select_flush_from_tag_loop(SpaceImage *sima, Scene *scene, Object /************************* state testing ************************/ -int ED_uvedit_test(Object *obedit) +bool ED_uvedit_test(Object *obedit) { BMEditMesh *em; int ret; @@ -132,12 +132,12 @@ static int UNUSED_FUNCTION(ED_operator_uvmap_mesh) (bContext *C) } /**************************** object active image *****************************/ -static int is_image_texture_node(bNode *node) +static bool is_image_texture_node(bNode *node) { return ELEM(node->type, SH_NODE_TEX_IMAGE, SH_NODE_TEX_ENVIRONMENT); } -int ED_object_get_active_image(Object *ob, int mat_nr, Image **ima, ImageUser **iuser, bNode **node_r) +bool ED_object_get_active_image(Object *ob, int mat_nr, Image **ima, ImageUser **iuser, bNode **node_r) { Material *ma = give_current_material(ob, mat_nr); bNode *node = (ma && ma->use_nodes) ? nodeGetActiveTexture(ma->nodetree) : NULL; @@ -866,7 +866,7 @@ void uv_find_nearest_vert(Scene *scene, Image *ima, BMEditMesh *em, } } -int ED_uvedit_nearest_uv(Scene *scene, Object *obedit, Image *ima, const float co[2], float r_uv[2]) +bool ED_uvedit_nearest_uv(Scene *scene, Object *obedit, Image *ima, const float co[2], float r_uv[2]) { BMEditMesh *em = BKE_editmesh_from_object(obedit); BMFace *efa; @@ -875,7 +875,7 @@ int ED_uvedit_nearest_uv(Scene *scene, Object *obedit, Image *ima, const float c MTexPoly *tf; MLoopUV *luv; float mindist, dist; - int found = FALSE; + bool found = false; const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY); @@ -896,7 +896,7 @@ int ED_uvedit_nearest_uv(Scene *scene, Object *obedit, Image *ima, const float c mindist = dist; copy_v2_v2(r_uv, luv->uv); - found = TRUE; + found = true; } } } |