diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-27 16:21:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-27 16:21:13 +0400 |
commit | 2ab62ce126651c600a8039de0dd95a4e3c02ea47 (patch) | |
tree | 7bd05d0ffa253332de7328d77e0d712fea6ae880 /source/blender/editors | |
parent | aa6301674471500f74d3984d6d17d82ad5e8724f (diff) |
code cleanup: defines with braces - end with '(void)0' so callers must end with ';' like normal function.
... without this some editors dont parse the source so well.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/reeb.c | 4 | ||||
-rw-r--r-- | source/blender/editors/include/ED_keyframes_edit.h | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 32 | ||||
-rw-r--r-- | source/blender/editors/object/object_shapekey.c | 2 |
4 files changed, 22 insertions, 22 deletions
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index a629312e732..20b95ea55d6 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -475,8 +475,8 @@ static void NodeDegreeIncrement(ReebGraph *UNUSED(rg), ReebNode *node) } #else -#define NodeDegreeDecrement(rg, node) {node->degree--; } -#define NodeDegreeIncrement(rg, node) {node->degree++; } +# define NodeDegreeDecrement(rg, node) {node->degree--; } (void)0 +# define NodeDegreeIncrement(rg, node) {node->degree++; } (void)0 #endif void repositionNodes(ReebGraph *rg) diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index bdb70696742..3020fe6985a 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -43,9 +43,9 @@ struct Scene; /* --------- BezTriple Selection ------------- */ -#define BEZ_SEL(bezt) { (bezt)->f1 |= SELECT; (bezt)->f2 |= SELECT; (bezt)->f3 |= SELECT; } -#define BEZ_DESEL(bezt) { (bezt)->f1 &= ~SELECT; (bezt)->f2 &= ~SELECT; (bezt)->f3 &= ~SELECT; } -#define BEZ_INVSEL(bezt) { (bezt)->f1 ^= SELECT; (bezt)->f2 ^= SELECT; (bezt)->f3 ^= SELECT; } +#define BEZ_SEL(bezt) { (bezt)->f1 |= SELECT; (bezt)->f2 |= SELECT; (bezt)->f3 |= SELECT; } (void)0 +#define BEZ_DESEL(bezt) { (bezt)->f1 &= ~SELECT; (bezt)->f2 &= ~SELECT; (bezt)->f3 &= ~SELECT; } (void)0 +#define BEZ_INVSEL(bezt) { (bezt)->f1 ^= SELECT; (bezt)->f2 ^= SELECT; (bezt)->f3 ^= SELECT; } (void)0 /* --------- Tool Flags ------------ */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 5394cb46049..d26c8cefdf0 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -81,7 +81,7 @@ /* avoid unneeded calls to ui_get_but_val */ #define UI_BUT_VALUE_UNSET DBL_MAX -#define UI_GET_BUT_VALUE_INIT(_but, _value) if (_value == DBL_MAX) { (_value) = ui_get_but_val(_but); } +#define UI_GET_BUT_VALUE_INIT(_but, _value) if (_value == DBL_MAX) { (_value) = ui_get_but_val(_but); } (void)0 /* * a full doc with API notes can be found in bf-blender/trunk/blender/doc/guides/interface_API.txt @@ -660,8 +660,8 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut /* typically the same pointers, but not on undo/redo */ /* XXX some menu buttons store button itself in but->poin. Ugly */ if (oldbut->poin != (char *)oldbut) { - SWAP(char *, oldbut->poin, but->poin) - SWAP(void *, oldbut->func_argN, but->func_argN) + SWAP(char *, oldbut->poin, but->poin); + SWAP(void *, oldbut->func_argN, but->func_argN); } /* copy hardmin for list rows to prevent 'sticking' highlight to mouse position @@ -1090,7 +1090,7 @@ static void ui_is_but_sel(uiBut *but, double *value) if (but->bit) { int lvalue; - UI_GET_BUT_VALUE_INIT(but, *value) + UI_GET_BUT_VALUE_INIT(but, *value); lvalue = (int)*value; if (BTST(lvalue, (but->bitnr)) ) is_push = is_true; else is_push = !is_true; @@ -1111,18 +1111,18 @@ static void ui_is_but_sel(uiBut *but, double *value) case BUT_TOGDUAL: case ICONTOG: case OPTION: - UI_GET_BUT_VALUE_INIT(but, *value) + UI_GET_BUT_VALUE_INIT(but, *value); if (*value != (double)but->hardmin) is_push = 1; break; case ICONTOGN: case TOGN: case OPTIONN: - UI_GET_BUT_VALUE_INIT(but, *value) + UI_GET_BUT_VALUE_INIT(but, *value); if (*value == 0.0) is_push = 1; break; case ROW: case LISTROW: - UI_GET_BUT_VALUE_INIT(but, *value) + UI_GET_BUT_VALUE_INIT(but, *value); /* support for rna enum buts */ if (but->rnaprop && (RNA_property_flag(but->rnaprop) & PROP_ENUM_FLAG)) { if ((int)*value & (int)but->hardmax) is_push = 1; @@ -2171,7 +2171,7 @@ void ui_check_but(uiBut *but) /* only update soft range while not editing */ if (but->rnaprop && !(but->editval || but->editstr || but->editvec)) { - UI_GET_BUT_VALUE_INIT(but, value) + UI_GET_BUT_VALUE_INIT(but, value); ui_set_but_soft_range(but, value); } @@ -2182,7 +2182,7 @@ void ui_check_but(uiBut *but) case SCROLL: case NUMSLI: case HSVSLI: - UI_GET_BUT_VALUE_INIT(but, value) + UI_GET_BUT_VALUE_INIT(but, value); if (value < (double)but->hardmin) ui_set_but_val(but, but->hardmin); else if (value > (double)but->hardmax) ui_set_but_val(but, but->hardmax); break; @@ -2190,7 +2190,7 @@ void ui_check_but(uiBut *but) case NUMABS: { double value_abs; - UI_GET_BUT_VALUE_INIT(but, value) + UI_GET_BUT_VALUE_INIT(but, value); value_abs = fabs(value); if (value_abs < (double)but->hardmin) ui_set_but_val(but, but->hardmin); else if (value_abs > (double)but->hardmax) ui_set_but_val(but, but->hardmax); @@ -2206,14 +2206,14 @@ void ui_check_but(uiBut *but) case ICONROW: if (!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) { - UI_GET_BUT_VALUE_INIT(but, value) + UI_GET_BUT_VALUE_INIT(but, value); but->iconadd = (int)value - (int)(but->hardmin); } break; case ICONTEXTROW: if (!but->rnaprop || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) { - UI_GET_BUT_VALUE_INIT(but, value) + UI_GET_BUT_VALUE_INIT(but, value); but->iconadd = (int)value - (int)(but->hardmin); } break; @@ -2230,7 +2230,7 @@ void ui_check_but(uiBut *but) case ICONTEXTROW: if (but->x2 - but->x1 > 24) { - UI_GET_BUT_VALUE_INIT(but, value) + UI_GET_BUT_VALUE_INIT(but, value); ui_set_name_menu(but, (int)value); } break; @@ -2240,7 +2240,7 @@ void ui_check_but(uiBut *but) case HSVSLI: case NUMABS: - UI_GET_BUT_VALUE_INIT(but, value) + UI_GET_BUT_VALUE_INIT(but, value); if (ui_is_but_float(but)) { if (value == (double) FLT_MAX) BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%sinf", but->str); @@ -2271,7 +2271,7 @@ void ui_check_but(uiBut *but) case LABEL: if (ui_is_but_float(but)) { int prec; - UI_GET_BUT_VALUE_INIT(but, value) + UI_GET_BUT_VALUE_INIT(but, value); prec = ui_but_float_precision(but, value); BLI_snprintf(but->drawstr, sizeof(but->drawstr), "%s%.*f", but->str, prec, value); } @@ -2299,7 +2299,7 @@ void ui_check_but(uiBut *but) strcat(but->drawstr, "Press a key"); } else { - UI_GET_BUT_VALUE_INIT(but, value) + UI_GET_BUT_VALUE_INIT(but, value); strcat(but->drawstr, WM_key_event_string((short)value)); } break; diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 19864ed58cf..40b653a62fd 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -455,7 +455,7 @@ static int shape_key_move_exec(bContext *C, wmOperator *op) ob->shapenr++; } - SWAP(float, kb_other->pos, kb->pos) /* for absolute shape keys */ + SWAP(float, kb_other->pos, kb->pos); /* for absolute shape keys */ } DAG_id_tag_update(&ob->id, OB_RECALC_DATA); |