diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-01 01:42:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-01 02:20:31 +0300 |
commit | 8ee4fd0bdfed1faaf89cc3e131e35cda5e8068b6 (patch) | |
tree | ffbb5ac4e8002525820c6fef23c94cbe3a651a69 /source | |
parent | 3cd98d9ef7e6b85ec3c186f27879612265e3d85d (diff) |
Cleanup: style
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 2 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_draw_utils.c | 8 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.c | 14 | ||||
-rw-r--r-- | source/blender/editors/armature/armature_edit.c | 10 | ||||
-rw-r--r-- | source/blender/editors/gpencil/annotate_paint.c | 3 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_brush.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 147 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 4 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_collision.c | 26 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshdeform.c | 3 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_element.c | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_dragdrop.c | 2 |
14 files changed, 116 insertions, 119 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 10fcbf6d557..c32cfa433bd 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -2080,7 +2080,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { for (ModifierData *md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Shrinkwrap) { - ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*)md; + ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md; if (smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE) { smd->shrinkMode = MOD_SHRINKWRAP_ABOVE_SURFACE; smd->shrinkOpts &= ~MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE; diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 345b0f0c577..f7823a2fced 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -881,8 +881,8 @@ static void gpencil_draw_strokes( /* edit points (only in edit mode and not play animation not render) */ if ((draw_ctx->obact == ob) && (src_gps) && - (!playing) && (!is_render) && (!cache_ob->is_dup_ob) - && ((gpl->flag & GP_LAYER_LOCKED) == 0)) + (!playing) && (!is_render) && (!cache_ob->is_dup_ob) && + ((gpl->flag & GP_LAYER_LOCKED) == 0)) { if (!stl->g_data->shgrps_edit_line) { stl->g_data->shgrps_edit_line = DRW_shgroup_create(e_data->gpencil_line_sh, psl->edit_pass); @@ -970,9 +970,9 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T stl->storage->unit_matrix); if ((gpd->runtime.sbuffer_size >= 3) && - (gpd->runtime.sfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) && + (gpd->runtime.sfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) && ((gpd->runtime.sbuffer_sflag & GP_STROKE_NOFILL) == 0) && - ((brush->gpencil_settings->flag & GP_BRUSH_DISSABLE_LASSO) == 0)) + ((brush->gpencil_settings->flag & GP_BRUSH_DISSABLE_LASSO) == 0)) { /* if not solid, fill is simulated with solid color */ if (gpd->runtime.bfill_style > 0) { diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index faa4d980cd1..d4cac6fb549 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -52,7 +52,7 @@ struct GPUTexture *globals_weight_ramp = NULL; static bool weight_ramp_custom = false; static ColorBand weight_ramp_copy; -static struct GPUTexture* DRW_create_weight_colorramp_texture(void); +static struct GPUTexture *DRW_create_weight_colorramp_texture(void); void DRW_globals_update(void) { @@ -187,7 +187,8 @@ void DRW_globals_update(void) bool user_weight_ramp = (U.flag & USER_CUSTOM_RANGE) != 0; if (weight_ramp_custom != user_weight_ramp || - (user_weight_ramp && memcmp(&weight_ramp_copy, &U.coba_weight, sizeof(ColorBand)) != 0)) { + (user_weight_ramp && memcmp(&weight_ramp_copy, &U.coba_weight, sizeof(ColorBand)) != 0)) + { DRW_TEXTURE_FREE_SAFE(globals_weight_ramp); } @@ -950,8 +951,7 @@ bool DRW_object_axis_orthogonal_to_view(Object *ob, int axis) static void DRW_evaluate_weight_to_color(float *result, float weight) { - if (U.flag & USER_CUSTOM_RANGE) - { + if (U.flag & USER_CUSTOM_RANGE) { BKE_colorband_evaluate(&U.coba_weight, weight, result); } else { @@ -964,18 +964,18 @@ static void DRW_evaluate_weight_to_color(float *result, float weight) hsv_to_rgb_v(hsv, result); for (int i = 0; i < 3; i++) { - result[i] = pow(result[i], 1.0f/gamma); + result[i] = pow(result[i], 1.0f / gamma); } } } -static GPUTexture* DRW_create_weight_colorramp_texture(void) +static GPUTexture *DRW_create_weight_colorramp_texture(void) { char error[256]; float pixels[256 * 4]; for (int i = 0 ; i < 256 ; i ++) { DRW_evaluate_weight_to_color(&pixels[i*4], i / 255.0f); - pixels[i*4 + 3] = 1.0f; + pixels[(i * 4) + 3] = 1.0f; } return GPU_texture_create_1D(256, GPU_RGBA8, pixels, error); diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index 1ca44f9e2a2..eff66880afa 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -1486,13 +1486,13 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op)) for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { /* break connections for unseen bones */ if (((arm->layer & ebone->layer) && - ((ED_armature_ebone_selectflag_get(ebone) & (BONE_TIPSEL | BONE_SELECTED)))) == 0) + ((ED_armature_ebone_selectflag_get(ebone) & (BONE_TIPSEL | BONE_SELECTED)))) == 0) { ebone->temp.ebone = NULL; } if (((arm->layer & ebone->layer) && - ((ED_armature_ebone_selectflag_get(ebone) & (BONE_ROOTSEL | BONE_SELECTED)))) == 0) + ((ED_armature_ebone_selectflag_get(ebone) & (BONE_ROOTSEL | BONE_SELECTED)))) == 0) { if (ebone->parent && (ebone->flag & BONE_CONNECTED)) { ebone->parent->temp.ebone = NULL; @@ -1504,7 +1504,7 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op)) for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { if (ebone->parent && - (ebone->parent->temp.ebone == ebone)) + (ebone->parent->temp.ebone == ebone)) { ebone->flag |= BONE_DONE; } @@ -1528,8 +1528,8 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op)) if (changed) { for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { if (ebone->parent && - ebone->parent->temp.ebone && - (ebone->flag & BONE_CONNECTED)) + ebone->parent->temp.ebone && + (ebone->flag & BONE_CONNECTED)) { ebone->rad_head = ebone->parent->rad_tail; } diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index d6d2ce8585a..97834e6836c 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -1866,8 +1866,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event tGPsdata *p = NULL; /* GPXX Need a better solution */ - if (sa && sa->spacetype == SPACE_VIEW3D) - { + if (sa && sa->spacetype == SPACE_VIEW3D) { if ((ob != NULL) && (ob->type == OB_GPENCIL)) { BKE_report(op->reports, RPT_ERROR, "Cannot draw annotation with a Grease Pencil object active"); return OPERATOR_CANCELLED; diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 1e64a41e914..20c3449c208 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -1230,9 +1230,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op) gso->cfra = INT_MAX; /* NOTE: So that first stroke will get handled in init_stroke() */ /* some brushes cannot use pressure for radius */ - if ((gso->brush_type == GP_EDITBRUSH_TYPE_GRAB) || - (gso->brush_type == GP_EDITBRUSH_TYPE_CLONE)) - { + if (ELEM(gso->brush_type, GP_EDITBRUSH_TYPE_GRAB, GP_EDITBRUSH_TYPE_CLONE)) { gso->brush->flag &= ~GP_EDITBRUSH_FLAG_PRESSURE_RADIUS; } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c08384c3ef0..1891687b28b 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2163,7 +2163,8 @@ static void ui_but_paste_numeric_value(bContext *C, uiBut *but, uiHandleButtonDa data->value = value; ui_but_string_set(C, but, buf_paste); button_activate_state(C, but, BUTTON_STATE_EXIT); - } else { + } + else { WM_report(RPT_ERROR, "Expected a number"); } } @@ -2313,54 +2314,53 @@ static void ui_but_copy(bContext *C, uiBut *but, const bool copy_array) bool has_required_data = !(but->poin == NULL && but->rnapoin.data == NULL); - switch (but->type) - { - case UI_BTYPE_NUM: - case UI_BTYPE_NUM_SLIDER: - if (!has_required_data) break; - if (copy_array && ui_but_has_array_value(but)) { - ui_but_copy_numeric_array(but, buffer_to_copy, max_copy_length); - } - else { - ui_but_copy_numeric_value(but, buffer_to_copy, max_copy_length); - } - break; + switch (but->type) { + case UI_BTYPE_NUM: + case UI_BTYPE_NUM_SLIDER: + if (!has_required_data) break; + if (copy_array && ui_but_has_array_value(but)) { + ui_but_copy_numeric_array(but, buffer_to_copy, max_copy_length); + } + else { + ui_but_copy_numeric_value(but, buffer_to_copy, max_copy_length); + } + break; - case UI_BTYPE_UNITVEC: - if (!has_required_data) break; - ui_but_copy_numeric_array(but, buffer_to_copy, max_copy_length); - break; + case UI_BTYPE_UNITVEC: + if (!has_required_data) break; + ui_but_copy_numeric_array(but, buffer_to_copy, max_copy_length); + break; - case UI_BTYPE_COLOR: - if (!has_required_data) break; - ui_but_copy_color(but, buffer_to_copy, max_copy_length); - break; + case UI_BTYPE_COLOR: + if (!has_required_data) break; + ui_but_copy_color(but, buffer_to_copy, max_copy_length); + break; - case UI_BTYPE_TEXT: - case UI_BTYPE_SEARCH_MENU: - if (!has_required_data) break; - ui_but_copy_text(but, buffer_to_copy, max_copy_length); - break; + case UI_BTYPE_TEXT: + case UI_BTYPE_SEARCH_MENU: + if (!has_required_data) break; + ui_but_copy_text(but, buffer_to_copy, max_copy_length); + break; - case UI_BTYPE_COLORBAND: - ui_but_copy_colorband(but); - break; + case UI_BTYPE_COLORBAND: + ui_but_copy_colorband(but); + break; - case UI_BTYPE_CURVE: - ui_but_copy_curvemapping(but); - break; + case UI_BTYPE_CURVE: + ui_but_copy_curvemapping(but); + break; - case UI_BTYPE_BUT: - ui_but_copy_operator(C, but, buffer_to_copy, max_copy_length); - break; + case UI_BTYPE_BUT: + ui_but_copy_operator(C, but, buffer_to_copy, max_copy_length); + break; - case UI_BTYPE_MENU: - case UI_BTYPE_PULLDOWN: - ui_but_copy_menu(but, buffer_to_copy, max_copy_length); - break; + case UI_BTYPE_MENU: + case UI_BTYPE_PULLDOWN: + ui_but_copy_menu(but, buffer_to_copy, max_copy_length); + break; - default: - break; + default: + break; } WM_clipboard_text_set(buffer_to_copy, 0); @@ -2376,45 +2376,44 @@ static void ui_but_paste(bContext *C, uiBut *but, uiHandleButtonData *data, cons bool has_required_data = !(but->poin == NULL && but->rnapoin.data == NULL); - switch (but->type) - { - case UI_BTYPE_NUM: - case UI_BTYPE_NUM_SLIDER: - if (!has_required_data) break; - if (paste_array && ui_but_has_array_value(but)) { - ui_but_paste_numeric_array(C, but, data, buf_paste); - } - else { - ui_but_paste_numeric_value(C, but, data, buf_paste); - } - break; + switch (but->type) { + case UI_BTYPE_NUM: + case UI_BTYPE_NUM_SLIDER: + if (!has_required_data) break; + if (paste_array && ui_but_has_array_value(but)) { + ui_but_paste_numeric_array(C, but, data, buf_paste); + } + else { + ui_but_paste_numeric_value(C, but, data, buf_paste); + } + break; - case UI_BTYPE_UNITVEC: - if (!has_required_data) break; - ui_but_paste_normalized_vector(C, but, buf_paste); - break; + case UI_BTYPE_UNITVEC: + if (!has_required_data) break; + ui_but_paste_normalized_vector(C, but, buf_paste); + break; - case UI_BTYPE_COLOR: - if (!has_required_data) break; - ui_but_paste_color(C, but, buf_paste); - break; + case UI_BTYPE_COLOR: + if (!has_required_data) break; + ui_but_paste_color(C, but, buf_paste); + break; - case UI_BTYPE_TEXT: - case UI_BTYPE_SEARCH_MENU: - if (!has_required_data) break; - ui_but_paste_text(C, but, data, buf_paste); - break; + case UI_BTYPE_TEXT: + case UI_BTYPE_SEARCH_MENU: + if (!has_required_data) break; + ui_but_paste_text(C, but, data, buf_paste); + break; - case UI_BTYPE_COLORBAND: - ui_but_paste_colorband(C, but, data); - break; + case UI_BTYPE_COLORBAND: + ui_but_paste_colorband(C, but, data); + break; - case UI_BTYPE_CURVE: - ui_but_paste_curvemapping(C, but); - break; + case UI_BTYPE_CURVE: + ui_but_paste_curvemapping(C, but); + break; - default: - break; + default: + break; } MEM_freeN((void *)buf_paste); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 7b338b90a62..70e9a25d086 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1527,7 +1527,7 @@ static void icon_draw_size( /* icon that matches text color, assumed to be white */ float color[4]; if (mono_rgba) { - rgba_uchar_to_float(color, (const unsigned char*)mono_rgba); + rgba_uchar_to_float(color, (const uchar *)mono_rgba); } else { UI_GetThemeColor4fv(TH_TEXT, color); diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index c916deccb84..590deb59ce3 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -724,7 +724,7 @@ void ui_draw_aligned_panel( #endif { char col_title[4]; - UI_GetThemeColor4ubv(TH_TITLE, (unsigned char*)col_title); + UI_GetThemeColor4ubv(TH_TITLE, (uchar *)col_title); GPU_blend(true); UI_icon_draw_aspect( diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 06fd05872a1..41e4ee5c1b6 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1278,8 +1278,8 @@ static int ui_but_draw_menu_icon(const uiBut *but) /* icons have been standardized... and this call draws in untransformed coordinates */ static void widget_draw_icon( - const uiBut *but, BIFIconID icon, float alpha, - const rcti *rect, const char mono_color[4]) + const uiBut *but, BIFIconID icon, float alpha, + const rcti *rect, const char mono_color[4]) { float xs = 0.0f, ys = 0.0f; float aspect, height; diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index 1cef98fbdf2..397cf287103 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -186,9 +186,9 @@ static void deformVerts( /* create bounding box hierarchy */ collmd->bvhtree = bvhtree_build_from_mvert( - collmd->x, - collmd->tri, collmd->tri_num, - ob->pd->pdef_sboft); + collmd->x, + collmd->tri, collmd->tri_num, + ob->pd->pdef_sboft); collmd->time_x = collmd->time_xnew = current_time; collmd->is_static = true; @@ -220,26 +220,26 @@ static void deformVerts( if (ob->pd->pdef_sboft != BLI_bvhtree_get_epsilon(collmd->bvhtree)) { BLI_bvhtree_free(collmd->bvhtree); collmd->bvhtree = bvhtree_build_from_mvert( - collmd->current_x, - collmd->tri, collmd->tri_num, - ob->pd->pdef_sboft); + collmd->current_x, + collmd->tri, collmd->tri_num, + ob->pd->pdef_sboft); } } /* happens on file load (ONLY when i decomment changes in readfile.c) */ if (!collmd->bvhtree) { collmd->bvhtree = bvhtree_build_from_mvert( - collmd->current_x, - collmd->tri, collmd->tri_num, - ob->pd->pdef_sboft); + collmd->current_x, + collmd->tri, collmd->tri_num, + ob->pd->pdef_sboft); } else if (!collmd->is_static || !is_static) { /* recalc static bounding boxes */ bvhtree_update_from_mvert( - collmd->bvhtree, - collmd->current_x, collmd->current_xnew, - collmd->tri, collmd->tri_num, - true); + collmd->bvhtree, + collmd->current_x, collmd->current_xnew, + collmd->tri, collmd->tri_num, + true); } collmd->is_static = is_static; diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index aac191bc511..5aa134fc7e1 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -328,7 +328,8 @@ static void meshdeformModifier_do( /* Write binding data to original modifier. */ Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph); Object *ob_orig = DEG_get_original_object(ob); - MeshDeformModifierData *mmd_orig = (MeshDeformModifierData*)modifiers_findByName(ob_orig, mmd->modifier.name); + MeshDeformModifierData *mmd_orig = (MeshDeformModifierData *)modifiers_findByName( + ob_orig, mmd->modifier.name); recursive = 1; mmd->bindfunc(scene, mmd_orig, cagemesh, (float *)vertexCos, numVerts, cagemat); diff --git a/source/blender/python/gpu/gpu_py_element.c b/source/blender/python/gpu/gpu_py_element.c index 63d1f24a3ef..657358d0448 100644 --- a/source/blender/python/gpu/gpu_py_element.c +++ b/source/blender/python/gpu/gpu_py_element.c @@ -70,10 +70,10 @@ static PyObject *bpygpu_IndexBuf_new(PyTypeObject *UNUSED(type), PyObject *args, verts_per_prim = GPU_indexbuf_primitive_len(params.type_id); if (verts_per_prim == -1) { - PyErr_Format(PyExc_ValueError, - "The argument 'type' must be " - "'POINTS', 'LINES', 'TRIS' or 'LINES_ADJ'"); - return NULL; + PyErr_Format(PyExc_ValueError, + "The argument 'type' must be " + "'POINTS', 'LINES', 'TRIS' or 'LINES_ADJ'"); + return NULL; } if (PyObject_CheckBuffer(params.seq)) { diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 1c86f0ab9b7..77e2cd772db 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -439,7 +439,7 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect) drag_rect_minmax(rect, x, y, x + w, y + iconsize); } else { - UI_fontstyle_draw_simple(fstyle, x, y, wm_drag_name(drag), (unsigned char*)text_col); + UI_fontstyle_draw_simple(fstyle, x, y, wm_drag_name(drag), (uchar *)text_col); } /* operator name with roundbox */ |