From 2f348d8b5d7d897ad44d192a2fd5f2b99b906c76 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 24 Mar 2012 02:51:46 +0000 Subject: style cleanup: mainly for mesh code, also some WM function use. --- source/blender/blenkernel/intern/anim.c | 1 - source/blender/blenkernel/intern/blender.c | 12 +- source/blender/blenkernel/intern/camera.c | 8 +- source/blender/blenkernel/intern/library.c | 11 +- source/blender/blenkernel/intern/mesh.c | 2 +- source/blender/blenkernel/intern/scene.c | 8 +- source/blender/blenloader/intern/readfile.c | 52 +++---- source/blender/bmesh/intern/bmesh_inline.h | 9 +- .../editors/animation/anim_channels_defines.c | 8 +- .../blender/editors/animation/anim_channels_edit.c | 8 +- source/blender/editors/animation/anim_markers.c | 6 +- source/blender/editors/animation/anim_ops.c | 2 +- source/blender/editors/animation/fmodifier_ui.c | 12 +- source/blender/editors/armature/armature_ops.c | 46 +++--- source/blender/editors/armature/editarmature.c | 22 +-- .../blender/editors/armature/editarmature_sketch.c | 8 +- source/blender/editors/curve/curve_ops.c | 16 +- source/blender/editors/gpencil/drawgpencil.c | 8 +- source/blender/editors/gpencil/gpencil_ops.c | 2 +- source/blender/editors/gpencil/gpencil_paint.c | 8 +- source/blender/editors/interface/interface.c | 32 ++-- source/blender/editors/interface/interface_draw.c | 8 +- .../blender/editors/interface/interface_handlers.c | 42 ++--- .../blender/editors/interface/interface_layout.c | 42 ++--- source/blender/editors/interface/interface_panel.c | 34 ++--- .../blender/editors/interface/interface_regions.c | 96 ++++++------ source/blender/editors/interface/interface_style.c | 8 +- .../editors/interface/interface_templates.c | 64 ++++---- source/blender/editors/interface/interface_utils.c | 28 ++-- .../blender/editors/interface/interface_widgets.c | 36 ++--- source/blender/editors/interface/view2d.c | 170 ++++++++++----------- source/blender/editors/interface/view2d_ops.c | 40 ++--- source/blender/editors/mesh/editmesh_add.c | 20 +-- source/blender/editors/mesh/editmesh_bvh.c | 61 ++++---- source/blender/editors/mesh/editmesh_knife.c | 21 ++- source/blender/editors/mesh/editmesh_loopcut.c | 92 +++++------ source/blender/editors/mesh/editmesh_select.c | 9 +- source/blender/editors/mesh/editmesh_tools.c | 14 +- source/blender/editors/mesh/mesh_navmesh.c | 82 +++++----- source/blender/editors/mesh/mesh_ops.c | 40 ++--- source/blender/editors/metaball/mball_edit.c | 8 +- source/blender/editors/metaball/mball_ops.c | 4 +- source/blender/editors/object/object_ops.c | 22 +-- source/blender/editors/physics/physics_ops.c | 6 +- source/blender/editors/render/render_internal.c | 2 +- source/blender/editors/render/render_preview.c | 12 +- source/blender/editors/render/render_view.c | 8 +- source/blender/editors/screen/area.c | 108 ++++++------- source/blender/editors/screen/glutil.c | 8 +- source/blender/editors/screen/screen_edit.c | 8 +- source/blender/editors/screen/screen_ops.c | 18 +-- source/blender/editors/sculpt_paint/paint_hide.c | 8 +- source/blender/editors/sculpt_paint/paint_ops.c | 44 +++--- source/blender/editors/space_action/action_draw.c | 4 +- source/blender/editors/space_action/action_edit.c | 4 +- source/blender/editors/space_action/action_ops.c | 18 +-- .../blender/editors/space_action/action_select.c | 8 +- source/blender/editors/space_action/space_action.c | 12 +- .../editors/space_buttons/buttons_context.c | 2 +- .../blender/editors/space_buttons/buttons_header.c | 2 +- .../editors/space_buttons/buttons_texture.c | 6 +- .../blender/editors/space_buttons/space_buttons.c | 4 +- source/blender/editors/space_clip/clip_buttons.c | 4 +- source/blender/editors/space_clip/clip_ops.c | 8 +- source/blender/editors/space_clip/space_clip.c | 100 ++++++------ source/blender/editors/space_clip/tracking_ops.c | 8 +- .../blender/editors/space_console/console_draw.c | 4 +- .../blender/editors/space_console/space_console.c | 8 +- source/blender/editors/space_file/file_draw.c | 4 +- source/blender/editors/space_file/file_ops.c | 16 +- source/blender/editors/space_file/file_panels.c | 2 +- source/blender/editors/space_file/space_file.c | 26 ++-- source/blender/editors/space_graph/graph_buttons.c | 8 +- source/blender/editors/space_graph/graph_ops.c | 24 +-- source/blender/editors/space_graph/graph_select.c | 8 +- source/blender/editors/space_graph/space_graph.c | 18 +-- source/blender/editors/space_image/image_buttons.c | 26 ++-- source/blender/editors/space_image/space_image.c | 42 ++--- source/blender/editors/space_info/info_draw.c | 4 +- source/blender/editors/space_info/info_report.c | 8 +- source/blender/editors/space_info/space_info.c | 6 +- source/blender/editors/space_info/textview.c | 4 +- source/blender/editors/space_logic/logic_buttons.c | 8 +- source/blender/editors/space_logic/logic_window.c | 44 +++--- source/blender/editors/space_logic/space_logic.c | 22 +-- source/blender/editors/space_nla/nla_draw.c | 12 +- source/blender/editors/space_nla/nla_edit.c | 4 +- source/blender/editors/space_nla/nla_ops.c | 14 +- source/blender/editors/space_nla/nla_select.c | 8 +- source/blender/editors/space_nla/space_nla.c | 20 +-- source/blender/editors/space_node/drawnode.c | 18 +-- source/blender/editors/space_node/node_draw.c | 38 ++--- source/blender/editors/space_node/node_ops.c | 16 +- source/blender/editors/space_node/node_select.c | 8 +- source/blender/editors/space_node/node_state.c | 10 +- source/blender/editors/space_node/node_templates.c | 4 +- source/blender/editors/space_node/space_node.c | 22 +-- .../blender/editors/space_outliner/outliner_draw.c | 16 +- .../blender/editors/space_outliner/outliner_edit.c | 8 +- .../blender/editors/space_outliner/outliner_ops.c | 2 +- .../editors/space_outliner/outliner_select.c | 10 +- .../blender/editors/space_outliner/outliner_tree.c | 2 +- .../editors/space_outliner/space_outliner.c | 2 +- source/blender/editors/space_script/script_ops.c | 2 +- source/blender/editors/space_script/space_script.c | 2 +- .../editors/space_sequencer/sequencer_draw.c | 16 +- .../editors/space_sequencer/sequencer_edit.c | 32 ++-- .../editors/space_sequencer/sequencer_ops.c | 22 +-- .../editors/space_sequencer/sequencer_select.c | 8 +- .../editors/space_sequencer/space_sequencer.c | 24 +-- source/blender/editors/space_text/space_text.c | 4 +- source/blender/editors/space_text/text_draw.c | 20 +-- source/blender/editors/space_time/space_time.c | 14 +- source/blender/editors/space_time/time_ops.c | 6 +- source/blender/editors/space_view3d/space_view3d.c | 48 +++--- .../blender/editors/space_view3d/view3d_buttons.c | 6 +- source/blender/editors/space_view3d/view3d_draw.c | 40 ++--- source/blender/editors/space_view3d/view3d_edit.c | 40 ++--- .../blender/editors/space_view3d/view3d_header.c | 8 +- source/blender/editors/space_view3d/view3d_ops.c | 26 ++-- .../blender/editors/space_view3d/view3d_select.c | 20 +-- .../blender/editors/space_view3d/view3d_toolbar.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 26 ++-- .../editors/transform/transform_manipulator.c | 8 +- source/blender/editors/transform/transform_ops.c | 26 ++-- source/blender/editors/uvedit/uvedit_ops.c | 12 +- .../blender/nodes/composite/node_composite_util.c | 12 +- .../blender/render/intern/source/external_engine.c | 8 +- source/blender/render/intern/source/imagetexture.c | 76 ++++----- source/blender/render/intern/source/initrender.c | 12 +- source/blender/render/intern/source/pipeline.c | 40 ++--- .../blender/render/intern/source/render_result.c | 10 +- source/blender/render/intern/source/rendercore.c | 14 +- source/blender/render/intern/source/shadbuf.c | 48 +++--- source/blender/render/intern/source/zbuf.c | 12 +- source/blender/windowmanager/intern/wm_dragdrop.c | 12 +- source/blender/windowmanager/intern/wm_draw.c | 2 +- .../blender/windowmanager/intern/wm_event_system.c | 6 +- source/blender/windowmanager/intern/wm_gesture.c | 12 +- source/blender/windowmanager/intern/wm_keymap.c | 14 +- source/blender/windowmanager/intern/wm_operators.c | 52 +++---- source/blender/windowmanager/intern/wm_subwindow.c | 4 +- source/blender/windowmanager/intern/wm_window.c | 10 +- 143 files changed, 1440 insertions(+), 1436 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 743cfba0185..48d863150bc 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -29,7 +29,6 @@ * \ingroup bke */ - #include #include #include diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 2ef93dd7fa3..1bb6841cd36 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -31,13 +31,13 @@ #ifndef _WIN32 - #include // for read close +# include // for read close #else - #include // for open close read - #define open _open - #define read _read - #define close _close - #define write _write +# include // for open close read +# define open _open +# define read _read +# define close _close +# define write _write #endif #include diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index 7180d157b96..a6651e25a5f 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -312,10 +312,10 @@ void camera_params_compute_viewplane(CameraParams *params, int winx, int winy, f /* compute view plane: * fully centered, zbuffer fills in jittered between -.5 and +.5 */ - viewplane.xmin= -0.5f*(float)winx; - viewplane.ymin= -0.5f*params->ycor*(float)winy; - viewplane.xmax= 0.5f*(float)winx; - viewplane.ymax= 0.5f*params->ycor*(float)winy; + viewplane.xmin = -0.5f*(float)winx; + viewplane.ymin = -0.5f*params->ycor*(float)winy; + viewplane.xmax = 0.5f*(float)winx; + viewplane.ymax = 0.5f*params->ycor*(float)winy; /* lens shift and offset */ dx= params->shiftx*viewfac + winx*params->offsetx; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 158319a802f..3bfccea4780 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -27,16 +27,11 @@ /** \file blender/blenkernel/intern/library.c * \ingroup bke + * + * Contains management of ID's and libraries + * allocate and free of all library data */ - -/* - * Contains management of ID's and libraries - * allocate and free of all library data - * - */ - - #include #include #include diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 5dfabc64442..496c72ce2f8 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -3100,7 +3100,7 @@ void BKE_mesh_ensure_navmesh(Mesh *me) if (!CustomData_has_layer(&me->pdata, CD_RECAST)) { int i; int numFaces = me->totpoly; - int* recastData; + int *recastData; CustomData_add_layer_named(&me->pdata, CD_RECAST, CD_CALLOC, NULL, numFaces, "recastData"); recastData = (int*)CustomData_get_layer(&me->pdata, CD_RECAST); for (i=0; ir.simplify_shadowsamples= 16; sce->r.simplify_aosss= 1.0f; - sce->r.border.xmin= 0.0f; - sce->r.border.ymin= 0.0f; - sce->r.border.xmax= 1.0f; - sce->r.border.ymax= 1.0f; + sce->r.border.xmin = 0.0f; + sce->r.border.ymin = 0.0f; + sce->r.border.xmax = 1.0f; + sce->r.border.ymax = 1.0f; sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings),"Tool Settings Struct"); sce->toolsettings->cornertype=1; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f1e8d01cfd4..3b69c84bb62 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5168,10 +5168,10 @@ static void direct_link_gpencil(FileData *fd, bGPdata *gpd) static void butspace_version_132(SpaceButs *buts) { - buts->v2d.tot.xmin= 0.0f; - buts->v2d.tot.ymin= 0.0f; - buts->v2d.tot.xmax= 1279.0f; - buts->v2d.tot.ymax= 228.0f; + buts->v2d.tot.xmin = 0.0f; + buts->v2d.tot.ymin = 0.0f; + buts->v2d.tot.xmax = 1279.0f; + buts->v2d.tot.ymax = 228.0f; buts->v2d.min[0]= 256.0f; buts->v2d.min[1]= 42.0f; @@ -6876,10 +6876,10 @@ static void sequencer_init_preview_region(ARegion* ar) ar->v2d.keepzoom= V2D_KEEPASPECT | V2D_KEEPZOOM; ar->v2d.minzoom= 0.00001f; ar->v2d.maxzoom= 100000.0f; - ar->v2d.tot.xmin= -960.0f; /* 1920 width centered */ - ar->v2d.tot.ymin= -540.0f; /* 1080 height centered */ - ar->v2d.tot.xmax= 960.0f; - ar->v2d.tot.ymax= 540.0f; + ar->v2d.tot.xmin = -960.0f; /* 1920 width centered */ + ar->v2d.tot.ymin = -540.0f; /* 1080 height centered */ + ar->v2d.tot.xmax = 960.0f; + ar->v2d.tot.ymax = 540.0f; ar->v2d.min[0]= 0.0f; ar->v2d.min[1]= 0.0f; ar->v2d.max[0]= 12000.0f; @@ -7048,7 +7048,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) ar->v2d.align |= V2D_ALIGN_NO_NEG_Y; ar->v2d.keepofs |= V2D_LOCKOFS_Y; ar->v2d.keepzoom |= V2D_LOCKZOOM_Y; - ar->v2d.tot.ymin= ar->v2d.cur.ymin= -10.0; + ar->v2d.tot.ymin = ar->v2d.cur.ymin = -10.0; ar->v2d.min[1]= ar->v2d.max[1]= 20.0; } break; @@ -7075,8 +7075,8 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) SpaceNla *snla= (SpaceNla *)sl; memcpy(&ar->v2d, &snla->v2d, sizeof(View2D)); - ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f; - ar->v2d.tot.ymax= 0.0f; + ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f; + ar->v2d.tot.ymax = 0.0f; ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); ar->v2d.scroll |= (V2D_SCROLL_RIGHT); @@ -7089,10 +7089,10 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) SpaceAction *saction= (SpaceAction *)sl; /* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */ - ar->v2d.tot.xmin= -20.0f; - ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f; - ar->v2d.tot.xmax= (float)((sa->winx > 120)? (sa->winx) : 120); - ar->v2d.tot.ymax= 0.0f; + ar->v2d.tot.xmin = -20.0f; + ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f; + ar->v2d.tot.xmax = (float)((sa->winx > 120)? (sa->winx) : 120); + ar->v2d.tot.ymax = 0.0f; ar->v2d.cur= ar->v2d.tot; @@ -9808,11 +9808,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(sl->spacetype==SPACE_ACTION) { SpaceAction *saction= (SpaceAction*) sl; - saction->v2d.tot.ymin= -1000.0; - saction->v2d.tot.ymax= 0.0; + saction->v2d.tot.ymin = -1000.0; + saction->v2d.tot.ymax = 0.0; - saction->v2d.cur.ymin= -75.0; - saction->v2d.cur.ymax= 5.0; + saction->v2d.cur.ymin = -75.0; + saction->v2d.cur.ymax = 5.0; } } sa = sa->next; @@ -11772,8 +11772,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_NLA)) { for (ar = (ARegion*)regionbase->first; ar; ar = ar->next) { if (ar->regiontype == RGN_TYPE_WINDOW) { - ar->v2d.cur.ymax= ar->v2d.tot.ymax= 0.0f; - ar->v2d.cur.ymin= ar->v2d.tot.ymin= (float)(-sa->winy) / 3.0f; + ar->v2d.cur.ymax = ar->v2d.tot.ymax = 0.0f; + ar->v2d.cur.ymin = ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; } } } @@ -11822,10 +11822,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for(sce = main->scene.first; sce; sce = sce->id.next) { if(sce->r.border.xmin == 0.0f && sce->r.border.ymin == 0.0f && sce->r.border.xmax == 0.0f && sce->r.border.ymax == 0.0f) { - sce->r.border.xmin= 0.0f; - sce->r.border.ymin= 0.0f; - sce->r.border.xmax= 1.0f; - sce->r.border.ymax= 1.0f; + sce->r.border.xmin = 0.0f; + sce->r.border.ymin = 0.0f; + sce->r.border.xmax = 1.0f; + sce->r.border.ymax = 1.0f; } if((sce->r.ffcodecdata.flags & FFMPEG_MULTIPLEX_AUDIO) == 0) @@ -13391,7 +13391,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) for(keymap=user->user_keymaps.first; keymap; keymap=keymap->next) { keymap->modal_items= NULL; - keymap->poll= NULL; + keymap->poll = NULL; keymap->flag &= ~KEYMAP_UPDATE; link_list(fd, &keymap->diff_items); diff --git a/source/blender/bmesh/intern/bmesh_inline.h b/source/blender/bmesh/intern/bmesh_inline.h index 6b529326607..2cfaf49d51e 100644 --- a/source/blender/bmesh/intern/bmesh_inline.h +++ b/source/blender/bmesh/intern/bmesh_inline.h @@ -68,8 +68,8 @@ BLI_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b) head_a->hflag = head_b->hflag = head_a->hflag | head_b->hflag; } - -/* notes on BM_elem_index_set(...) usage, +/** + * notes on #BM_elem_index_set(...) usage, * Set index is sometimes abused as temp storage, other times we cant be * sure if the index values are valid because certain operations have modified * the mesh structure. @@ -78,8 +78,8 @@ BLI_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b) * rather then adding inline loops, however there are cases where we still * set the index directly * - * In an attempt to manage this, here are 3 tags Im adding to uses of - * 'BM_elem_index_set' + * In an attempt to manage this, + * here are 5 tags I'm adding to uses of #BM_elem_index_set * * - 'set_inline' -- since the data is already being looped over set to a * valid value inline. @@ -96,6 +96,7 @@ BLI_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b) * * - 'set_loop' -- currently loop index values are not used used much so * assume each case they are dirty. + * * - campbell */ #define BM_elem_index_get(ele) _bm_elem_index_get(&(ele)->head) diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 81513eb0842..b2839db55cf 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -3115,17 +3115,17 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan if (ptr && flag) { switch (ptrsize) { case sizeof(int): /* integer pointer for setting */ - but= uiDefIconButBitI(block, butType, flag, 0, icon, + but = uiDefIconButBitI(block, butType, flag, 0, icon, xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip); break; case sizeof(short): /* short pointer for setting */ - but= uiDefIconButBitS(block, butType, flag, 0, icon, + but = uiDefIconButBitS(block, butType, flag, 0, icon, xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip); break; case sizeof(char): /* char pointer for setting */ - but= uiDefIconButBitC(block, butType, flag, 0, icon, + but = uiDefIconButBitC(block, butType, flag, 0, icon, xpos, ypos, ICON_WIDTH, ICON_WIDTH, ptr, 0, 0, 0, 0, tooltip); break; } @@ -3320,7 +3320,7 @@ void ANIM_channel_draw_widgets (bContext *C, bAnimContext *ac, bAnimListElem *al uiBut *but; /* create the slider button, and assign relevant callback to ensure keyframes are inserted... */ - but= uiDefAutoButR(block, &ptr, prop, array_index, "", ICON_NONE, (int)v2d->cur.xmax-offset, ymid, SLIDER_WIDTH, (int)ymaxc-yminc); + but = uiDefAutoButR(block, &ptr, prop, array_index, "", ICON_NONE, (int)v2d->cur.xmax-offset, ymid, SLIDER_WIDTH, (int)ymaxc-yminc); /* assign keyframing function according to slider type */ if (ale->type == ANIMTYPE_SHAPEKEY) diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index bfe17b80fda..69f45975c76 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1901,10 +1901,10 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* get settings from operator */ - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); extend= RNA_boolean_get(op->ptr, "extend"); diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index f5c70796b58..7937d1969ef 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1486,7 +1486,7 @@ void ED_operatortypes_marker(void) /* called in screen_ops.c:ED_keymap_screen() */ void ED_marker_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Markers", 0, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Markers", 0, 0); wmKeyMapItem *kmi; WM_keymap_verify_item(keymap, "MARKER_OT_add", MKEY, KM_PRESS, 0, 0); @@ -1497,11 +1497,11 @@ void ED_marker_keymap(wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "extend", TRUE); #ifdef DURIAN_CAMERA_SWITCH - kmi= WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "camera", TRUE); - kmi= WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "camera", TRUE); #else diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 05a7a263e08..6ca7ffd5bf3 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -315,7 +315,7 @@ void ED_operatortypes_anim(void) void ED_keymap_anim(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Animation", 0, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Animation", 0, 0); wmKeyMapItem *kmi; /* frame management */ diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index de0af2d8f8f..9b3e481d118 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -126,7 +126,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s /* col= uiLayoutColumn(layout, 1); */ /* UNUSED */ block= uiLayoutGetBlock(layout); uiBlockBeginAlign(block); - but= uiDefButR(block, MENU, B_FMODIFIER_REDRAW, NULL, 0, 0, width-30, UI_UNIT_Y, &ptr, "mode", -1, 0, 0, -1, -1, NULL); + but = uiDefButR(block, MENU, B_FMODIFIER_REDRAW, NULL, 0, 0, width-30, UI_UNIT_Y, &ptr, "mode", -1, 0, 0, -1, -1, NULL); uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); uiDefButR(block, TOG, B_FMODIFIER_REDRAW, NULL, 0, 0, width-30, UI_UNIT_Y, &ptr, "use_additive", -1, 0, 0, -1, -1, NULL); @@ -143,7 +143,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s /* draw polynomial order selector */ row= uiLayoutRow(layout, 0); block= uiLayoutGetBlock(row); - but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 10, 0, width-30, 19, + but = uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 10, 0, width-30, 19, &data->poly_order, 1, 100, 0, 0, TIP_("'Order' of the Polynomial (for a polynomial with n terms, 'order' is n-1)")); uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); @@ -196,7 +196,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s /* draw polynomial order selector */ row= uiLayoutRow(layout, 0); block= uiLayoutGetBlock(row); - but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 0, 0, width-30, 19, + but = uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 0, 0, width-30, 19, &data->poly_order, 1, 100, 0, 0, TIP_("'Order' of the Polynomial (for a polynomial with n terms, 'order' is n-1)")); uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL); @@ -515,7 +515,7 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh uiDefBut(block, LABEL, 1, IFACE_("Control Points:"), 0, 0, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); - but= uiDefBut(block, BUT, B_FMODIFIER_REDRAW, IFACE_("Add Point"), 0, 0, 150, 19, + but = uiDefBut(block, BUT, B_FMODIFIER_REDRAW, IFACE_("Add Point"), 0, 0, 150, 19, NULL, 0, 0, 0, 0, TIP_("Add a new control-point to the envelope on the current frame")); uiButSetFunc(but, fmod_envelope_addpoint_cb, env, NULL); @@ -535,7 +535,7 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Max:"), 0, 0, 100, 20, &fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, TIP_("Maximum bound of envelope at this point")); - but= uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 18, 20, + but = uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete envelope control point")); uiButSetFunc(but, fmod_envelope_deletepoint_cb, env, SET_INT_IN_POINTER(i)); uiBlockBeginAlign(block); @@ -674,7 +674,7 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie uiBlockSetEmboss(block, UI_EMBOSSN); /* delete button */ - but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, + but = uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete F-Curve Modifier")); uiButSetFunc(but, delete_fmodifier_cb, modifiers, fcm); diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index cfc87941dd3..4155f76e515 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -170,31 +170,31 @@ void ED_operatormacros_armature(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot= WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); if(ot) { ot->description = "Make copies of the selected bones within the same armature and move them"; WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); } - ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER); if(ot) { ot->description = "Create new bones from the selected joints and move them"; otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); RNA_boolean_set(otmacro->ptr, "forked", FALSE); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); } // XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate? // that would require fixing a properties bug 19733 - ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER); if(ot) { ot->description = "Create new bones from the selected joints and move them"; otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); RNA_boolean_set(otmacro->ptr, "forked", TRUE); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); } } @@ -205,8 +205,8 @@ void ED_keymap_armature(wmKeyConfig *keyconf) wmKeyMapItem *kmi; /* Armature ------------------------ */ - keymap= WM_keymap_find(keyconf, "Armature", 0, 0); - keymap->poll= ED_operator_editarmature; + keymap = WM_keymap_find(keyconf, "Armature", 0, 0); + keymap->poll = ED_operator_editarmature; /* Armature -> Etch-A-Ton ------------------------ */ WM_keymap_add_item(keymap, "SKETCH_OT_delete", XKEY, KM_PRESS, 0, 0); @@ -228,7 +228,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf) /* only set in editmode armature, by space_view3d listener */ kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "unselected", FALSE); - kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "unselected", TRUE); WM_keymap_add_item(keymap, "ARMATURE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0); @@ -247,17 +247,17 @@ void ED_keymap_armature(wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "action", SEL_INVERT); - kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); RNA_boolean_set(kmi->ptr, "extend", FALSE); - kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); RNA_boolean_set(kmi->ptr, "extend", TRUE); - kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); RNA_boolean_set(kmi->ptr, "extend", FALSE); - kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); RNA_boolean_set(kmi->ptr, "extend", TRUE); @@ -286,10 +286,10 @@ void ED_keymap_armature(wmKeyConfig *keyconf) /* special transforms: */ /* 1) envelope/b-bone size */ - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); RNA_enum_set(kmi->ptr, "mode", TFM_BONESIZE); /* 2) set roll */ - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", RKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", RKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "mode", TFM_BONE_ROLL); /* menus */ @@ -297,8 +297,8 @@ void ED_keymap_armature(wmKeyConfig *keyconf) /* Pose ------------------------ */ /* only set in posemode, by space_view3d listener */ - keymap= WM_keymap_find(keyconf, "Pose", 0, 0); - keymap->poll= ED_operator_posemode; + keymap = WM_keymap_find(keyconf, "Pose", 0, 0); + keymap->poll = ED_operator_posemode; /* set parent and add object are object-based operators, but we make them * available here because it's useful to do in pose mode too */ @@ -327,7 +327,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "flipped", FALSE); - kmi= WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "flipped", TRUE); kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", AKEY, KM_PRESS, 0, 0); @@ -337,17 +337,17 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "POSE_OT_select_parent", PKEY, KM_PRESS, KM_SHIFT, 0); - kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); RNA_boolean_set(kmi->ptr, "extend", FALSE); - kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT); RNA_boolean_set(kmi->ptr, "extend", TRUE); - kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); RNA_boolean_set(kmi->ptr, "extend", FALSE); - kmi= WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD); RNA_boolean_set(kmi->ptr, "extend", TRUE); @@ -374,7 +374,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf) /* special transforms: */ /* 1) envelope/b-bone size */ - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); RNA_enum_set(kmi->ptr, "mode", TFM_BONESIZE); /* keyframes management */ diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 321aa30f55a..71c0e41ee33 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1354,9 +1354,9 @@ static void *get_nearest_bone (bContext *C, short findunsel, int x, int y) view3d_set_viewcontext(C, &vc); - // rect.xmin= ... mouseco! - rect.xmin= rect.xmax= x; - rect.ymin= rect.ymax= y; + // rect.xmin = ... mouseco! + rect.xmin = rect.xmax = x; + rect.ymin = rect.ymax = y; glInitNames(); hits= view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect); @@ -1590,17 +1590,17 @@ static EditBone *get_nearest_editbonepoint (ViewContext *vc, const int mval[2], glInitNames(); - rect.xmin= mval[0]-5; - rect.xmax= mval[0]+5; - rect.ymin= mval[1]-5; - rect.ymax= mval[1]+5; + rect.xmin = mval[0]-5; + rect.xmax = mval[0]+5; + rect.ymin = mval[1]-5; + rect.ymax = mval[1]+5; hits= view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect); if(hits==0) { - rect.xmin= mval[0]-12; - rect.xmax= mval[0]+12; - rect.ymin= mval[1]-12; - rect.ymax= mval[1]+12; + rect.xmin = mval[0]-12; + rect.xmax = mval[0]+12; + rect.ymin = mval[1]-12; + rect.ymax = mval[1]+12; hits= view3d_opengl_select(vc, buffer, MAXPICKBUF, &rect); } /* See if there are any selected bones in this group */ diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 5e5789d411f..f9f3cd60d0b 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -2166,10 +2166,10 @@ static int sk_selectStroke(bContext *C, SK_Sketch *sketch, const int mval[2], in view3d_set_viewcontext(C, &vc); - rect.xmin= mval[0]-5; - rect.xmax= mval[0]+5; - rect.ymin= mval[1]-5; - rect.ymax= mval[1]+5; + rect.xmin = mval[0]-5; + rect.xmax = mval[0]+5; + rect.ymin = mval[1]-5; + rect.ymax = mval[1]+5; hits = view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect); diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index b213f797d47..94ec7c7ce93 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -140,17 +140,17 @@ void ED_operatormacros_curve(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot= WM_operatortype_append_macro("CURVE_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("CURVE_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Duplicate curve and move"; WM_operatortype_macro_define(ot, "CURVE_OT_duplicate"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot= WM_operatortype_append_macro("CURVE_OT_extrude_move", "Extrude Curve and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("CURVE_OT_extrude_move", "Extrude Curve and Move", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Extrude curve and move result"; WM_operatortype_macro_define(ot, "CURVE_OT_extrude"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); } @@ -160,8 +160,8 @@ void ED_keymap_curve(wmKeyConfig *keyconf) wmKeyMap *keymap; wmKeyMapItem *kmi; - keymap= WM_keymap_find(keyconf, "Font", 0, 0); - keymap->poll= ED_operator_editfont; + keymap = WM_keymap_find(keyconf, "Font", 0, 0); + keymap->poll = ED_operator_editfont; /* only set in editmode font, by space_view3d listener */ RNA_enum_set(WM_keymap_add_item(keymap, "FONT_OT_style_toggle", BKEY, KM_PRESS, KM_CTRL, 0)->ptr, "style", CU_CHINFO_BOLD); @@ -214,8 +214,8 @@ void ED_keymap_curve(wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "accent", TRUE); /* accented characters */ /* only set in editmode curve, by space_view3d listener */ - keymap= WM_keymap_find(keyconf, "Curve", 0, 0); - keymap->poll= ED_operator_editsurfcurve; + keymap = WM_keymap_find(keyconf, "Curve", 0, 0); + keymap->poll = ED_operator_editsurfcurve; WM_keymap_add_menu(keymap, "INFO_MT_edit_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index b307052d37a..528991e31f0 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -791,10 +791,10 @@ void draw_gpencil_view3d (Scene *scene, View3D *v3d, ARegion *ar, short only3d) BLI_copy_rcti_rctf(&rect, &rectf); } else { - rect.xmin= 0; - rect.ymin= 0; - rect.xmax= ar->winx; - rect.ymax= ar->winy; + rect.xmin = 0; + rect.ymin = 0; + rect.xmax = ar->winx; + rect.ymax = ar->winy; } /* draw it! */ diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index 954c79bb17d..0afe791029f 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -50,7 +50,7 @@ void ED_keymap_gpencil(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Grease Pencil", 0, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Grease Pencil", 0, 0); wmKeyMapItem *kmi; /* Draw */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index b7ebc6d0a35..4dee4c44694 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -940,10 +940,10 @@ static void gp_stroke_doeraser (tGPsdata *p) rcti rect; /* rect is rectangle of eraser */ - rect.xmin= p->mval[0] - p->radius; - rect.ymin= p->mval[1] - p->radius; - rect.xmax= p->mval[0] + p->radius; - rect.ymax= p->mval[1] + p->radius; + rect.xmin = p->mval[0] - p->radius; + rect.ymin = p->mval[1] - p->radius; + rect.xmax = p->mval[0] + p->radius; + rect.ymax = p->mval[1] + p->radius; /* loop over strokes, checking segments for intersections */ for (gps= gpf->strokes.first; gps; gps= gpn) { diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 4f84b05a16f..229a9dea471 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -137,10 +137,10 @@ void ui_block_to_window_rct(const ARegion *ar, uiBlock *block, rctf *graph, rcti ui_block_to_window_fl(ar, block, &tmpr.xmin, &tmpr.ymin); ui_block_to_window_fl(ar, block, &tmpr.xmax, &tmpr.ymax); - winr->xmin= tmpr.xmin; - winr->ymin= tmpr.ymin; - winr->xmax= tmpr.xmax; - winr->ymax= tmpr.ymax; + winr->xmin = tmpr.xmin; + winr->ymin = tmpr.ymin; + winr->xmax = tmpr.xmax; + winr->ymax = tmpr.ymax; } void ui_window_to_block_fl(const ARegion *ar, uiBlock *block, float *x, float *y) /* for mouse cursor */ @@ -295,10 +295,10 @@ void ui_bounds_block(uiBlock *block) if(bt && strncmp(bt->str, "ERROR", 5)==0) xof= 10; else xof= 40; - block->safety.xmin= block->minx-xof; - block->safety.ymin= block->miny-xof; - block->safety.xmax= block->maxx+xof; - block->safety.ymax= block->maxy+xof; + block->safety.xmin = block->minx-xof; + block->safety.ymin = block->miny-xof; + block->safety.xmax = block->maxx+xof; + block->safety.ymax = block->maxy+xof; } static void ui_centered_bounds_block(const bContext *C, uiBlock *block) @@ -504,10 +504,10 @@ static void ui_draw_linkline(uiLinkLine *line) if(line->from==NULL || line->to==NULL) return; - rect.xmin= (line->from->x1+line->from->x2)/2.0f; - rect.ymin= (line->from->y1+line->from->y2)/2.0f; - rect.xmax= (line->to->x1+line->to->x2)/2.0f; - rect.ymax= (line->to->y1+line->to->y2)/2.0f; + rect.xmin = (line->from->x1+line->from->x2)/2.0f; + rect.ymin = (line->from->y1+line->from->y2)/2.0f; + rect.xmax = (line->to->x1+line->to->x2)/2.0f; + rect.ymax = (line->to->y1+line->to->y2)/2.0f; if(line->flag & UI_SELECT) glColor3ub(100,100,100); @@ -975,14 +975,14 @@ static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, u gx= (but?but->x1:block->minx) + (block->panel?block->panel->ofsx:0.0f); gy= (but?but->y1:block->miny) + (block->panel?block->panel->ofsy:0.0f); - rect->xmin= floorf(getsizex*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]))); - rect->ymin= floorf(getsizey*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]))); + rect->xmin = floorf(getsizex*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]))); + rect->ymin = floorf(getsizey*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]))); gx= (but?but->x2:block->maxx) + (block->panel?block->panel->ofsx:0.0f); gy= (but?but->y2:block->maxy) + (block->panel?block->panel->ofsy:0.0f); - rect->xmax= floorf(getsizex*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]))); - rect->ymax= floorf(getsizey*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]))); + rect->xmax = floorf(getsizex*(0.5f+ 0.5f*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]))); + rect->ymax = floorf(getsizey*(0.5f+ 0.5f*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]))); } diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 39ae2ec37f4..c8fbda8c28a 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1303,10 +1303,10 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect /* need scissor test, curve can draw outside of boundary */ glGetIntegerv(GL_VIEWPORT, scissor); - scissor_new.xmin= ar->winrct.xmin + rect->xmin; - scissor_new.ymin= ar->winrct.ymin + rect->ymin; - scissor_new.xmax= ar->winrct.xmin + rect->xmax; - scissor_new.ymax= ar->winrct.ymin + rect->ymax; + scissor_new.xmin = ar->winrct.xmin + rect->xmin; + scissor_new.ymin = ar->winrct.ymin + rect->ymin; + scissor_new.xmax = ar->winrct.xmin + rect->xmax; + scissor_new.ymax = ar->winrct.ymin + rect->ymax; BLI_isect_rcti(&scissor_new, &ar->winrct, &scissor_new); glScissor(scissor_new.xmin, scissor_new.ymin, scissor_new.xmax-scissor_new.xmin, scissor_new.ymax-scissor_new.ymin); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 4cd89b2f191..de5f12d597e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -651,12 +651,12 @@ static int ui_but_mouse_inside_icon(uiBut *but, ARegion *ar, wmEvent *event) ui_window_to_block(ar, but->block, &x, &y); - rect.xmin= but->x1; rect.xmax= but->x2; - rect.ymin= but->y1; rect.ymax= but->y2; + rect.xmin = but->x1; rect.xmax = but->x2; + rect.ymin = but->y1; rect.ymax = but->y2; if(but->imb); /* use button size itself */ else if(but->flag & UI_ICON_LEFT) { - rect.xmax= rect.xmin + (rect.ymax-rect.ymin); + rect.xmax = rect.xmin + (rect.ymax-rect.ymin); } else { int delta= (rect.xmax-rect.xmin) - (rect.ymax-rect.ymin); @@ -3295,8 +3295,8 @@ static int ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data, int mx float rgb[3]; float hsv[3]; - rect.xmin= but->x1; rect.xmax= but->x2; - rect.ymin= but->y1; rect.ymax= but->y2; + rect.xmin = but->x1; rect.xmax = but->x2; + rect.ymin = but->y1; rect.ymax = but->y2; ui_get_but_vectorf(but, rgb); copy_v3_v3(hsv, ui_block_hsv_get(but->block)); @@ -3801,8 +3801,8 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx int changed= 1; float /* dx, */ dy, yfac=1.f; /* UNUSED */ - /* rect.xmin= but->x1; rect.xmax= but->x2; */ - /* rect.ymin= but->y1; rect.ymax= but->y2; */ + /* rect.xmin = but->x1; rect.xmax = but->x2; */ + /* rect.ymin = but->y1; rect.ymax = but->y2; */ /* dx = mx - data->draglastx; */ /* UNUSED */ dy = my - data->draglasty; @@ -3884,8 +3884,8 @@ static int ui_numedit_but_WAVEFORM(uiBut *but, uiHandleButtonData *data, int mx, int changed= 1; float /* dx, */ dy /* , yfac=1.f */; /* UNUSED */ - /* rect.xmin= but->x1; rect.xmax= but->x2; */ - /* rect.ymin= but->y1; rect.ymax= but->y2; */ + /* rect.xmin = but->x1; rect.xmax = but->x2; */ + /* rect.ymin = but->y1; rect.ymax = but->y2; */ /* dx = mx - data->draglastx; */ /* UNUSED */ dy = my - data->draglasty; @@ -3967,8 +3967,8 @@ static int ui_numedit_but_VECTORSCOPE(uiBut *but, uiHandleButtonData *data, int int changed= 1; /* float dx, dy; */ - /* rect.xmin= but->x1; rect.xmax= but->x2; */ - /* rect.ymin= but->y1; rect.ymax= but->y2; */ + /* rect.xmin = but->x1; rect.xmax = but->x2; */ + /* rect.ymin = but->y1; rect.ymax = but->y2; */ /* dx = mx - data->draglastx; */ /* dy = my - data->draglasty; */ @@ -4507,11 +4507,11 @@ static int ui_but_menu(bContext *C, uiBut *but) IDProperty *prop= (but->opptr)? but->opptr->data: NULL; int w = uiLayoutGetWidth(layout); wmKeyMap *km; - wmKeyMapItem *kmi= NULL; + wmKeyMapItem *kmi = NULL; int kmi_id= WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, 1, &km); if (kmi_id) - kmi= WM_keymap_item_find_id(km, kmi_id); + kmi = WM_keymap_item_find_id(km, kmi_id); /* keyboard shortcuts */ if ((kmi) && ISKEYBOARD(kmi->type)) { @@ -4882,22 +4882,22 @@ static int ui_mouse_inside_region(ARegion *ar, int x, int y) ui_window_to_region(ar, &mx, &my); /* make a copy of the mask rect, and tweak accordingly for hidden scrollbars */ - mask_rct.xmin= v2d->mask.xmin; - mask_rct.xmax= v2d->mask.xmax; - mask_rct.ymin= v2d->mask.ymin; - mask_rct.ymax= v2d->mask.ymax; + mask_rct.xmin = v2d->mask.xmin; + mask_rct.xmax = v2d->mask.xmax; + mask_rct.ymin = v2d->mask.ymin; + mask_rct.ymax = v2d->mask.ymax; if (v2d->scroll & (V2D_SCROLL_VERTICAL_HIDE|V2D_SCROLL_VERTICAL_FULLR)) { if (v2d->scroll & V2D_SCROLL_LEFT) - mask_rct.xmin= v2d->vert.xmin; + mask_rct.xmin = v2d->vert.xmin; else if (v2d->scroll & V2D_SCROLL_RIGHT) - mask_rct.xmax= v2d->vert.xmax; + mask_rct.xmax = v2d->vert.xmax; } if (v2d->scroll & (V2D_SCROLL_HORIZONTAL_HIDE|V2D_SCROLL_HORIZONTAL_FULLR)) { if (v2d->scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) - mask_rct.ymin= v2d->hor.ymin; + mask_rct.ymin = v2d->hor.ymin; else if (v2d->scroll & V2D_SCROLL_TOP) - mask_rct.ymax= v2d->hor.ymax; + mask_rct.ymax = v2d->hor.ymax; } /* check if in the rect */ diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 723ffb355a2..1c2f2cacf62 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -388,7 +388,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in if(layer_used & (1<<(a+b*colbuts))) icon= ICON_LAYER_USED; else icon= ICON_BLANK1; - but= uiDefAutoButR(block, ptr, prop, a+b*colbuts, "", icon, x + butw*a, y+buth, butw, buth); + but = uiDefAutoButR(block, ptr, prop, a+b*colbuts, "", icon, x + butw*a, y+buth, butw, buth); if(subtype == PROP_LAYER_MEMBER) uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+b*colbuts)); } @@ -396,7 +396,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in if(layer_used & (1<<(a+len/2+b*colbuts))) icon= ICON_LAYER_USED; else icon= ICON_BLANK1; - but= uiDefAutoButR(block, ptr, prop, a+len/2+b*colbuts, "", icon, x + butw*a, y, butw, buth); + but = uiDefAutoButR(block, ptr, prop, a+len/2+b*colbuts, "", icon, x + butw*a, y, butw, buth); if(subtype == PROP_LAYER_MEMBER) uiButSetFunc(but, ui_layer_but_cb, but, SET_INT_IN_POINTER(a+len/2+b*colbuts)); } @@ -421,7 +421,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in col= a % dim_size[0]; row= a / dim_size[0]; - but= uiDefAutoButR(block, ptr, prop, a, "", ICON_NONE, x + w*col, y+(dim_size[1]*UI_UNIT_Y)-(row*UI_UNIT_Y), w, UI_UNIT_Y); + but = uiDefAutoButR(block, ptr, prop, a, "", ICON_NONE, x + w*col, y+(dim_size[1]*UI_UNIT_Y)-(row*UI_UNIT_Y), w, UI_UNIT_Y); if(slider && but->type==NUM) but->type= NUMSLI; } @@ -460,7 +460,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in for(a=0; atype==NUM) but->type= NUMSLI; if(toggle && but->type==OPTION) @@ -496,11 +496,11 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt itemw= ui_text_icon_width(block->curlayout, name, icon, 0); if(icon && name[0] && !icon_only) - but= uiDefIconTextButR_prop(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); else if(icon) - but= uiDefIconButR_prop(block, ROW, 0, icon, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); + but = uiDefIconButR_prop(block, ROW, 0, icon, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); else - but= uiDefButR_prop(block, ROW, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); + but = uiDefButR_prop(block, ROW, 0, name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL); if(ui_layout_local_dir(layout) != UI_LAYOUT_HORIZONTAL) but->flag |= UI_TEXT_LEFT; @@ -554,7 +554,7 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, const char *n uiDefAutoButR(block, ptr, prop, index, "", icon, x, y, w-UI_UNIT_X, h); /* BUTTONS_OT_file_browse calls uiFileBrowseContextProperty */ - but= uiDefIconButO(block, BUT, subtype==PROP_DIRPATH ? + but = uiDefIconButO(block, BUT, subtype==PROP_DIRPATH ? "BUTTONS_OT_directory_browse" : "BUTTONS_OT_file_browse", WM_OP_INVOKE_DEFAULT, ICON_FILESEL, x, y, UI_UNIT_X, h, NULL); @@ -568,14 +568,14 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, const char *n WM_keymap_item_to_string(ptr->data, buf, sizeof(buf)); - but= uiDefButR_prop(block, HOTKEYEVT, 0, buf, x, y, w, h, ptr, prop, 0, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, HOTKEYEVT, 0, buf, x, y, w, h, ptr, prop, 0, 0, 0, -1, -1, NULL); uiButSetFunc(but, ui_keymap_but_cb, but, NULL); if (flag & UI_ITEM_R_IMMEDIATE) uiButSetFlag(but, UI_BUT_IMMEDIATE); } } else - but= uiDefAutoButR(block, ptr, prop, index, (type == PROP_ENUM && !(flag & UI_ITEM_R_ICON_ONLY))? NULL: "", icon, x, y, w, h); + but = uiDefAutoButR(block, ptr, prop, index, (type == PROP_ENUM && !(flag & UI_ITEM_R_ICON_ONLY))? NULL: "", icon, x, y, w, h); uiBlockSetCurLayout(block, layout); return but; @@ -625,7 +625,7 @@ static void ui_item_disabled(uiLayout *layout, const char *name) w= ui_text_icon_width(layout, name, 0, 0); - but= uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); but->flag |= UI_BUT_DISABLED; but->lock = 1; but->lockstr = ""; @@ -666,7 +666,7 @@ PointerRNA uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *nam } } else { - but= uiDefButO_ptr(block, BUT, ot, context, name, 0, 0, w, UI_UNIT_Y, NULL); + but = uiDefButO_ptr(block, BUT, ot, context, name, 0, 0, w, UI_UNIT_Y, NULL); } assert(but->optype != NULL); @@ -1105,7 +1105,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index } /* single button */ else { - but= uiDefAutoButR(block, ptr, prop, index, name, icon, 0, 0, w, h); + but = uiDefAutoButR(block, ptr, prop, index, name, icon, 0, 0, w, h); if(slider && but->type==NUM) but->type= NUMSLI; @@ -1463,11 +1463,11 @@ static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCre w -= 10; if(name[0] && icon) - but= uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, tip); + but = uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, tip); else if(icon) - but= uiDefIconMenuBut(block, func, arg, icon, 0, 0, w, h, tip); + but = uiDefIconMenuBut(block, func, arg, icon, 0, 0, w, h, tip); else - but= uiDefMenuBut(block, func, arg, name, 0, 0, w, h, tip); + but = uiDefMenuBut(block, func, arg, name, 0, 0, w, h, tip); if(argN) { /* ugly .. */ but->poin= (char*)but; @@ -1486,7 +1486,7 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const { MenuType *mt; - mt= WM_menutype_find(menuname, FALSE); + mt = WM_menutype_find(menuname, FALSE); if(mt==NULL) { RNA_warning("not found %s", menuname); @@ -1494,7 +1494,7 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const } if(!name) { - name= IFACE_(mt->label); + name = IFACE_(mt->label); } if(layout->root->type == UI_LAYOUT_MENU && !icon) @@ -1520,11 +1520,11 @@ static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon) w= ui_text_icon_width(layout, name, icon, 0); if(icon && name[0]) - but= uiDefIconTextBut(block, LABEL, 0, icon, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefIconTextBut(block, LABEL, 0, icon, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); else if(icon) - but= uiDefIconBut(block, LABEL, 0, icon, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefIconBut(block, LABEL, 0, icon, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); else - but= uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); return but; } diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index c5abcd46437..ffb8b0acf37 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -441,7 +441,7 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r Panel *panel= block->panel; rcti hrect; int pnl_icons; - const char *activename= IFACE_(panel->drawname[0] ? panel->drawname : panel->panelname); + const char *activename = IFACE_(panel->drawname[0] ? panel->drawname : panel->panelname); /* + 0.001f to avoid flirting with float inaccuracy */ if(panel->control & UI_PNL_CLOSE) pnl_icons=(panel->labelofs+2*PNL_ICON+5)/block->aspect + 0.001f; @@ -453,7 +453,7 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r hrect= *rect; if(dir == 'h') { - hrect.xmin= rect->xmin+pnl_icons; + hrect.xmin = rect->xmin+pnl_icons; hrect.ymin += 2.0f/block->aspect; uiStyleFontDraw(&style->paneltitle, &hrect, activename); } @@ -461,7 +461,7 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r /* ignore 'pnl_icons', otherwise the text gets offset horizontally * + 0.001f to avoid flirting with float inaccuracy */ - hrect.xmin= rect->xmin + (PNL_ICON+5)/block->aspect + 0.001f; + hrect.xmin = rect->xmin + (PNL_ICON+5)/block->aspect + 0.001f; uiStyleFontDrawRotated(&style->paneltitle, &hrect, activename); } } @@ -473,10 +473,10 @@ static void rectf_scale(rctf *rect, float scale) float sizex= 0.5f*scale*(rect->xmax - rect->xmin); float sizey= 0.5f*scale*(rect->ymax - rect->ymin); - rect->xmin= centx - sizex; - rect->xmax= centx + sizex; - rect->ymin= centy - sizey; - rect->ymax= centy + sizey; + rect->xmin = centx - sizex; + rect->xmax = centx + sizex; + rect->ymin = centy - sizey; + rect->ymax = centy + sizey; } /* panel integrated in buttonswindow, tool/property lists etc */ @@ -494,8 +494,8 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) /* calculate header rect */ /* + 0.001f to prevent flicker due to float inaccuracy */ headrect= *rect; - headrect.ymin= headrect.ymax; - headrect.ymax= headrect.ymin + floor(PNL_HEADER/block->aspect + 0.001f); + headrect.ymin = headrect.ymax; + headrect.ymax = headrect.ymin + floor(PNL_HEADER/block->aspect + 0.001f); { float minx= rect->xmin; @@ -533,10 +533,10 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) ui_draw_aligned_panel_header(style, block, &headrect, 'h'); /* itemrect smaller */ - itemrect.xmax= headrect.xmax - 5.0f/block->aspect; - itemrect.xmin= itemrect.xmax - (headrect.ymax-headrect.ymin); - itemrect.ymin= headrect.ymin; - itemrect.ymax= headrect.ymax; + itemrect.xmax = headrect.xmax - 5.0f/block->aspect; + itemrect.xmin = itemrect.xmax - (headrect.ymax-headrect.ymin); + itemrect.ymin = headrect.ymin; + itemrect.ymax = headrect.ymax; rectf_scale(&itemrect, 0.7f); ui_draw_panel_dragwidget(&itemrect); @@ -582,10 +582,10 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect) UI_ThemeColor(TH_TEXT); /* itemrect smaller */ - itemrect.xmin= headrect.xmin + 5.0f/block->aspect; - itemrect.xmax= itemrect.xmin + (headrect.ymax-headrect.ymin); - itemrect.ymin= headrect.ymin; - itemrect.ymax= headrect.ymax; + itemrect.xmin = headrect.xmin + 5.0f/block->aspect; + itemrect.xmax = itemrect.xmin + (headrect.ymax-headrect.ymin); + itemrect.ymin = headrect.ymin; + itemrect.ymax = headrect.ymax; rectf_scale(&itemrect, 0.35f); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 9b60915898d..b375b8d154f 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -386,8 +386,8 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar) /* draw text */ uiStyleFontSet(&data->fstyle); - bbox.ymax= bbox.ymax - 0.5f*((bbox.ymax - bbox.ymin) - data->toth); - bbox.ymin= bbox.ymax - data->lineh; + bbox.ymax = bbox.ymax - 0.5f*((bbox.ymax - bbox.ymin) - data->toth); + bbox.ymin = bbox.ymax - data->lineh; for (i = 0; i < data->totline; i++) { glColor3fv(tip_colors[data->color_id[i]]); @@ -656,16 +656,16 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) } /* widget rect, in region coords */ - data->bbox.xmin= MENU_SHADOW_SIDE; - data->bbox.xmax= x2-x1 + MENU_SHADOW_SIDE; - data->bbox.ymin= MENU_SHADOW_BOTTOM; - data->bbox.ymax= y2-y1 + MENU_SHADOW_BOTTOM; + data->bbox.xmin = MENU_SHADOW_SIDE; + data->bbox.xmax = x2-x1 + MENU_SHADOW_SIDE; + data->bbox.ymin = MENU_SHADOW_BOTTOM; + data->bbox.ymax = y2-y1 + MENU_SHADOW_BOTTOM; /* region bigger for shadow */ - ar->winrct.xmin= x1 - MENU_SHADOW_SIDE; - ar->winrct.xmax= x2 + MENU_SHADOW_SIDE; - ar->winrct.ymin= y1 - MENU_SHADOW_BOTTOM; - ar->winrct.ymax= y2 + MENU_TOP; + ar->winrct.xmin = x1 - MENU_SHADOW_SIDE; + ar->winrct.xmax = x2 + MENU_SHADOW_SIDE; + ar->winrct.ymin = y1 - MENU_SHADOW_BOTTOM; + ar->winrct.ymax = y2 + MENU_TOP; /* adds subwindow */ ED_region_init(C, ar); @@ -812,11 +812,11 @@ static void ui_searchbox_butrect(rcti *rect, uiSearchboxData *data, int itemnr) int buth= (data->bbox.ymax-data->bbox.ymin - 2*MENU_TOP)/SEARCH_ITEMS; *rect= data->bbox; - rect->xmin= data->bbox.xmin + 3.0f; - rect->xmax= data->bbox.xmax - 3.0f; + rect->xmin = data->bbox.xmin + 3.0f; + rect->xmax = data->bbox.xmax - 3.0f; - rect->ymax= data->bbox.ymax - MENU_TOP - itemnr*buth; - rect->ymin= rect->ymax - buth; + rect->ymax = data->bbox.ymax - MENU_TOP - itemnr*buth; + rect->ymin = rect->ymax - buth; } } @@ -1099,10 +1099,10 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) ar->winrct= butregion->winrct; /* widget rect, in region coords */ - data->bbox.xmin= MENU_SHADOW_SIDE; - data->bbox.xmax= (ar->winrct.xmax-ar->winrct.xmin) - MENU_SHADOW_SIDE; - data->bbox.ymin= MENU_SHADOW_BOTTOM; - data->bbox.ymax= (ar->winrct.ymax-ar->winrct.ymin) - MENU_SHADOW_BOTTOM; + data->bbox.xmin = MENU_SHADOW_SIDE; + data->bbox.xmax = (ar->winrct.xmax-ar->winrct.xmin) - MENU_SHADOW_SIDE; + data->bbox.ymin = MENU_SHADOW_BOTTOM; + data->bbox.ymax = (ar->winrct.ymax-ar->winrct.ymin) - MENU_SHADOW_BOTTOM; /* check if button is lower half */ if( but->y2 < (but->block->miny+but->block->maxy)/2 ) { @@ -1166,16 +1166,16 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) } /* widget rect, in region coords */ - data->bbox.xmin= MENU_SHADOW_SIDE; - data->bbox.xmax= x2-x1 + MENU_SHADOW_SIDE; - data->bbox.ymin= MENU_SHADOW_BOTTOM; - data->bbox.ymax= y2-y1 + MENU_SHADOW_BOTTOM; + data->bbox.xmin = MENU_SHADOW_SIDE; + data->bbox.xmax = x2-x1 + MENU_SHADOW_SIDE; + data->bbox.ymin = MENU_SHADOW_BOTTOM; + data->bbox.ymax = y2-y1 + MENU_SHADOW_BOTTOM; /* region bigger for shadow */ - ar->winrct.xmin= x1 - MENU_SHADOW_SIDE; - ar->winrct.xmax= x2 + MENU_SHADOW_SIDE; - ar->winrct.ymin= y1 - MENU_SHADOW_BOTTOM; - ar->winrct.ymax= y2; + ar->winrct.xmin = x1 - MENU_SHADOW_SIDE; + ar->winrct.xmax = x2 + MENU_SHADOW_SIDE; + ar->winrct.ymin = y1 - MENU_SHADOW_BOTTOM; + ar->winrct.ymax = y2; } /* adds subwindow */ @@ -1262,8 +1262,8 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but, short dir1= 0, dir2=0; /* transform to window coordinates, using the source button region/block */ - butrct.xmin= but->x1; butrct.xmax= but->x2; - butrct.ymin= but->y1; butrct.ymax= but->y2; + butrct.xmin = but->x1; butrct.xmax = but->x2; + butrct.ymin = but->y1; butrct.ymax = but->y2; ui_block_to_window_fl(butregion, but->block, &butrct.xmin, &butrct.ymin); ui_block_to_window_fl(butregion, but->block, &butrct.xmax, &butrct.ymax); @@ -1443,31 +1443,31 @@ static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but, /* when you are outside parent button, safety there should be smaller */ // parent button to left - if( midx < block->minx ) block->safety.xmin= block->minx-3; - else block->safety.xmin= block->minx-40; + if( midx < block->minx ) block->safety.xmin = block->minx-3; + else block->safety.xmin = block->minx-40; // parent button to right - if( midx > block->maxx ) block->safety.xmax= block->maxx+3; - else block->safety.xmax= block->maxx+40; + if( midx > block->maxx ) block->safety.xmax = block->maxx+3; + else block->safety.xmax = block->maxx+40; // parent button on bottom - if( midy < block->miny ) block->safety.ymin= block->miny-3; - else block->safety.ymin= block->miny-40; + if( midy < block->miny ) block->safety.ymin = block->miny-3; + else block->safety.ymin = block->miny-40; // parent button on top - if( midy > block->maxy ) block->safety.ymax= block->maxy+3; - else block->safety.ymax= block->maxy+40; + if( midy > block->maxy ) block->safety.ymax = block->maxy+3; + else block->safety.ymax = block->maxy+40; // exception for switched pulldowns... if(dir1 && (dir1 & block->direction)==0) { - if(dir2==UI_RIGHT) block->safety.xmax= block->maxx+3; - if(dir2==UI_LEFT) block->safety.xmin= block->minx-3; + if(dir2==UI_RIGHT) block->safety.xmax = block->maxx+3; + if(dir2==UI_LEFT) block->safety.xmin = block->minx-3; } block->direction= dir1; } else { - block->safety.xmin= block->minx-40; - block->safety.ymin= block->miny-40; - block->safety.xmax= block->maxx+40; - block->safety.ymax= block->maxy+40; + block->safety.xmin = block->minx-40; + block->safety.ymin = block->miny-40; + block->safety.xmax = block->maxx+40; + block->safety.ymax = block->maxy+40; } /* keep a list of these, needed for pulldown menus */ @@ -1615,10 +1615,10 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut /* the block and buttons were positioned in window space as in 2.4x, now * these menu blocks are regions so we bring it back to region space. * additionally we add some padding for the menu shadow or rounded menus */ - ar->winrct.xmin= block->minx - MENU_SHADOW_SIDE; - ar->winrct.xmax= block->maxx + MENU_SHADOW_SIDE; - ar->winrct.ymin= block->miny - MENU_SHADOW_BOTTOM; - ar->winrct.ymax= block->maxy + MENU_TOP; + ar->winrct.xmin = block->minx - MENU_SHADOW_SIDE; + ar->winrct.xmax = block->maxx + MENU_SHADOW_SIDE; + ar->winrct.ymin = block->miny - MENU_SHADOW_BOTTOM; + ar->winrct.ymax = block->maxy + MENU_TOP; block->minx -= ar->winrct.xmin; block->maxx -= ar->winrct.xmin; @@ -2457,7 +2457,7 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon) uiDefIconTextBut(pup->block, LABEL, 0, icon, titlestr, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); } else { - but= uiDefBut(pup->block, LABEL, 0, title, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefBut(pup->block, LABEL, 0, title, 0, 0, 200, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); but->flag= UI_TEXT_LEFT; } } @@ -2629,7 +2629,7 @@ void uiPupMenuInvoke(bContext *C, const char *idname) uiPopupMenu *pup; uiLayout *layout; Menu menu; - MenuType *mt= WM_menutype_find(idname, TRUE); + MenuType *mt = WM_menutype_find(idname, TRUE); if(mt==NULL) { printf("%s: named menu \"%s\" not found\n", __func__, idname); diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 65e2b98f4b9..580b0ff05dc 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -219,10 +219,10 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str) angle= 90.0f; /* translate rect to vertical */ - txtrect.xmin= rect->xmin - (rect->ymax - rect->ymin); - txtrect.ymin= rect->ymin - (rect->xmax - rect->xmin); - txtrect.xmax= rect->xmin; - txtrect.ymax= rect->ymin; + txtrect.xmin = rect->xmin - (rect->ymax - rect->ymin); + txtrect.ymin = rect->ymin - (rect->xmax - rect->xmin); + txtrect.xmax = rect->xmin; + txtrect.ymax = rect->ymin; /* clip is very strict, so we give it some space */ /* clipping is done without rotation, so make rect big enough to contain both positions */ diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 2b225fb56c2..ca6b37f9013 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -182,7 +182,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, w, h, NULL, 0, 0, 0, 0, NULL); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, 19, template.prv_rows, template.prv_cols, ""); + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, 19, template.prv_rows, template.prv_cols, ""); uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data); } /* list view */ @@ -190,7 +190,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, ""); + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, ""); uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data); } @@ -360,7 +360,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str if(flag & UI_ID_PREVIEWS) { - but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, + but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, TIP_(template_id_browse_tip(type))); if(type) { but->icon= RNA_struct_ui_icon(type); @@ -374,7 +374,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str template->preview= 1; } else if(flag & UI_ID_BROWSE) { - but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, + but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, TIP_(template_id_browse_tip(type))); if(type) { but->icon= RNA_struct_ui_icon(type); @@ -394,18 +394,18 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str //text_idbutton(id, name); name[0]= '\0'; - but= uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X*6, UI_UNIT_Y, &idptr, "name", -1, 0, 0, -1, -1, NULL); + but = uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X*6, UI_UNIT_Y, &idptr, "name", -1, 0, 0, -1, -1, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME)); if(user_alert) uiButSetFlag(but, UI_BUT_REDALERT); if(id->lib) { if(id->flag & LIB_INDIRECT) { - but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, + but = uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Indirect library datablock, cannot change")); uiButSetFlag(but, UI_BUT_DISABLED); } else { - but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, + but = uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Direct linked library datablock, click to make local")); if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib)) uiButSetFlag(but, UI_BUT_DISABLED); @@ -419,7 +419,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str BLI_snprintf(numstr, sizeof(numstr), "%d", id->us); - but= uiDefBut(block, BUT, 0, numstr, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, + but = uiDefBut(block, BUT, 0, numstr, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Display number of users of this data (click to make a single-user copy)")); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE)); @@ -438,11 +438,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str int w= id?UI_UNIT_X: (flag & UI_ID_OPEN)? UI_UNIT_X*3: UI_UNIT_X*6; if(newop) { - but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL); + but = uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } else { - but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + but = uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } @@ -454,11 +454,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str int w= id?UI_UNIT_X: (flag & UI_ID_ADD_NEW)? UI_UNIT_X*3: UI_UNIT_X*6; if(openop) { - but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL); + but = uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN)); } else { - but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + but = uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN)); } @@ -469,12 +469,12 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str /* delete button */ if(id && (flag & UI_ID_DELETE) && (RNA_property_flag(template->prop) & PROP_NEVER_UNLINK)==0) { if(unlinkop) { - but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); + but = uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); /* so we can access the template from operators, font unlinking needs this */ uiButSetNFunc(but, NULL, MEM_dupallocN(template), NULL); } else { - but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, + but = uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Unlink datablock. Shift + Click to set users to zero, data will then not be saved")); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE)); @@ -787,7 +787,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, /* place holder button */ uiBlockSetEmboss(block, UI_EMBOSSN); - but= uiDefIconBut(block, BUT, 0, ICON_NONE, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, NULL); + but = uiDefIconBut(block, BUT, 0, ICON_NONE, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, NULL); uiButSetFlag(but, UI_BUT_DISABLED); uiBlockSetEmboss(block, UI_EMBOSS); } @@ -1431,8 +1431,8 @@ void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname cb->ptr= *ptr; cb->prop= prop; - rect.xmin= 0; rect.xmax= 200; - rect.ymin= 0; rect.ymax= 190; + rect.xmin = 0; rect.xmax = 200; + rect.ymin = 0; rect.ymax = 190; block= uiLayoutAbsoluteBlock(layout); colorband_buttons_layout(layout, block, cptr.data, &rect, !expand, cb); @@ -1463,8 +1463,8 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname cb->ptr= *ptr; cb->prop= prop; - rect.xmin= 0; rect.xmax= 200; - rect.ymin= 0; rect.ymax= 190; + rect.xmin = 0; rect.xmax = 200; + rect.ymin = 0; rect.ymax = 190; block= uiLayoutAbsoluteBlock(layout); //colorband_buttons_layout(layout, block, cptr.data, &rect, !expand, cb); @@ -1503,8 +1503,8 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname) cb->ptr= *ptr; cb->prop= prop; - rect.xmin= 0; rect.xmax= 200; - rect.ymin= 0; rect.ymax= 190; + rect.xmin = 0; rect.xmax = 200; + rect.ymin = 0; rect.ymax = 190; block= uiLayoutAbsoluteBlock(layout); @@ -1540,8 +1540,8 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna cb->ptr= *ptr; cb->prop= prop; - rect.xmin= 0; rect.xmax= 200; - rect.ymin= 0; rect.ymax= 190; + rect.xmin = 0; rect.xmax = 200; + rect.ymin = 0; rect.ymax = 190; block= uiLayoutAbsoluteBlock(layout); @@ -1937,7 +1937,7 @@ void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, const char *propnam col = uiLayoutColumn(layout, 0); row= uiLayoutRow(col, 1); - but= uiDefButR_prop(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, prop, -1, 0.0, 0.0, 0, 0, ""); + but = uiDefButR_prop(block, HSVCIRCLE, 0, "", 0, 0, WHEEL_SIZE, WHEEL_SIZE, ptr, prop, -1, 0.0, 0.0, 0, 0, ""); if(lock) { but->flag |= UI_BUT_COLOR_LOCK; @@ -2046,7 +2046,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname, else if(used_prop && RNA_property_boolean_get_index(used_ptr, used_prop, layer)) icon = ICON_LAYER_USED; - but= uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X/2, UI_UNIT_Y/2); + but = uiDefAutoButR(block, ptr, prop, layer, "", icon, 0, 0, UI_UNIT_X/2, UI_UNIT_Y/2); uiButSetFunc(but, handle_layer_buttons, but, SET_INT_IN_POINTER(layer)); but->type= TOG; } @@ -2108,7 +2108,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe /* list item behind label & other buttons */ sub= uiLayoutRow(overlap, 0); - but= uiDefButR_prop(block, LISTROW, 0, "", 0,0, UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, ""); + but = uiDefButR_prop(block, LISTROW, 0, "", 0,0, UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, ""); uiButSetFlag(but, UI_BUT_NO_TOOLTIP); sub= uiLayoutRow(overlap, 0); @@ -2366,7 +2366,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * row= uiLayoutRow(col, 0); icon= list_item_icon_get(C, &itemptr, rnaicon, 1); - but= uiDefIconButR_prop(block, LISTROW, 0, icon, 0,0,UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, ""); + but = uiDefIconButR_prop(block, LISTROW, 0, icon, 0,0,UI_UNIT_X*10,UI_UNIT_Y, activeptr, activeprop, 0, 0, i, 0, 0, ""); uiButSetFlag(but, UI_BUT_NO_TOOLTIP); @@ -2407,7 +2407,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * /* next/prev button */ BLI_snprintf(numstr, sizeof(numstr), "%d :", i); - but= uiDefIconTextButR_prop(block, NUM, 0, 0, numstr, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, ""); + but = uiDefIconTextButR_prop(block, NUM, 0, 0, numstr, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, ""); if(i == 0) uiButSetFlag(but, UI_BUT_DISABLED); } @@ -2519,7 +2519,7 @@ void uiTemplateOperatorSearch(uiLayout *layout) block= uiLayoutGetBlock(layout); uiBlockSetCurLayout(block, layout); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 0, 0, UI_UNIT_X*6, UI_UNIT_Y, 0, 0, ""); + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 0, 0, UI_UNIT_X*6, UI_UNIT_Y, 0, 0, ""); uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); } @@ -2644,12 +2644,12 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) /* make a box around the report to make it stand out */ uiBlockBeginAlign(block); - but= uiDefBut(block, ROUNDBOX, 0, "", 0, 0, UI_UNIT_X+10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); + but = uiDefBut(block, ROUNDBOX, 0, "", 0, 0, UI_UNIT_X+10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); /* set the report's bg color in but->col - ROUNDBOX feature */ rgb_float_to_uchar(but->col, rti->col); but->col[3]= 255; - but= uiDefBut(block, ROUNDBOX, 0, "", UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); + but = uiDefBut(block, ROUNDBOX, 0, "", UI_UNIT_X+10, 0, UI_UNIT_X+width, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); but->col[0]= but->col[1]= but->col[2]= FTOCHAR(rti->greyscale); but->col[3]= 255; @@ -2683,7 +2683,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) static void keymap_item_modified(bContext *UNUSED(C), void *kmi_p, void *UNUSED(unused)) { - wmKeyMapItem *kmi= (wmKeyMapItem*)kmi_p; + wmKeyMapItem *kmi = (wmKeyMapItem*)kmi_p; WM_keyconfig_update_tag(NULL, kmi); } diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 610e9f8762d..6692bd7bea8 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -64,11 +64,11 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind return NULL; if(icon && name && name[0] == '\0') - but= uiDefIconButR_prop(block, ICONTOG, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconButR_prop(block, ICONTOG, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else if(icon) - but= uiDefIconTextButR_prop(block, ICONTOG, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, ICONTOG, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else - but= uiDefButR_prop(block, OPTION, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, OPTION, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; } case PROP_INT: @@ -78,29 +78,29 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind if(arraylen && index == -1) { if(ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA)) - but= uiDefButR_prop(block, COL, 0, name, x1, y1, x2, y2, ptr, prop, 0, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, COL, 0, name, x1, y1, x2, y2, ptr, prop, 0, 0, 0, -1, -1, NULL); } else if(RNA_property_subtype(prop) == PROP_PERCENTAGE || RNA_property_subtype(prop) == PROP_FACTOR) - but= uiDefButR_prop(block, NUMSLI, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, NUMSLI, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else - but= uiDefButR_prop(block, NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; } case PROP_ENUM: if(icon && name && name[0] == '\0') - but= uiDefIconButR_prop(block, MENU, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconButR_prop(block, MENU, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else if(icon) - but= uiDefIconTextButR_prop(block, MENU, 0, icon, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, MENU, 0, icon, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else - but= uiDefButR_prop(block, MENU, 0, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, MENU, 0, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; case PROP_STRING: if(icon && name && name[0] == '\0') - but= uiDefIconButR_prop(block, TEX, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconButR_prop(block, TEX, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else if(icon) - but= uiDefIconTextButR_prop(block, TEX, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, TEX, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); else - but= uiDefButR_prop(block, TEX, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefButR_prop(block, TEX, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; case PROP_POINTER: { PointerRNA pptr; @@ -112,13 +112,13 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind if(icon == ICON_DOT) icon= 0; - but= uiDefIconTextButR_prop(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); + but = uiDefIconTextButR_prop(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; } case PROP_COLLECTION: { char text[256]; BLI_snprintf(text, sizeof(text), IFACE_("%d items"), RNA_property_collection_length(ptr, prop)); - but= uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL); + but = uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL); uiButSetFlag(but, UI_BUT_DISABLED); break; } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index a8df7ec7d35..32cb3f94ee7 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2347,35 +2347,35 @@ static void widget_scroll(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat if(horizontal) { fac= (rect->xmax - rect->xmin)/(size); - rect1.xmin= rect1.xmin + ceilf(fac*((float)value - but->softmin)); - rect1.xmax= rect1.xmin + ceilf(fac*(but->a1 - but->softmin)); + rect1.xmin = rect1.xmin + ceilf(fac*((float)value - but->softmin)); + rect1.xmax = rect1.xmin + ceilf(fac*(but->a1 - but->softmin)); /* ensure minimium size */ min= rect->ymax - rect->ymin; if(rect1.xmax - rect1.xmin < min) { - rect1.xmax= rect1.xmin + min; + rect1.xmax = rect1.xmin + min; if(rect1.xmax > rect->xmax) { - rect1.xmax= rect->xmax; - rect1.xmin= MAX2(rect1.xmax - min, rect->xmin); + rect1.xmax = rect->xmax; + rect1.xmin = MAX2(rect1.xmax - min, rect->xmin); } } } else { fac= (rect->ymax - rect->ymin)/(size); - rect1.ymax= rect1.ymax - ceilf(fac*((float)value - but->softmin)); - rect1.ymin= rect1.ymax - ceilf(fac*(but->a1 - but->softmin)); + rect1.ymax = rect1.ymax - ceilf(fac*((float)value - but->softmin)); + rect1.ymin = rect1.ymax - ceilf(fac*(but->a1 - but->softmin)); /* ensure minimium size */ min= rect->xmax - rect->xmin; if(rect1.ymax - rect1.ymin < min) { - rect1.ymax= rect1.ymin + min; + rect1.ymax = rect1.ymin + min; if(rect1.ymax > rect->ymax) { - rect1.ymax= rect->ymax; - rect1.ymin= MAX2(rect1.ymax - min, rect->ymin); + rect1.ymax = rect->ymax; + rect1.ymin = MAX2(rect1.ymax - min, rect->ymin); } } } @@ -2421,10 +2421,10 @@ static void widget_link(uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect, in UI_ThemeColor(TH_TEXT_HI); - rectlink.xmin= (rect->xmin+rect->xmax)/2; - rectlink.ymin= (rect->ymin+rect->ymax)/2; - rectlink.xmax= but->linkto[0]; - rectlink.ymax= but->linkto[1]; + rectlink.xmin = (rect->xmin+rect->xmax)/2; + rectlink.ymin = (rect->ymin+rect->ymax)/2; + rectlink.xmax = but->linkto[0]; + rectlink.ymax = but->linkto[1]; ui_draw_link_bezier(&rectlink); } @@ -2468,13 +2468,13 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s fac= ((float)value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin); /* left part of slider, always rounded */ - rect1.xmax= rect1.xmin + ceil(offs+1.0f); + rect1.xmax = rect1.xmin + ceil(offs+1.0f); round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT), &rect1, offs); wtb1.outline= 0; widgetbase_draw(&wtb1, wcol); /* right part of slider, interpolate roundness */ - rect1.xmax= rect1.xmin + fac + offs; + rect1.xmax = rect1.xmin + fac + offs; rect1.xmin+= floor(offs-1.0f); if(rect1.xmax + offs > rect->xmax) offs*= (rect1.xmax + offs - rect->xmax)/offs; @@ -2687,7 +2687,7 @@ static void widget_optionbut(uiWidgetColors *wcol, rcti *rect, int state, int UN widget_init(&wtb); /* square */ - recttemp.xmax= recttemp.xmin + (recttemp.ymax-recttemp.ymin); + recttemp.xmax = recttemp.xmin + (recttemp.ymax-recttemp.ymin); /* smaller */ delta= 1 + (recttemp.ymax-recttemp.ymin)/8; @@ -3313,7 +3313,7 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, const char *name, int ic /* part text right aligned */ if(cpoin) { fstyle->align= UI_STYLE_TEXT_RIGHT; - rect->xmax= _rect.xmax - 5; + rect->xmax = _rect.xmax - 5; uiStyleFontDraw(fstyle, rect, cpoin+1); *cpoin= '|'; } diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 142584f62fd..8c67502978a 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -86,9 +86,9 @@ static void view2d_masks(View2D *v2d) int scroll; /* mask - view frame */ - v2d->mask.xmin= v2d->mask.ymin= 0; - v2d->mask.xmax= v2d->winx - 1; /* -1 yes! masks are pixels */ - v2d->mask.ymax= v2d->winy - 1; + v2d->mask.xmin = v2d->mask.ymin = 0; + v2d->mask.xmax = v2d->winx - 1; /* -1 yes! masks are pixels */ + v2d->mask.ymax = v2d->winy - 1; #if 0 // XXX see above @@ -114,29 +114,29 @@ static void view2d_masks(View2D *v2d) if (scroll & V2D_SCROLL_LEFT) { /* on left-hand edge of region */ v2d->vert= v2d->mask; - v2d->vert.xmax= V2D_SCROLL_WIDTH; - v2d->mask.xmin= v2d->vert.xmax + 1; + v2d->vert.xmax = V2D_SCROLL_WIDTH; + v2d->mask.xmin = v2d->vert.xmax + 1; } else if (scroll & V2D_SCROLL_RIGHT) { /* on right-hand edge of region */ v2d->vert= v2d->mask; v2d->vert.xmax++; /* one pixel extra... was leaving a minor gap... */ - v2d->vert.xmin= v2d->vert.xmax - V2D_SCROLL_WIDTH; - v2d->mask.xmax= v2d->vert.xmin - 1; + v2d->vert.xmin = v2d->vert.xmax - V2D_SCROLL_WIDTH; + v2d->mask.xmax = v2d->vert.xmin - 1; } /* horizontal scroller */ if (scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) { /* on bottom edge of region (V2D_SCROLL_BOTTOM_O is outliner, the other is for standard) */ v2d->hor= v2d->mask; - v2d->hor.ymax= V2D_SCROLL_HEIGHT; - v2d->mask.ymin= v2d->hor.ymax + 1; + v2d->hor.ymax = V2D_SCROLL_HEIGHT; + v2d->mask.ymin = v2d->hor.ymax + 1; } else if (scroll & V2D_SCROLL_TOP) { /* on upper edge of region */ v2d->hor= v2d->mask; - v2d->hor.ymin= v2d->hor.ymax - V2D_SCROLL_HEIGHT; - v2d->mask.ymax= v2d->hor.ymin - 1; + v2d->hor.ymin = v2d->hor.ymax - V2D_SCROLL_HEIGHT; + v2d->mask.ymax = v2d->hor.ymin - 1; } /* adjust vertical scroller if there's a horizontal scroller, to leave corner free */ @@ -144,11 +144,11 @@ static void view2d_masks(View2D *v2d) /* just set y min/max for vertical scroller to y min/max of mask as appropriate */ if (scroll & (V2D_SCROLL_BOTTOM|V2D_SCROLL_BOTTOM_O)) { /* on bottom edge of region (V2D_SCROLL_BOTTOM_O is outliner, the other is for standard) */ - v2d->vert.ymin= v2d->mask.ymin; + v2d->vert.ymin = v2d->mask.ymin; } else if (scroll & V2D_SCROLL_TOP) { /* on upper edge of region */ - v2d->vert.ymax= v2d->mask.ymax; + v2d->vert.ymax = v2d->mask.ymax; } } } @@ -196,9 +196,9 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) v2d->align= (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y); v2d->keeptot= V2D_KEEPTOT_BOUNDS; - v2d->tot.xmin= v2d->tot.ymin= 0.0f; - v2d->tot.xmax= (float)(winx - 1); - v2d->tot.ymax= (float)(winy - 1); + v2d->tot.xmin = v2d->tot.ymin = 0.0f; + v2d->tot.xmax = (float)(winx - 1); + v2d->tot.ymax = (float)(winy - 1); v2d->cur= v2d->tot; @@ -281,18 +281,18 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) v2d->scroll |= V2D_SCROLL_HORIZONTAL_HIDE; v2d->scroll &= ~V2D_SCROLL_VERTICAL_HIDE; - v2d->tot.xmin= 0.0f; - v2d->tot.xmax= winx; + v2d->tot.xmin = 0.0f; + v2d->tot.xmax = winx; - v2d->tot.ymax= 0.0f; - v2d->tot.ymin= -winy; + v2d->tot.ymax = 0.0f; + v2d->tot.ymin = -winy; - v2d->cur.xmin= 0.0f; + v2d->cur.xmin = 0.0f; /* bad workaround for keeping zoom level with scrollers */ - v2d->cur.xmax= (winx - V2D_SCROLL_WIDTH)*panelzoom; + v2d->cur.xmax = (winx - V2D_SCROLL_WIDTH)*panelzoom; - v2d->cur.ymax= 0.0f; - v2d->cur.ymin= (-winy)*panelzoom; + v2d->cur.ymax = 0.0f; + v2d->cur.ymin = (-winy)*panelzoom; } break; @@ -546,8 +546,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) /* width */ if ( (curwidth > totwidth) && !(v2d->keepzoom & (V2D_KEEPZOOM|V2D_LOCKZOOM_X|V2D_LIMITZOOM)) ) { /* if zoom doesn't have to be maintained, just clamp edges */ - if (cur->xmin < tot->xmin) cur->xmin= tot->xmin; - if (cur->xmax > tot->xmax) cur->xmax= tot->xmax; + if (cur->xmin < tot->xmin) cur->xmin = tot->xmin; + if (cur->xmax > tot->xmax) cur->xmax = tot->xmax; } else if (v2d->keeptot == V2D_KEEPTOT_STRICT) { /* This is an exception for the outliner (and later channel-lists, headers) @@ -595,8 +595,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) temp= (tot->xmax + tot->xmin) * 0.5f; diff= curheight * 0.5f; - cur->xmin= temp - diff; - cur->xmax= temp + diff; + cur->xmin = temp - diff; + cur->xmax = temp + diff; } else if (cur->xmin < tot->xmin) { /* move cur across so that it sits at minimum of tot */ @@ -629,8 +629,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) /* height */ if ( (curheight > totheight) && !(v2d->keepzoom & (V2D_KEEPZOOM|V2D_LOCKZOOM_Y|V2D_LIMITZOOM)) ) { /* if zoom doesn't have to be maintained, just clamp edges */ - if (cur->ymin < tot->ymin) cur->ymin= tot->ymin; - if (cur->ymax > tot->ymax) cur->ymax= tot->ymax; + if (cur->ymin < tot->ymin) cur->ymin = tot->ymin; + if (cur->ymax > tot->ymax) cur->ymax = tot->ymax; } else { /* This here occurs when: @@ -645,8 +645,8 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) temp= (tot->ymax + tot->ymin) * 0.5f; diff= curheight * 0.5f; - cur->ymin= temp - diff; - cur->ymax= temp + diff; + cur->ymin = temp - diff; + cur->ymax = temp + diff; } else if (cur->ymin < tot->ymin) { /* there's still space remaining, so shift up */ @@ -680,7 +680,7 @@ void UI_view2d_curRect_validate_resize(View2D *v2d, int resize) /* width is in negative-x half */ if (v2d->cur.xmax > 0) { v2d->cur.xmin -= v2d->cur.xmax; - v2d->cur.xmax= 0.0f; + v2d->cur.xmax = 0.0f; } } else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) { @@ -738,13 +738,13 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag) if (ar->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL) { if (flag == V2D_LOCK_COPY) { /* other views with locks on must copy active */ - ar->v2d.cur.ymin= v2dcur->cur.ymin; - ar->v2d.cur.ymax= v2dcur->cur.ymax; + ar->v2d.cur.ymin = v2dcur->cur.ymin; + ar->v2d.cur.ymax = v2dcur->cur.ymax; } else { /* V2D_LOCK_SET */ /* active must copy others */ - v2dcur->cur.ymin= ar->v2d.cur.ymin; - v2dcur->cur.ymax= ar->v2d.cur.ymax; + v2dcur->cur.ymin = ar->v2d.cur.ymin; + v2dcur->cur.ymax = ar->v2d.cur.ymax; } /* region possibly changed, so refresh */ @@ -764,13 +764,13 @@ void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag) if (ar->v2d.flag & V2D_VIEWSYNC_SCREEN_TIME) { if (flag == V2D_LOCK_COPY) { /* other views with locks on must copy active */ - ar->v2d.cur.xmin= v2dcur->cur.xmin; - ar->v2d.cur.xmax= v2dcur->cur.xmax; + ar->v2d.cur.xmin = v2dcur->cur.xmin; + ar->v2d.cur.xmax = v2dcur->cur.xmax; } else { /* V2D_LOCK_SET */ /* active must copy others */ - v2dcur->cur.xmin= ar->v2d.cur.xmin; - v2dcur->cur.xmax= ar->v2d.cur.xmax; + v2dcur->cur.xmin = ar->v2d.cur.xmin; + v2dcur->cur.xmax = ar->v2d.cur.xmax; } /* region possibly changed, so refresh */ @@ -797,39 +797,39 @@ void UI_view2d_curRect_reset (View2D *v2d) /* handle width - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) { /* width is in negative-x half */ - v2d->cur.xmin= (float)-width; - v2d->cur.xmax= 0.0f; + v2d->cur.xmin = (float)-width; + v2d->cur.xmax = 0.0f; } else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) { /* width is in positive-x half */ - v2d->cur.xmin= 0.0f; - v2d->cur.xmax= (float)width; + v2d->cur.xmin = 0.0f; + v2d->cur.xmax = (float)width; } else { /* width is centered around x==0 */ const float dx= (float)width / 2.0f; - v2d->cur.xmin= -dx; - v2d->cur.xmax= dx; + v2d->cur.xmin = -dx; + v2d->cur.xmax = dx; } /* handle height - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) { /* height is in negative-y half */ - v2d->cur.ymin= (float)-height; - v2d->cur.ymax= 0.0f; + v2d->cur.ymin = (float)-height; + v2d->cur.ymax = 0.0f; } else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) { /* height is in positive-y half */ - v2d->cur.ymin= 0.0f; - v2d->cur.ymax= (float)height; + v2d->cur.ymin = 0.0f; + v2d->cur.ymax = (float)height; } else { /* height is centered around y==0 */ const float dy= (float)height / 2.0f; - v2d->cur.ymin= -dy; - v2d->cur.ymax= dy; + v2d->cur.ymin = -dy; + v2d->cur.ymax = dy; } } @@ -860,39 +860,39 @@ void UI_view2d_totRect_set_resize (View2D *v2d, int width, int height, int resiz /* handle width - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) { /* width is in negative-x half */ - v2d->tot.xmin= (float)-width; - v2d->tot.xmax= 0.0f; + v2d->tot.xmin = (float)-width; + v2d->tot.xmax = 0.0f; } else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) { /* width is in positive-x half */ - v2d->tot.xmin= 0.0f; - v2d->tot.xmax= (float)width; + v2d->tot.xmin = 0.0f; + v2d->tot.xmax = (float)width; } else { /* width is centered around x==0 */ const float dx= (float)width / 2.0f; - v2d->tot.xmin= -dx; - v2d->tot.xmax= dx; + v2d->tot.xmin = -dx; + v2d->tot.xmax = dx; } /* handle height - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) { /* height is in negative-y half */ - v2d->tot.ymin= (float)-height; - v2d->tot.ymax= 0.0f; + v2d->tot.ymin = (float)-height; + v2d->tot.ymax = 0.0f; } else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) { /* height is in positive-y half */ - v2d->tot.ymin= 0.0f; - v2d->tot.ymax= (float)height; + v2d->tot.ymin = 0.0f; + v2d->tot.ymax = (float)height; } else { /* height is centered around y==0 */ const float dy= (float)height / 2.0f; - v2d->tot.ymin= -dy; - v2d->tot.ymax= dy; + v2d->tot.ymin = -dy; + v2d->tot.ymax = dy; } /* make sure that 'cur' rect is in a valid state as a result of these changes */ @@ -918,10 +918,10 @@ int UI_view2d_tab_set(View2D *v2d, int tab) offset= default_offset; v2d->cur.xmax += offset[0] - v2d->cur.xmin; - v2d->cur.xmin= offset[0]; + v2d->cur.xmin = offset[0]; v2d->cur.ymin += offset[1] - v2d->cur.ymax; - v2d->cur.ymax= offset[1]; + v2d->cur.ymax = offset[1]; /* validation should happen in subsequent totRect_set */ @@ -996,12 +996,12 @@ void UI_view2d_view_ortho(View2D *v2d) /* XXX ton: this flag set by outliner, for icons */ if(v2d->flag & V2D_PIXELOFS_X) { - curmasked.xmin= floorf(curmasked.xmin) - 0.001f; - curmasked.xmax= floorf(curmasked.xmax) - 0.001f; + curmasked.xmin = floorf(curmasked.xmin) - 0.001f; + curmasked.xmax = floorf(curmasked.xmax) - 0.001f; } if(v2d->flag & V2D_PIXELOFS_Y) { - curmasked.ymin= floorf(curmasked.ymin) - 0.001f; - curmasked.ymax= floorf(curmasked.ymax) - 0.001f; + curmasked.ymin = floorf(curmasked.ymin) - 0.001f; + curmasked.ymax = floorf(curmasked.ymax) - 0.001f; } /* set matrix on all appropriate axes */ @@ -1565,10 +1565,10 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v rcti slider; int state; - slider.xmin= vs->hor_min; - slider.xmax= vs->hor_max; - slider.ymin= hor.ymin; - slider.ymax= hor.ymax; + slider.xmin = vs->hor_min; + slider.xmax = vs->hor_max; + slider.ymin = hor.ymin; + slider.ymax = hor.ymax; state= (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SCROLL_PRESSED:0; @@ -1676,10 +1676,10 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v rcti slider; int state; - slider.xmin= vert.xmin; - slider.xmax= vert.xmax; - slider.ymin= vs->vert_min; - slider.ymax= vs->vert_max; + slider.xmin = vert.xmin; + slider.xmax = vert.xmax; + slider.ymin = vs->vert_min; + slider.ymax = vs->vert_max; state= (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SCROLL_PRESSED:0; @@ -1779,14 +1779,14 @@ void UI_view2d_listview_cell_to_view(View2D *v2d, short columnwidth, short rowhe if ELEM(NULL, v2d, rect) return; if ((columnwidth <= 0) && (rowheight <= 0)) { - rect->xmin= rect->xmax= 0.0f; - rect->ymin= rect->ymax= 0.0f; + rect->xmin = rect->xmax = 0.0f; + rect->ymin = rect->ymax = 0.0f; return; } /* x-coordinates */ - rect->xmin= startx + (float)(columnwidth * column); - rect->xmax= startx + (float)(columnwidth * (column + 1)); + rect->xmin = startx + (float)(columnwidth * column); + rect->xmax = startx + (float)(columnwidth * (column + 1)); if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) { /* simply negate the values for the coordinates if in negative half */ @@ -1795,8 +1795,8 @@ void UI_view2d_listview_cell_to_view(View2D *v2d, short columnwidth, short rowhe } /* y-coordinates */ - rect->ymin= starty + (float)(rowheight * row); - rect->ymax= starty + (float)(rowheight * (row + 1)); + rect->ymin = starty + (float)(rowheight * row); + rect->ymax = starty + (float)(rowheight * (row + 1)); if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) { /* simply negate the values for the coordinates if in negative half */ diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 16613d3acee..29850c91480 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1116,12 +1116,12 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op) * if zoom is allowed to be changed */ if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) { - v2d->cur.xmin= rect.xmin; - v2d->cur.xmax= rect.xmax; + v2d->cur.xmin = rect.xmin; + v2d->cur.xmax = rect.xmax; } if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) { - v2d->cur.ymin= rect.ymin; - v2d->cur.ymax= rect.ymax; + v2d->cur.ymin = rect.ymin; + v2d->cur.ymax = rect.ymax; } } else /* if (gesture_mode == GESTURE_MODAL_OUT) */ { @@ -1138,16 +1138,16 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op) zoom= size / (rect.xmax - rect.xmin); center= (v2d->cur.xmax + v2d->cur.xmin) * 0.5f; - v2d->cur.xmin= center - (size * zoom); - v2d->cur.xmax= center + (size * zoom); + v2d->cur.xmin = center - (size * zoom); + v2d->cur.xmax = center + (size * zoom); } if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) { size= (v2d->cur.ymax - v2d->cur.ymin); zoom= size / (rect.ymax - rect.ymin); center= (v2d->cur.ymax + v2d->cur.ymin) * 0.5f; - v2d->cur.ymin= center - (size * zoom); - v2d->cur.ymax= center + (size * zoom); + v2d->cur.ymin = center - (size * zoom); + v2d->cur.ymax = center + (size * zoom); } } @@ -1616,29 +1616,29 @@ static int reset_exec(bContext *C, wmOperator *UNUSED(op)) winx= (float)(v2d->mask.xmax - v2d->mask.xmin + 1); winy= (float)(v2d->mask.ymax - v2d->mask.ymin + 1); - v2d->cur.xmax= v2d->cur.xmin + winx; - v2d->cur.ymax= v2d->cur.ymin + winy; + v2d->cur.xmax = v2d->cur.xmin + winx; + v2d->cur.ymax = v2d->cur.ymin + winy; /* align */ if (v2d->align) { /* posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) { - v2d->cur.xmax= 0.0f; - v2d->cur.xmin= -winx*style->panelzoom; + v2d->cur.xmax = 0.0f; + v2d->cur.xmin = -winx*style->panelzoom; } else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) { - v2d->cur.xmax= winx*style->panelzoom; - v2d->cur.xmin= 0.0f; + v2d->cur.xmax = winx*style->panelzoom; + v2d->cur.xmin = 0.0f; } /* - posx and negx flags are mutually exclusive, so watch out */ if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) { - v2d->cur.ymax= 0.0f; - v2d->cur.ymin= -winy*style->panelzoom; + v2d->cur.ymax = 0.0f; + v2d->cur.ymin = -winy*style->panelzoom; } else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) { - v2d->cur.ymax= winy*style->panelzoom; - v2d->cur.ymin= 0.0f; + v2d->cur.ymax = winy*style->panelzoom; + v2d->cur.ymin = 0.0f; } } @@ -1689,7 +1689,7 @@ void UI_view2d_operatortypes(void) void UI_view2d_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "View2D", 0, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "View2D", 0, 0); wmKeyMapItem *kmi; /* scrollers */ @@ -1742,7 +1742,7 @@ void UI_view2d_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0); /* Alternative keymap for buttons listview */ - keymap= WM_keymap_find(keyconf, "View2D Buttons List", 0, 0); + keymap = WM_keymap_find(keyconf, "View2D Buttons List", 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0); diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index b7700623d80..74160b3f2de 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -55,7 +55,7 @@ /* returns standard diameter */ static float new_primitive_matrix(bContext *C, float *loc, float *rot, float primmat[][4]) { - Object *obedit= CTX_data_edit_object(C); + Object *obedit = CTX_data_edit_object(C); View3D *v3d = CTX_wm_view3d(C); float mat[3][3], rmat[3][3], cmat[3][3], imat[3][3]; @@ -85,11 +85,11 @@ static void make_prim_init(bContext *C, const char *idname, float *dia, float mat[][4], int *state, float *loc, float *rot, unsigned int layer) { - Object *obedit= CTX_data_edit_object(C); + Object *obedit = CTX_data_edit_object(C); *state = 0; - if(obedit==NULL || obedit->type!=OB_MESH) { - obedit= ED_object_add_type(C, OB_MESH, loc, rot, FALSE, layer); + if (obedit == NULL || obedit->type != OB_MESH) { + obedit = ED_object_add_type(C, OB_MESH, loc, rot, FALSE, layer); rename_id((ID *)obedit, idname); rename_id((ID *)obedit->data, idname); @@ -186,7 +186,7 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op) ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); make_prim_init(C, "Cube", &dia, mat, &state, loc, rot, layer); - obedit= CTX_data_edit_object(C); + obedit = CTX_data_edit_object(C); me = obedit->data; em = me->edit_btmesh; @@ -235,7 +235,7 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op) unsigned int layer; cap_end = RNA_enum_get(op->ptr, "fill_type"); - cap_tri = cap_end==2; + cap_tri = (cap_end == 2); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); make_prim_init(C, "Circle", &dia, mat, &state, loc, rot, layer); @@ -294,7 +294,7 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) unsigned int layer; cap_end = RNA_enum_get(op->ptr, "end_fill_type"); - cap_tri = cap_end==2; + cap_tri = (cap_end == 2); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); make_prim_init(C, "Cylinder", &dia, mat, &state, loc, rot, layer); @@ -359,7 +359,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op) unsigned int layer; cap_end = RNA_enum_get(op->ptr, "end_fill_type"); - cap_tri = cap_end==2; + cap_tri = (cap_end == 2); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); make_prim_init(C, "Cone", &dia, mat, &state, loc, rot, layer); @@ -480,7 +480,7 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op) ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, &view_aligned); if (!view_aligned) - rot[0] += M_PI/2.0f; + rot[0] += M_PI / 2.0f; make_prim_init(C, "Monkey", &dia, mat, &state, loc, rot, layer); @@ -534,7 +534,7 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) if (!EDBM_CallAndSelectOpf(em, op, "vertout", "create_uvsphere segments=%i revolutions=%i diameter=%f mat=%m4", RNA_int_get(op->ptr, "segments"), RNA_int_get(op->ptr, "ring_count"), - RNA_float_get(op->ptr,"size"), mat)) + RNA_float_get(op->ptr, "size"), mat)) { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/mesh/editmesh_bvh.c b/source/blender/editors/mesh/editmesh_bvh.c index 0302e1df2c3..3716949cb46 100644 --- a/source/blender/editors/mesh/editmesh_bvh.c +++ b/source/blender/editors/mesh/editmesh_bvh.c @@ -58,7 +58,7 @@ typedef struct BMBVHTree { float maxdist; //for nearest point search float uv[2]; - /*stuff for topological vert search*/ + /* stuff for topological vert search */ BMVert *v, *curv; GHash *gh; float curw, curd; @@ -101,7 +101,7 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit) tree->scene = scene; tree->em = em; tree->bm = em->bm; - tree->epsilon = FLT_EPSILON*2.0f; + tree->epsilon = FLT_EPSILON * 2.0f; tree->flag = flag; tree->tree = BLI_bvhtree_new(em->tottri, tree->epsilon, 8, 8); @@ -111,7 +111,7 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit) BMVert *v; void *data[3]; - tree->cos = MEM_callocN(sizeof(float)*3*em->bm->totvert, "bmbvh cos"); + tree->cos = MEM_callocN(sizeof(float) * 3 * em->bm->totvert, "bmbvh cos"); BM_ITER_INDEX(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL, i) { BM_elem_index_set(v, i); /* set_inline */ copy_v3_v3(tree->cos[i], v->co); @@ -120,7 +120,7 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit) cage = editbmesh_get_derived_cage_and_final(scene, obedit, em, &final, CD_MASK_DERIVEDMESH); - cagecos = MEM_callocN(sizeof(float)*3*em->bm->totvert, "bmbvh cagecos"); + cagecos = MEM_callocN(sizeof(float) * 3 * em->bm->totvert, "bmbvh cagecos"); data[0] = em; data[1] = cagecos; @@ -131,18 +131,19 @@ BMBVHTree *BMBVH_NewBVH(BMEditMesh *em, int flag, Scene *scene, Object *obedit) tree->cagecos = cagecos; - for (i=0; itottri; i++) { + for (i = 0; i < em->tottri; i++) { if (flag & BMBVH_USE_CAGE) { copy_v3_v3(cos[0], cagecos[BM_elem_index_get(em->looptris[i][0]->v)]); copy_v3_v3(cos[1], cagecos[BM_elem_index_get(em->looptris[i][1]->v)]); copy_v3_v3(cos[2], cagecos[BM_elem_index_get(em->looptris[i][2]->v)]); - } else { + } + else { copy_v3_v3(cos[0], em->looptris[i][0]->v->co); copy_v3_v3(cos[1], em->looptris[i][1]->v->co); copy_v3_v3(cos[2], em->looptris[i][2]->v->co); } - BLI_bvhtree_insert(tree->tree, i, (float*)cos, 3); + BLI_bvhtree_insert(tree->tree, i, (float *)cos, 3); } BLI_bvhtree_balance(tree->tree); @@ -163,14 +164,15 @@ void BMBVH_FreeBVH(BMBVHTree *tree) MEM_freeN(tree); } -/*taken from bvhutils.c*/ +/* taken from bvhutils.c */ static float ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), float *v0, float *v1, float *v2, float *uv, float UNUSED(e)) { float dist; - if(isect_ray_tri_v3((float*)ray->origin, (float*)ray->direction, v0, v1, v2, &dist, uv)) + if (isect_ray_tri_v3((float *)ray->origin, (float *)ray->direction, v0, v1, v2, &dist, uv)) { return dist; + } return FLT_MAX; } @@ -222,8 +224,9 @@ BMFace *BMBVH_RayCast(BMBVHTree *tree, float *co, float *dir, float *hitout, flo v2 = tree->em->looptris[hit.index][1]->v; v3 = tree->em->looptris[hit.index][2]->v; - for (i=0; i<3; i++) { - co[i] = v1->co[i] + (v2->co[i] - v1->co[i])*tree->uv[0] + (v3->co[i]-v1->co[i])*tree->uv[1]; + for (i = 0; i < 3; i++) { + co[i] = v1->co[i] + ((v2->co[i] - v1->co[i]) * tree->uv[0]) + + ((v3->co[i] - v1->co[i]) * tree->uv[1]); } copy_v3_v3(hitout, co); } else { @@ -254,10 +257,10 @@ static void vertsearchcallback(void *userdata, int index, const float *UNUSED(co maxdist = tree->maxdist; - for (i=0; i<3; i++) { + for (i = 0; i < 3; i++) { sub_v3_v3v3(v, hit->co, ls[i]->v->co); - dist = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); + dist = len_v3(v); if (dist < hit->dist && dist < maxdist) { copy_v3_v3(hit->co, ls[i]->v->co); copy_v3_v3(hit->no, ls[i]->v->no); @@ -272,7 +275,7 @@ BMVert *BMBVH_FindClosestVert(BMBVHTree *tree, float *co, float maxdist) BVHTreeNearest hit; copy_v3_v3(hit.co, co); - hit.dist = maxdist*5; + hit.dist = maxdist * 5; hit.index = -1; tree->maxdist = maxdist; @@ -281,14 +284,14 @@ BMVert *BMBVH_FindClosestVert(BMBVHTree *tree, float *co, float maxdist) if (hit.dist != FLT_MAX && hit.index != -1) { BMLoop **ls = tree->em->looptris[hit.index]; float dist, curdist = tree->maxdist, v[3]; - int cur=0, i; + int cur = 0, i; maxdist = tree->maxdist; - for (i=0; i<3; i++) { + for (i = 0; i < 3; i++) { sub_v3_v3v3(v, hit.co, ls[i]->v->co); - dist = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); + dist = len_v3(v); if (dist < curdist) { cur = i; curdist = dist; @@ -308,7 +311,7 @@ typedef struct walklist { float w, r; int totwalked; - /*state data*/ + /* state data */ BMVert *lastv; BMLoop *curl, *firstl; BMEdge *cure; @@ -317,17 +320,19 @@ typedef struct walklist { /* UNUSED */ #if 0 static short winding(float *v1, float *v2, float *v3) -/* is v3 to the right of v1-v2 ? With exception: v3==v1 || v3==v2 */ +/* is v3 to the right of (v1 - v2) ? With exception: v3 == v1 || v3 == v2 */ { double inp; - //inp= (v2[cox]-v1[cox])*(v1[coy]-v3[coy]) +(v1[coy]-v2[coy])*(v1[cox]-v3[cox]); - inp= (v2[0]-v1[0])*(v1[1]-v3[1]) +(v1[1]-v2[1])*(v1[0]-v3[0]); + //inp = (v2[cox] - v1[cox]) * (v1[coy] - v3[coy]) + (v1[coy] - v2[coy]) * (v1[cox] - v3[cox]); + inp = (v2[0] - v1[0]) * (v1[1] - v3[1]) + (v1[1] - v2[1]) * (v1[0] - v3[0]); - if(inp<0.0) return 0; - else if(inp==0) { - if(v1[0]==v3[0] && v1[1]==v3[1]) return 0; - if(v2[0]==v3[0] && v2[1]==v3[1]) return 0; + if (inp < 0.0) { + return 0; + } + else if (inp == 0) { + if (v1[0] == v3[0] && v1[1] == v3[1]) return 0; + if (v2[0] == v3[0] && v2[1] == v3[1]) return 0; } return 1; } @@ -371,8 +376,8 @@ int BMBVH_EdgeVisible(BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v3d, Obje return 0; } - mval_f[0] = ar->winx/2.0; - mval_f[1] = ar->winy/2.0; + mval_f[0] = ar->winx / 2.0f; + mval_f[1] = ar->winy / 2.0f; ED_view3d_win_to_segment_clip(ar, v3d, mval_f, origin, end); invert_m4_m4(invmat, obedit->obmat); @@ -410,7 +415,7 @@ int BMBVH_EdgeVisible(BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v3d, Obje normalize_v3(dir2); normalize_v3(dir3); - /*do three samplings: left, middle, right*/ + /* do three samplings: left, middle, right */ f = edge_ray_cast(tree, co1, dir1, NULL, e); if (f && !edge_ray_cast(tree, co2, dir2, NULL, e)) return 1; diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 02f33b586fb..f6367779251 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1051,8 +1051,8 @@ static BMEdgeHit *knife_edge_tri_isect(knifetool_opdata *kcd, BMBVHTree *bmtree, continue; if (kcd->prev.vert && len_squared_v3v3(kcd->prev.vert->cageco, p) < depsilon_squared) continue; - if ( len_squared_v3v3(kcd->prev.cage, p) < depsilon_squared || - len_squared_v3v3(kcd->cur.cage, p) < depsilon_squared) + if (len_squared_v3v3(kcd->prev.cage, p) < depsilon_squared || + len_squared_v3v3(kcd->cur.cage, p) < depsilon_squared) { continue; } @@ -1561,10 +1561,10 @@ static int knife_update_active(knifetool_opdata *kcd) kcd->cur.edge = knife_find_closest_edge(kcd, kcd->cur.co, kcd->cur.cage, &kcd->cur.bmface, &kcd->cur.is_space); } - /* if no hits are found this would normally default to (0,0,0) so instead + /* if no hits are found this would normally default to (0, 0, 0) so instead * get a point at the mouse ray closest to the previous point. * Note that drawing lines in `free-space` isn't properly supported - * but theres no guarantee (0,0,0) has any geometry either - campbell */ + * but theres no guarantee (0, 0, 0) has any geometry either - campbell */ if (kcd->cur.vert == NULL && kcd->cur.edge == NULL) { float origin[3], ray[3], co[3]; @@ -1601,7 +1601,7 @@ static void rnd_offset_co(float co[3], float scale) int i; for (i = 0; i < 3; i++) { - co[i] += (BLI_drand()-0.5)*scale; + co[i] += (BLI_drand() - 0.5) * scale; } } @@ -2231,8 +2231,8 @@ static int find_hole_chains(knifetool_opdata *kcd, ListBase *hole, BMFace *f, Li j++; } - /* For first diagonal (m==0), want shortest length. - * For second diagonal (m==1), want max separation of index of hole + /* For first diagonal (m == 0), want shortest length. + * For second diagonal (m == 1), want max separation of index of hole * vertex from the hole vertex used in the first diagonal, and from there * want the one with shortest length not to the same vertex as the first diagonal. */ for (m = 0; m < 2; m++) { @@ -2765,8 +2765,8 @@ static int knifetool_invoke(bContext *C, wmOperator *op, wmEvent *evt) kcd->vc.mval[1] = evt->mval[1]; ED_area_headerprint(CTX_wm_area(C), - "LMB: define cut lines, Return or RMB: confirm, E: new cut, Ctrl: midpoint snap," - " Shift: ignore snap, C: angle constrain, Turn off limit selection to visibile: cut through"); + "LMB: define cut lines, Return or RMB: confirm, E: new cut, Ctrl: midpoint snap, " + "Shift: ignore snap, C: angle constrain, Turn off limit selection to visibile: cut through"); return OPERATOR_RUNNING_MODAL; } @@ -2795,8 +2795,7 @@ wmKeyMap *knifetool_modal_keymap(wmKeyConfig *keyconf) {KNF_MODAL_ANGLE_SNAP_TOGGLE, "ANGLE_SNAP_TOGGLE", 0, "Toggle Angle Snapping", ""}, {KNF_MODAL_NEW_CUT, "NEW_CUT", 0, "End Current Cut", ""}, {KNF_MODAL_ADD_CUT, "ADD_CUT", 0, "Add Cut", ""}, - - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL}}; wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Knife Tool Modal Map"); diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index 1696d4d80b3..b409ee16e25 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -112,7 +112,7 @@ static void ringsel_draw(const bContext *C, ARegion *UNUSED(ar), void *arg) int i; if (lcd->totedge > 0) { - if(v3d && v3d->zbuf) + if (v3d && v3d->zbuf) glDisable(GL_DEPTH_TEST); glPushMatrix(); @@ -120,20 +120,20 @@ static void ringsel_draw(const bContext *C, ARegion *UNUSED(ar), void *arg) glColor3ub(255, 0, 255); glBegin(GL_LINES); - for (i=0; itotedge; i++) { + for (i = 0; i < lcd->totedge; i++) { glVertex3fv(lcd->edges[i][0]); glVertex3fv(lcd->edges[i][1]); } glEnd(); glPopMatrix(); - if(v3d && v3d->zbuf) + if (v3d && v3d->zbuf) glEnable(GL_DEPTH_TEST); } } /* given two opposite edges in a face, finds the ordering of their vertices so - * that cut preview lines won't cross each other*/ + * that cut preview lines won't cross each other */ static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed, BMVert *lastv1, BMVert *v[2][2]) { @@ -143,7 +143,7 @@ static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed, l = eed->l; - /*find correct order for v[1]*/ + /* find correct order for v[1] */ if (!(BM_edge_in_face(l->f, eed) && BM_edge_in_face(l->f, lasteed))) { BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_LOOP, l) { if (BM_edge_in_face(l->f, eed) && BM_edge_in_face(l->f, lasteed)) @@ -151,7 +151,7 @@ static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed, } } - /*this should never happen*/ + /* this should never happen */ if (!l) { v[0][0] = eed->v1; v[0][1] = eed->v2; @@ -169,7 +169,8 @@ static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed, if (l2->v == lastv1) { v[0][0] = eed->v1; v[0][1] = eed->v2; - } else { + } + else { v[0][0] = eed->v2; v[0][1] = eed->v1; } @@ -185,7 +186,7 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select) float (*edges)[2][3] = NULL; BLI_array_declare(edges); float co[2][3]; - int i, tot=0; + int i, tot = 0; memset(v, 0, sizeof(v)); @@ -208,7 +209,7 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select) BMW_NIL_LAY); eed = BMW_begin(&walker, startedge); - for (; eed; eed=BMW_step(&walker)) { + for ( ; eed; eed = BMW_step(&walker)) { BM_elem_select_set(em->bm, eed, TRUE); } BMW_end(&walker); @@ -222,12 +223,13 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select) eed = startedge = BMW_begin(&walker, startedge); lastv1 = NULL; - for (lasteed=NULL; eed; eed=BMW_step(&walker)) { + for (lasteed = NULL; eed; eed = BMW_step(&walker)) { if (lasteed) { if (lastv1) { v[1][0] = v[0][0]; v[1][1] = v[0][1]; - } else { + } + else { v[1][0] = lasteed->v1; v[1][1] = lasteed->v2; lastv1 = lasteed->v1; @@ -236,14 +238,14 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select) edgering_find_order(em, lasteed, eed, lastv1, v); lastv1 = v[0][0]; - for(i=1;i<=previewlines;i++){ - co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0])*(i/((float)previewlines+1))+v[0][0]->co[0]; - co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1])*(i/((float)previewlines+1))+v[0][0]->co[1]; - co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2])*(i/((float)previewlines+1))+v[0][0]->co[2]; + for (i = 1; i <= previewlines; i++) { + co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0]) * (i / ((float)previewlines + 1)) + v[0][0]->co[0]; + co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1]) * (i / ((float)previewlines + 1)) + v[0][0]->co[1]; + co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2]) * (i / ((float)previewlines + 1)) + v[0][0]->co[2]; - co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0])*(i/((float)previewlines+1))+v[1][0]->co[0]; - co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1])*(i/((float)previewlines+1))+v[1][0]->co[1]; - co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2])*(i/((float)previewlines+1))+v[1][0]->co[2]; + co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0]) * (i / ((float)previewlines + 1)) + v[1][0]->co[0]; + co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1]) * (i / ((float)previewlines + 1)) + v[1][0]->co[1]; + co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2]) * (i / ((float)previewlines + 1)) + v[1][0]->co[2]; BLI_array_growone(edges); copy_v3_v3(edges[tot][0], co[0]); @@ -260,17 +262,17 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select) edgering_find_order(em, lasteed, startedge, lastv1, v); - for(i=1;i<=previewlines;i++){ + for (i = 1; i <= previewlines; i++) { if (!v[0][0] || !v[0][1] || !v[1][0] || !v[1][1]) continue; - co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0])*(i/((float)previewlines+1))+v[0][0]->co[0]; - co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1])*(i/((float)previewlines+1))+v[0][0]->co[1]; - co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2])*(i/((float)previewlines+1))+v[0][0]->co[2]; + co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0]) * (i / ((float)previewlines + 1)) + v[0][0]->co[0]; + co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1]) * (i / ((float)previewlines + 1)) + v[0][0]->co[1]; + co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2]) * (i / ((float)previewlines + 1)) + v[0][0]->co[2]; - co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0])*(i/((float)previewlines+1))+v[1][0]->co[0]; - co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1])*(i/((float)previewlines+1))+v[1][0]->co[1]; - co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2])*(i/((float)previewlines+1))+v[1][0]->co[2]; + co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0]) * (i / ((float)previewlines + 1)) + v[1][0]->co[0]; + co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1]) * (i / ((float)previewlines + 1)) + v[1][0]->co[1]; + co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2]) * (i / ((float)previewlines + 1)) + v[1][0]->co[2]; BLI_array_growone(edges); copy_v3_v3(edges[tot][0], co[0]); @@ -298,8 +300,8 @@ static void ringsel_find_edge(tringselOpData *lcd, int cuts) static void ringsel_finish(bContext *C, wmOperator *op) { - tringselOpData *lcd= op->customdata; - int cuts= RNA_int_get(op->ptr, "number_cuts"); + tringselOpData *lcd = op->customdata; + int cuts = RNA_int_get(op->ptr, "number_cuts"); if (lcd->eed) { BMEditMesh *em = lcd->em; @@ -317,7 +319,7 @@ static void ringsel_finish(bContext *C, wmOperator *op) em->selectmode = SCE_SELECT_EDGE; else em->selectmode &= ~SCE_SELECT_FACE; - CTX_data_tool_settings(C)->selectmode= em->selectmode; + CTX_data_tool_settings(C)->selectmode = em->selectmode; EDBM_selectmode_set(em); WM_event_add_notifier(C, NC_SCENE|ND_TOOLSETTINGS, CTX_data_scene(C)); @@ -331,9 +333,9 @@ static void ringsel_finish(bContext *C, wmOperator *op) else { /* sets as active, useful for other tools */ - if(em->selectmode & SCE_SELECT_VERTEX) + if (em->selectmode & SCE_SELECT_VERTEX) EDBM_store_selection(em, lcd->eed->v1); /* low priority TODO, get vertrex close to mouse */ - if(em->selectmode & SCE_SELECT_EDGE) + if (em->selectmode & SCE_SELECT_EDGE) EDBM_store_selection(em, lcd->eed); EDBM_selectmode_flush(lcd->em); @@ -345,7 +347,7 @@ static void ringsel_finish(bContext *C, wmOperator *op) /* called when modal loop selection is done... */ static void ringsel_exit(bContext *UNUSED(C), wmOperator *op) { - tringselOpData *lcd= op->customdata; + tringselOpData *lcd = op->customdata; /* deactivate the extra drawing stuff in 3D-View */ ED_region_draw_cb_exit(lcd->ar->type, lcd->draw_handle); @@ -357,7 +359,7 @@ static void ringsel_exit(bContext *UNUSED(C), wmOperator *op) /* free the custom data */ MEM_freeN(lcd); - op->customdata= NULL; + op->customdata = NULL; } /* called when modal loop selection gets set up... */ @@ -366,11 +368,11 @@ static int ringsel_init (bContext *C, wmOperator *op, int do_cut) tringselOpData *lcd; /* alloc new customdata */ - lcd= op->customdata= MEM_callocN(sizeof(tringselOpData), "ringsel Modal Op Data"); + lcd = op->customdata = MEM_callocN(sizeof(tringselOpData), "ringsel Modal Op Data"); /* assign the drawing handle for drawing preview line... */ - lcd->ar= CTX_wm_region(C); - lcd->draw_handle= ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST_VIEW); + lcd->ar = CTX_wm_region(C); + lcd->draw_handle = ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST_VIEW); lcd->ob = CTX_data_edit_object(C); lcd->em = BMEdit_FromObject(lcd->ob); lcd->extend = do_cut ? 0 : RNA_boolean_get(op->ptr, "extend"); @@ -396,12 +398,12 @@ static int ringcut_cancel (bContext *C, wmOperator *op) static int ringcut_invoke (bContext *C, wmOperator *op, wmEvent *evt) { - Object *obedit= CTX_data_edit_object(C); + Object *obedit = CTX_data_edit_object(C); tringselOpData *lcd; BMEdge *edge; int dist = 75; - if(modifiers_isDeformedByLattice(obedit) || modifiers_isDeformedByArmature(obedit)) + if (modifiers_isDeformedByLattice(obedit) || modifiers_isDeformedByArmature(obedit)) BKE_report(op->reports, RPT_WARNING, "Loop cut doesn't work well on deformed edit mesh display"); view3d_operator_needs_opengl(C); @@ -428,8 +430,8 @@ static int ringcut_invoke (bContext *C, wmOperator *op, wmEvent *evt) static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event) { - int cuts= RNA_int_get(op->ptr,"number_cuts"); - tringselOpData *lcd= op->customdata; + int cuts = RNA_int_get(op->ptr, "number_cuts"); + tringselOpData *lcd = op->customdata; int show_cuts = 0; view3d_operator_needs_opengl(C); @@ -475,7 +477,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event) break; cuts++; - RNA_int_set(op->ptr,"number_cuts",cuts); + RNA_int_set(op->ptr, "number_cuts", cuts); ringsel_find_edge(lcd, cuts); show_cuts = TRUE; @@ -487,8 +489,8 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event) if (event->val == KM_RELEASE) break; - cuts=MAX2(cuts-1,1); - RNA_int_set(op->ptr,"number_cuts",cuts); + cuts = MAX2(cuts - 1, 1); + RNA_int_set(op->ptr, "number_cuts", cuts); ringsel_find_edge(lcd, cuts); show_cuts = TRUE; @@ -513,15 +515,15 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event) } /* using the keyboard to input the number of cuts */ - if (event->val==KM_PRESS) { + if (event->val == KM_PRESS) { float value; if (handleNumInput(&lcd->num, event)) { applyNumInput(&lcd->num, &value); - cuts= CLAMPIS(value, 1, 130); + cuts = CLAMPIS(value, 1, 130); - RNA_int_set(op->ptr,"number_cuts",cuts); + RNA_int_set(op->ptr, "number_cuts", cuts); ringsel_find_edge(lcd, cuts); show_cuts = TRUE; diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 5d4647b7f87..dae4eac7e6d 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -337,7 +337,7 @@ static void findnearestvert__doClosest(void *userData, BMVert *eve, int x, int y } if (data->dist > 3) { - int temp = abs(data->mval[0] - x) + abs(data->mval[1]- y); + int temp = abs(data->mval[0] - x) + abs(data->mval[1] - y); if (BM_elem_flag_test(eve, BM_ELEM_SELECT) == data->select) { if (data->strict == 1) { return; @@ -1606,8 +1606,8 @@ void EDBM_convertsel(BMEditMesh *em, short oldmode, short selectmode) /* select all edges associated with every selected vertex */ eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL); for ( ; eed; eed = BM_iter_step(&iter)) { - if ( (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) || - BM_elem_flag_test(eed->v2, BM_ELEM_SELECT))) + if ((BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) || + BM_elem_flag_test(eed->v2, BM_ELEM_SELECT))) { BM_elem_select_set(em->bm, eed, TRUE); } @@ -2094,7 +2094,7 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed, ese = (BMEditSelection *)em->bm->selected.last; if (ese) { - switch(ese->htype) { + switch (ese->htype) { case BM_VERT: *r_eve = (BMVert *)ese->ele; return; @@ -2210,6 +2210,7 @@ int EM_view3d_poll(bContext *C) { if (ED_operator_editmesh(C) && ED_operator_view3d_active(C)) return 1; + return 0; } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 651ad679f09..3448ac608e1 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1931,7 +1931,7 @@ static int edbm_merge_exec(bContext *C, wmOperator *op) BMEditMesh *em = BMEdit_FromObject(obedit); int status = 0, uvs = RNA_boolean_get(op->ptr, "uvs"); - switch(RNA_enum_get(op->ptr, "type")) { + switch (RNA_enum_get(op->ptr, "type")) { case 3: status = merge_target(em, scene, v3d, obedit, 0, uvs, op); break; @@ -2052,7 +2052,7 @@ static int edbm_remove_doubles_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s", count, (count==1)?"ex":"ices"); + BKE_reportf(op->reports, RPT_INFO, "Removed %d vert%s", count, (count == 1) ? "ex" : "ices"); DAG_id_tag_update(obedit->data, OB_RECALC_DATA); @@ -2630,7 +2630,7 @@ static int edbm_select_axis_exec(bContext *C, wmOperator *op) BM_ITER(ev, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { if (!BM_elem_flag_test(ev, BM_ELEM_HIDDEN)) { - switch(mode) { + switch (mode) { case -1: /* aligned */ if (fabs(ev->co[axis] - value) < limit) BM_elem_select_set(em->bm, ev, TRUE); @@ -2820,7 +2820,7 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode, *isected = 0; - /* check for *exact* vertex intersection first */ + /* check for _exact_ vertex intersection first */ if (mode != KNIFE_MULTICUT) { for (i = 0; i < len; i++) { if (i > 0) { @@ -2937,7 +2937,7 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode, } lastdist = dist; } - return(perc); + return perc; } #define MAX_CUTS 2048 @@ -2973,7 +2973,9 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op) RNA_float_get_array(&itemptr, "loc", (float *)&curve[len]); len++; - if (len >= MAX_CUTS) break; + if (len >= MAX_CUTS) { + break; + } } RNA_END; diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c index 2cd15877728..58899acff9b 100644 --- a/source/blender/editors/mesh/mesh_navmesh.c +++ b/source/blender/editors/mesh/mesh_navmesh.c @@ -37,6 +37,11 @@ #include "DNA_modifier_types.h" #include "DNA_ID.h" +#include "BLI_listbase.h" +#include "BLI_utildefines.h" +#include "BLI_math_vector.h" +#include "BLI_linklist.h" + #include "BKE_library.h" #include "BKE_depsgraph.h" #include "BKE_context.h" @@ -49,11 +54,6 @@ #include "BKE_report.h" #include "BKE_tessmesh.h" -#include "BLI_listbase.h" -#include "BLI_utildefines.h" -#include "BLI_math_vector.h" -#include "BLI_linklist.h" - #include "ED_object.h" #include "ED_mesh.h" #include "ED_screen.h" @@ -66,26 +66,26 @@ #include "mesh_intern.h" #include "recast-capi.h" -static void createVertsTrisData(bContext *C, LinkNode* obs, int *nverts_r, float **verts_r, int *ntris_r, int **tris_r) +static void createVertsTrisData(bContext *C, LinkNode *obs, int *nverts_r, float **verts_r, int *ntris_r, int **tris_r) { MVert *mvert; - int nfaces= 0, *tri, i, curnverts, basenverts, curnfaces; + int nfaces = 0, *tri, i, curnverts, basenverts, curnfaces; MFace *mface; float co[3], wco[3]; Object *ob; LinkNode *oblink, *dmlink; DerivedMesh *dm; - Scene* scene= CTX_data_scene(C); - LinkNode* dms= NULL; + Scene *scene = CTX_data_scene(C); + LinkNode *dms = NULL; int nverts, ntris, *tris; float *verts; - nverts= 0; - ntris= 0; + nverts = 0; + ntris = 0; /* calculate number of verts and tris */ - for(oblink= obs; oblink; oblink= oblink->next) { + for(oblink = obs; oblink; oblink= oblink->next) { ob= (Object*) oblink->link; dm= mesh_create_derived_no_virtual(scene, ob, NULL, CD_MASK_MESH); BLI_linklist_append(&dms, (void*)dm); @@ -97,7 +97,7 @@ static void createVertsTrisData(bContext *C, LinkNode* obs, int *nverts_r, float /* resolve quad faces */ mface= dm->getTessFaceArray(dm); for(i= 0; iv4) ntris+=1; } @@ -134,7 +134,7 @@ static void createVertsTrisData(bContext *C, LinkNode* obs, int *nverts_r, float mface= dm->getTessFaceArray(dm); for(i= 0; iv1; tri[1]= basenverts + mf->v3; @@ -172,7 +172,7 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts float bmin[3], bmax[3]; struct recast_heightfield *solid; unsigned char *triflags; - struct recast_compactHeightfield* chf; + struct recast_compactHeightfield *chf; struct recast_contourSet *cset; int width, height, walkableHeight, walkableClimb, walkableRadius; int minRegionArea, mergeRegionArea, maxEdgeLen; @@ -290,15 +290,15 @@ static int buildNavMesh(const RecastData *recastParams, int nverts, float *verts return 1; } -static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh, struct recast_polyMeshDetail *dmesh, Base* base) +static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh, struct recast_polyMeshDetail *dmesh, Base *base) { float co[3], rot[3]; BMEditMesh *em; int i,j, k; - unsigned short* v; + unsigned short *v; int face[3]; Scene *scene= CTX_data_scene(C); - Object* obedit; + Object *obedit; int createob= base==NULL; int nverts, nmeshes, nvp; unsigned short *verts, *polys; @@ -357,7 +357,7 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh, unsigned short ndv= meshes[4*i+1]; unsigned short tribase= meshes[4*i+2]; unsigned short trinum= meshes[4*i+3]; - const unsigned short* p= &polys[i*nvp*2]; + const unsigned short *p= &polys[i*nvp*2]; int nv= 0; for(j= 0; j < nvp; ++j) { @@ -376,9 +376,9 @@ static Object* createRepresentation(bContext *C, struct recast_polyMesh *pmesh, /* create faces */ for(j= 0; jobject->type == OB_MESH) { @@ -500,8 +500,8 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op) /* set target poly idx to other selected faces */ BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) { if(BM_elem_flag_test(efa, BM_ELEM_SELECT) && efa != efa_act) { - int* recastDataBlock= (int*)CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_RECAST); - *recastDataBlock= targetPolyIdx; + int *recastDataBlock = (int*)CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_RECAST); + *recastDataBlock = targetPolyIdx; } } } @@ -537,18 +537,18 @@ static int compare(const void * a, const void * b) return ( *(int*)a - *(int*)b ); } -static int findFreeNavPolyIndex(BMEditMesh* em) +static int findFreeNavPolyIndex(BMEditMesh *em) { /* construct vector of indices */ - int numfaces= em->bm->totface; - int* indices= MEM_callocN(sizeof(int)*numfaces, "findFreeNavPolyIndex(indices)"); - BMFace* ef; + int numfaces = em->bm->totface; + int *indices = MEM_callocN(sizeof(int)*numfaces, "findFreeNavPolyIndex(indices)"); + BMFace *ef; BMIter iter; - int i, idx= em->bm->totface-1, freeIdx= 1; + int i, idx = em->bm->totface-1, freeIdx = 1; /*XXX this originally went last to first, but that isn't possible anymore*/ BM_ITER(ef, &iter, em->bm, BM_FACES_OF_MESH, NULL) { - int polyIdx= *(int*)CustomData_bmesh_get(&em->bm->pdata, ef->head.data, CD_RECAST); + int polyIdx = *(int*)CustomData_bmesh_get(&em->bm->pdata, ef->head.data, CD_RECAST); indices[idx]= polyIdx; idx--; } @@ -556,8 +556,8 @@ static int findFreeNavPolyIndex(BMEditMesh* em) qsort(indices, numfaces, sizeof(int), compare); /* search first free index */ - freeIdx= 1; - for(i= 0; ifreeIdx) @@ -577,7 +577,7 @@ static int navmesh_face_add_exec(bContext *C, wmOperator *UNUSED(op)) BMIter iter; if(CustomData_has_layer(&em->bm->pdata, CD_RECAST)) { - int targetPolyIdx= findFreeNavPolyIndex(em); + int targetPolyIdx = findFreeNavPolyIndex(em); if(targetPolyIdx>0) { /* set target poly idx to selected faces */ @@ -585,8 +585,8 @@ static int navmesh_face_add_exec(bContext *C, wmOperator *UNUSED(op)) BM_ITER(ef, &iter, em->bm, BM_FACES_OF_MESH, NULL) { if(BM_elem_flag_test(ef, BM_ELEM_SELECT)) { - int *recastDataBlock= (int*)CustomData_bmesh_get(&em->bm->pdata, ef->head.data, CD_RECAST); - *recastDataBlock= targetPolyIdx; + int *recastDataBlock = (int*)CustomData_bmesh_get(&em->bm->pdata, ef->head.data, CD_RECAST); + *recastDataBlock = targetPolyIdx; } } } @@ -617,7 +617,7 @@ static int navmesh_obmode_data_poll(bContext *C) { Object *ob = ED_object_active_context(C); if (ob && (ob->mode == OB_MODE_OBJECT) && (ob->type == OB_MESH)) { - Mesh *me= ob->data; + Mesh *me = ob->data; return CustomData_has_layer(&me->pdata, CD_RECAST); } return FALSE; @@ -635,7 +635,7 @@ static int navmesh_obmode_poll(bContext *C) static int navmesh_reset_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_active_context(C); - Mesh *me= ob->data; + Mesh *me = ob->data; CustomData_free_layers(&me->pdata, CD_RECAST, me->totpoly); @@ -665,7 +665,7 @@ void MESH_OT_navmesh_reset(struct wmOperatorType *ot) static int navmesh_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_active_context(C); - Mesh *me= ob->data; + Mesh *me = ob->data; CustomData_free_layers(&me->pdata, CD_RECAST, me->totpoly); diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 556288b5171..29face0efc2 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -193,51 +193,51 @@ void ED_operatormacros_mesh(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot= WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Cut mesh loop and slide it"; WM_operatortype_macro_define(ot, "MESH_OT_loopcut"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide"); RNA_struct_idprops_unset(otmacro->ptr, "release_confirm"); - ot= WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Duplicate mesh and move"; WM_operatortype_macro_define(ot, "MESH_OT_duplicate"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot= WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Rip polygons and move the result"; WM_operatortype_macro_define(ot, "MESH_OT_rip"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot= WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Extrude region and move result"; - otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_region"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot= WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Extrude faces and move result"; - otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten"); + otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot= WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Extrude edges and move result"; - otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); - ot= WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Extrude vertices and move result"; - otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", 0); RNA_boolean_set(otmacro->ptr, "mirror", FALSE); } @@ -249,8 +249,8 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) wmKeyMapItem *kmi; int i; - keymap= WM_keymap_find(keyconf, "Mesh", 0, 0); - keymap->poll= ED_operator_editmesh; + keymap = WM_keymap_find(keyconf, "Mesh", 0, 0); + keymap->poll = ED_operator_editmesh; WM_keymap_add_item(keymap, "MESH_OT_loopcut_slide", RKEY, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index 2d20743b21b..7e1be0dae5c 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -428,10 +428,10 @@ int mouse_mball(bContext *C, const int mval[2], int extend) view3d_set_viewcontext(C, &vc); - rect.xmin= mval[0]-12; - rect.xmax= mval[0]+12; - rect.ymin= mval[1]-12; - rect.ymax= mval[1]+12; + rect.xmin = mval[0]-12; + rect.xmax = mval[0]+12; + rect.ymin = mval[1]-12; + rect.ymax = mval[1]+12; hits= view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect); diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c index f689fb049fe..5d019cc49d9 100644 --- a/source/blender/editors/metaball/mball_ops.c +++ b/source/blender/editors/metaball/mball_ops.c @@ -59,8 +59,8 @@ void ED_keymap_metaball(wmKeyConfig *keyconf) wmKeyMap *keymap; wmKeyMapItem *kmi; - keymap= WM_keymap_find(keyconf, "Metaball", 0, 0); - keymap->poll= ED_operator_editmball; + keymap = WM_keymap_find(keyconf, "Metaball", 0, 0); + keymap->poll = ED_operator_editmball; WM_keymap_add_item(keymap, "OBJECT_OT_metaball_add", AKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index cb231fcd413..b8ff71c59a2 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -221,26 +221,26 @@ void ED_operatormacros_object(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate Objects", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate Objects", OPTYPE_UNDO|OPTYPE_REGISTER); if(ot) { ot->description = "Duplicate selected objects and move them"; WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF); } /* grr, should be able to pass options on... */ - ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked", OPTYPE_UNDO|OPTYPE_REGISTER); if(ot) { ot->description = "Duplicate selected objects and move them"; - otmacro= WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate"); + otmacro = WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate"); RNA_boolean_set(otmacro->ptr, "linked", TRUE); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF); } /* XXX */ - ot= WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add named object at cursor", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add named object at cursor", OPTYPE_UNDO|OPTYPE_REGISTER); if(ot) { ot->description = "Add named object at cursor"; RNA_def_string(ot->srna, "name", "Cube", MAX_ID_NAME-2, "Name", "Object name to add"); @@ -263,7 +263,7 @@ void ED_keymap_object(wmKeyConfig *keyconf) int i; /* Objects, Regardless of Mode -------------------------------------------------- */ - keymap= WM_keymap_find(keyconf, "Object Non-modal", 0, 0); + keymap = WM_keymap_find(keyconf, "Object Non-modal", 0, 0); /* Note: this keymap works disregarding mode */ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0); @@ -286,8 +286,8 @@ void ED_keymap_object(wmKeyConfig *keyconf) /* Object Mode ---------------------------------------------------------------- */ /* Note: this keymap gets disabled in non-objectmode, */ - keymap= WM_keymap_find(keyconf, "Object Mode", 0, 0); - keymap->poll= object_mode_poll; + keymap = WM_keymap_find(keyconf, "Object Mode", 0, 0); + keymap->poll = object_mode_poll; /* object mode supports PET now */ ED_object_generic_keymap(keyconf, keymap, 1); @@ -400,8 +400,8 @@ void ED_keymap_object(wmKeyConfig *keyconf) /* ################################ LATTICE ################################### */ /* ############################################################################ */ - keymap= WM_keymap_find(keyconf, "Lattice", 0, 0); - keymap->poll= ED_operator_editlattice; + keymap = WM_keymap_find(keyconf, "Lattice", 0, 0); + keymap->poll = ED_operator_editlattice; kmi = WM_keymap_add_item(keymap, "LATTICE_OT_select_all", AKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index 473ed50b5e2..272e13e2a62 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -93,8 +93,8 @@ static void keymap_particle(wmKeyConfig *keyconf) wmKeyMapItem *kmi; wmKeyMap *keymap; - keymap= WM_keymap_find(keyconf, "Particle", 0, 0); - keymap->poll= PE_poll; + keymap = WM_keymap_find(keyconf, "Particle", 0, 0); + keymap->poll = PE_poll; kmi = WM_keymap_add_item(keymap, "PARTICLE_OT_select_all", AKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE); @@ -187,7 +187,7 @@ static void operatortypes_dynamicpaint(void) //static void keymap_pointcache(wmWindowManager *wm) //{ -// wmKeyMap *keymap= WM_keymap_find(wm, "Pointcache", 0, 0); +// wmKeyMap *keymap = WM_keymap_find(wm, "Pointcache", 0, 0); // // WM_keymap_add_item(keymap, "PHYSICS_OT_bake_all", AKEY, KM_PRESS, 0, 0); // WM_keymap_add_item(keymap, "PHYSICS_OT_free_all", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 7459ac09aec..f3ef0f3cd64 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -97,7 +97,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat ymax= renrect->ymax - ymin + rr->crop; if(ymax<2) return; - renrect->ymin= renrect->ymax; + renrect->ymin = renrect->ymax; } else { diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index f0ef7c633cb..8cdde5f160f 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -505,8 +505,8 @@ static int ed_preview_draw_rect(ScrArea *sa, Scene *sce, ID *id, int split, int if(ABS(rres.rectx-newx)<2 && ABS(rres.recty-newy)<2) { - newrect->xmax= MAX2(newrect->xmax, rect->xmin + rres.rectx + offx); - newrect->ymax= MAX2(newrect->ymax, rect->ymin + rres.recty); + newrect->xmax = MAX2(newrect->xmax, rect->xmin + rres.rectx + offx); + newrect->ymax = MAX2(newrect->ymax, rect->ymin + rres.recty); if(rres.rectx && rres.recty) { /* temporary conversion to byte for drawing */ @@ -549,10 +549,10 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, r int ok; int newx= rect->xmax-rect->xmin, newy= rect->ymax-rect->ymin; - newrect.xmin= rect->xmin; - newrect.xmax= rect->xmin; - newrect.ymin= rect->ymin; - newrect.ymax= rect->ymin; + newrect.xmin = rect->xmin; + newrect.xmax = rect->xmin; + newrect.ymin = rect->ymin; + newrect.ymax = rect->ymin; if(parent) { ok = ed_preview_draw_rect(sa, sce, id, 1, 1, rect, &newrect); diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index 65fc283ff3a..64f54e63cb9 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -152,10 +152,10 @@ void render_view_open(bContext *C, int mx, int my) if(sizey < 256) sizey= 256; /* XXX some magic to calculate postition */ - rect.xmin= mx + win->posx - sizex/2; - rect.ymin= my + win->posy - sizey/2; - rect.xmax= rect.xmin + sizex; - rect.ymax= rect.ymin + sizey; + rect.xmin = mx + win->posx - sizex/2; + rect.ymin = my + win->posy - sizey/2; + rect.xmax = rect.xmin + sizex; + rect.ymax = rect.ymin + sizey; /* changes context! */ WM_window_open_temp(C, &rect, WM_WINDOW_RENDER); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index d744149bf9c..955a19f6725 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -74,10 +74,10 @@ static void region_draw_emboss(ARegion *ar, rcti *scirct) rcti rect; /* translate scissor rect to region space */ - rect.xmin= scirct->xmin - ar->winrct.xmin; - rect.ymin= scirct->ymin - ar->winrct.ymin; - rect.xmax= scirct->xmax - ar->winrct.xmin; - rect.ymax= scirct->ymax - ar->winrct.ymin; + rect.xmin = scirct->xmin - ar->winrct.xmin; + rect.ymin = scirct->ymin - ar->winrct.ymin; + rect.xmax = scirct->xmax - ar->winrct.xmin; + rect.ymax = scirct->ymax - ar->winrct.ymin; /* set transp line */ glEnable( GL_BLEND ); @@ -406,10 +406,10 @@ void region_scissor_winrct(ARegion *ar, rcti *winrct) if(ar->flag & RGN_FLAG_HIDDEN); else if(ar->alignment & RGN_SPLIT_PREV); else if(ar->alignment==RGN_OVERLAP_LEFT) { - winrct->xmin= ar->winrct.xmax + 1; + winrct->xmin = ar->winrct.xmax + 1; } else if(ar->alignment==RGN_OVERLAP_RIGHT) { - winrct->xmax= ar->winrct.xmin - 1; + winrct->xmax = ar->winrct.xmin - 1; } else break; } @@ -458,10 +458,10 @@ void ED_region_do_draw(bContext *C, ARegion *ar) ar->drawrct= winrct; else { /* extra clip for safety */ - ar->drawrct.xmin= MAX2(winrct.xmin, ar->drawrct.xmin); - ar->drawrct.ymin= MAX2(winrct.ymin, ar->drawrct.ymin); - ar->drawrct.xmax= MIN2(winrct.xmax, ar->drawrct.xmax); - ar->drawrct.ymax= MIN2(winrct.ymax, ar->drawrct.ymax); + ar->drawrct.xmin = MAX2(winrct.xmin, ar->drawrct.xmin); + ar->drawrct.ymin = MAX2(winrct.ymin, ar->drawrct.ymin); + ar->drawrct.xmax = MIN2(winrct.xmax, ar->drawrct.xmax); + ar->drawrct.ymax = MIN2(winrct.ymax, ar->drawrct.ymax); } /* note; this sets state, so we can use wmOrtho and friends */ @@ -525,10 +525,10 @@ void ED_region_tag_redraw_partial(ARegion *ar, rcti *rct) } else if(ar->drawrct.xmin != ar->drawrct.xmax) { /* partial redraw already set, expand region */ - ar->drawrct.xmin= MIN2(ar->drawrct.xmin, rct->xmin); - ar->drawrct.ymin= MIN2(ar->drawrct.ymin, rct->ymin); - ar->drawrct.xmax= MAX2(ar->drawrct.xmax, rct->xmax); - ar->drawrct.ymax= MAX2(ar->drawrct.ymax, rct->ymax); + ar->drawrct.xmin = MIN2(ar->drawrct.xmin, rct->xmin); + ar->drawrct.ymin = MIN2(ar->drawrct.ymin, rct->ymin); + ar->drawrct.xmax = MAX2(ar->drawrct.xmax, rct->xmax); + ar->drawrct.ymax = MAX2(ar->drawrct.ymax, rct->ymax); } } } @@ -961,12 +961,12 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int ar->winrct= *remainder; if(alignment==RGN_ALIGN_TOP) { - ar->winrct.ymin= ar->winrct.ymax - prefsizey + 1; - remainder->ymax= ar->winrct.ymin - 1; + ar->winrct.ymin = ar->winrct.ymax - prefsizey + 1; + remainder->ymax = ar->winrct.ymin - 1; } else { - ar->winrct.ymax= ar->winrct.ymin + prefsizey - 1; - remainder->ymin= ar->winrct.ymax + 1; + ar->winrct.ymax = ar->winrct.ymin + prefsizey - 1; + remainder->ymin = ar->winrct.ymax + 1; } } } @@ -984,14 +984,14 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int ar->winrct= *remainder; if(ELEM(alignment, RGN_ALIGN_RIGHT, RGN_OVERLAP_RIGHT)) { - ar->winrct.xmin= ar->winrct.xmax - prefsizex + 1; + ar->winrct.xmin = ar->winrct.xmax - prefsizex + 1; if(alignment==RGN_ALIGN_RIGHT) - remainder->xmax= ar->winrct.xmin - 1; + remainder->xmax = ar->winrct.xmin - 1; } else { - ar->winrct.xmax= ar->winrct.xmin + prefsizex - 1; + ar->winrct.xmax = ar->winrct.xmin + prefsizex - 1; if(alignment==RGN_ALIGN_LEFT) - remainder->xmin= ar->winrct.xmax + 1; + remainder->xmin = ar->winrct.xmax + 1; } } } @@ -1001,8 +1001,8 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int if(alignment==RGN_ALIGN_HSPLIT) { if( rct_fits(remainder, 'h', prefsizex) > 4) { - ar->winrct.xmax= (remainder->xmin+remainder->xmax)/2; - remainder->xmin= ar->winrct.xmax+1; + ar->winrct.xmax = (remainder->xmin+remainder->xmax)/2; + remainder->xmin = ar->winrct.xmax+1; } else { BLI_init_rcti(remainder, 0, 0, 0, 0); @@ -1010,8 +1010,8 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int } else { if( rct_fits(remainder, 'v', prefsizey) > 4) { - ar->winrct.ymax= (remainder->ymin+remainder->ymax)/2; - remainder->ymin= ar->winrct.ymax+1; + ar->winrct.ymax = (remainder->ymin+remainder->ymax)/2; + remainder->ymin = ar->winrct.ymax+1; } else { BLI_init_rcti(remainder, 0, 0, 0, 0); @@ -1072,15 +1072,15 @@ static void region_rect_recursive(ScrArea *sa, ARegion *ar, rcti *remainder, int ar->winrct= *remainder; if(alignment==RGN_ALIGN_TOP) - ar->winrct.ymin= ar->winrct.ymax; + ar->winrct.ymin = ar->winrct.ymax; else if(alignment==RGN_ALIGN_BOTTOM) - ar->winrct.ymax= ar->winrct.ymin; + ar->winrct.ymax = ar->winrct.ymin; else if(ELEM(alignment, RGN_ALIGN_RIGHT, RGN_OVERLAP_RIGHT)) - ar->winrct.xmin= ar->winrct.xmax; + ar->winrct.xmin = ar->winrct.xmax; else if(ELEM(alignment, RGN_ALIGN_LEFT, RGN_OVERLAP_LEFT)) - ar->winrct.xmax= ar->winrct.xmin; + ar->winrct.xmax = ar->winrct.xmin; else /* prevent winrct to be valid */ - ar->winrct.xmax= ar->winrct.xmin; + ar->winrct.xmax = ar->winrct.xmin; } /* restore prev-split exception */ @@ -1113,15 +1113,15 @@ static void area_calc_totrct(ScrArea *sa, int sizex, int sizey) { short rt= 0; // CLAMPIS(G.rt, 0, 16); - if(sa->v1->vec.x>0) sa->totrct.xmin= sa->v1->vec.x+1+rt; - else sa->totrct.xmin= sa->v1->vec.x; - if(sa->v4->vec.xtotrct.xmax= sa->v4->vec.x-1-rt; - else sa->totrct.xmax= sa->v4->vec.x; + if(sa->v1->vec.x>0) sa->totrct.xmin = sa->v1->vec.x+1+rt; + else sa->totrct.xmin = sa->v1->vec.x; + if(sa->v4->vec.xtotrct.xmax = sa->v4->vec.x-1-rt; + else sa->totrct.xmax = sa->v4->vec.x; - if(sa->v1->vec.y>0) sa->totrct.ymin= sa->v1->vec.y+1+rt; - else sa->totrct.ymin= sa->v1->vec.y; - if(sa->v2->vec.ytotrct.ymax= sa->v2->vec.y-1-rt; - else sa->totrct.ymax= sa->v2->vec.y; + if(sa->v1->vec.y>0) sa->totrct.ymin = sa->v1->vec.y+1+rt; + else sa->totrct.ymin = sa->v1->vec.y; + if(sa->v2->vec.ytotrct.ymax = sa->v2->vec.y-1-rt; + else sa->totrct.ymax = sa->v2->vec.y; /* for speedup */ sa->winx= sa->totrct.xmax-sa->totrct.xmin+1; @@ -1154,12 +1154,12 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand } if(flag & ED_KEYMAP_VIEW2D) { /* 2d-viewport handling+manipulation */ - wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "View2D", 0, 0); + wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "View2D", 0, 0); WM_event_add_keymap_handler(handlers, keymap); } if(flag & ED_KEYMAP_MARKERS) { /* time-markers */ - wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Markers", 0, 0); + wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Markers", 0, 0); /* time space only has this keymap, the others get a boundbox restricted map */ if(sa->spacetype!=SPACE_TIME) { @@ -1175,22 +1175,22 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand } if(flag & ED_KEYMAP_ANIMATION) { /* frame changing and timeline operators (for time spaces) */ - wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Animation", 0, 0); + wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Animation", 0, 0); WM_event_add_keymap_handler(handlers, keymap); } if(flag & ED_KEYMAP_FRAMES) { /* frame changing/jumping (for all spaces) */ - wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Frames", 0, 0); + wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Frames", 0, 0); WM_event_add_keymap_handler(handlers, keymap); } if(flag & ED_KEYMAP_GPENCIL) { /* grease pencil */ - wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Grease Pencil", 0, 0); + wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Grease Pencil", 0, 0); WM_event_add_keymap_handler(handlers, keymap); } if(flag & ED_KEYMAP_HEADER) { /* standard keymap for headers regions */ - wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Header", 0, 0); + wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Header", 0, 0); WM_event_add_keymap_handler(handlers, keymap); } } @@ -1505,7 +1505,7 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco) uiBut *but; int xco= 8; - but= uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D, + but = uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D, editortype_pup(), xco, yco, UI_UNIT_X+10, UI_UNIT_Y, &(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0, TIP_("Displays current editor type. Click for menu of available types")); @@ -1527,14 +1527,14 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco) uiBlockSetEmboss(block, UI_EMBOSSN); if (sa->flag & HEADER_NO_PULLDOWN) { - but= uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0, + but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0, ICON_DISCLOSURE_TRI_RIGHT, xco,yco,UI_UNIT_X,UI_UNIT_Y-2, &(sa->flag), 0, 0, 0, 0, "Show pulldown menus"); } else { - but= uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0, + but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0, ICON_DISCLOSURE_TRI_DOWN, xco,yco,UI_UNIT_X,UI_UNIT_Y-2, &(sa->flag), 0, 0, 0, 0, @@ -1709,7 +1709,7 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_PANELS_UI, ar->winx, ar->winy); - keymap= WM_keymap_find(wm->defaultconf, "View2D Buttons List", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "View2D Buttons List", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -1788,17 +1788,17 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha) /* background box */ rect= ar->winrct; - rect.xmin= 0; - rect.ymin= ar->winrct.ymax - ar->winrct.ymin - header_height; + rect.xmin = 0; + rect.ymin = ar->winrct.ymax - ar->winrct.ymin - header_height; if(block) { - rect.xmax= ar->winrct.xmax - ar->winrct.xmin; + rect.xmax = ar->winrct.xmax - ar->winrct.xmin; } else { - rect.xmax= rect.xmin + BLF_width(fontid, text) + 24; + rect.xmax = rect.xmin + BLF_width(fontid, text) + 24; } - rect.ymax= ar->winrct.ymax - ar->winrct.ymin; + rect.ymax = ar->winrct.ymax - ar->winrct.ymin; glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 2608e9e3482..495bfb9ba39 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -710,10 +710,10 @@ gla2DDrawInfo *glaBegin2DDraw(rcti *screen_rect, rctf *world_rect) if (world_rect) { di->world_rect= *world_rect; } else { - di->world_rect.xmin= di->screen_rect.xmin; - di->world_rect.ymin= di->screen_rect.ymin; - di->world_rect.xmax= di->screen_rect.xmax; - di->world_rect.ymax= di->screen_rect.ymax; + di->world_rect.xmin = di->screen_rect.xmin; + di->world_rect.ymin = di->screen_rect.ymin; + di->world_rect.xmax = di->screen_rect.xmax; + di->world_rect.ymax = di->screen_rect.ymax; } sc_w= (di->screen_rect.xmax-di->screen_rect.xmin); diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 3f8f786489c..f07ca8b87e1 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1075,10 +1075,10 @@ void ED_screen_refresh(wmWindowManager *wm, wmWindow *win) ScrArea *sa; rcti winrct; - winrct.xmin= 0; - winrct.xmax= win->sizex-1; - winrct.ymin= 0; - winrct.ymax= win->sizey-1; + winrct.xmin = 0; + winrct.xmax = win->sizex-1; + winrct.ymin = 0; + winrct.ymax = win->sizey-1; screen_test_scale(win->screen, win->sizex, win->sizey); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 453b4955daf..00915be9758 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3227,10 +3227,10 @@ static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *ev sizey= 480; /* some magic to calculate postition */ - rect.xmin= event->x + CTX_wm_window(C)->posx - sizex/2; - rect.ymin= event->y + CTX_wm_window(C)->posy - sizey/2; - rect.xmax= rect.xmin + sizex; - rect.ymax= rect.ymin + sizey; + rect.xmin = event->x + CTX_wm_window(C)->posx - sizex/2; + rect.ymin = event->y + CTX_wm_window(C)->posy - sizey/2; + rect.xmax = rect.xmin + sizex; + rect.ymax = rect.ymin + sizey; /* changes context! */ WM_window_open_temp(C, &rect, WM_WINDOW_USERPREFS); @@ -3495,7 +3495,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf) wmKeyMapItem *kmi; /* Screen Editing ------------------------------------------------ */ - keymap= WM_keymap_find(keyconf, "Screen Editing", 0, 0); + keymap = WM_keymap_find(keyconf, "Screen Editing", 0, 0); RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "modifier", 0); RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "modifier", 1); @@ -3514,12 +3514,12 @@ void ED_keymap_screen(wmKeyConfig *keyconf) /* Header Editing ------------------------------------------------ */ - keymap= WM_keymap_find(keyconf, "Header", 0, 0); + keymap = WM_keymap_find(keyconf, "Header", 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_header_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0); /* Screen General ------------------------------------------------ */ - keymap= WM_keymap_find(keyconf, "Screen", 0, 0); + keymap = WM_keymap_find(keyconf, "Screen", 0, 0); /* standard timers */ WM_keymap_add_item(keymap, "SCREEN_OT_animation_step", TIMER0, KM_ANY, KM_ANY, 0); @@ -3573,7 +3573,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf) /* Anim Playback ------------------------------------------------ */ - keymap= WM_keymap_find(keyconf, "Frames", 0, 0); + keymap = WM_keymap_find(keyconf, "Frames", 0, 0); /* frame offsets */ RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", UPARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "delta", 10); @@ -3611,7 +3611,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf) /* Alternative keys for animation and sequencer playing */ #if 0 // XXX: disabled for restoring later... bad implementation - keymap= WM_keymap_find(keyconf, "Frames", 0, 0); + keymap = WM_keymap_find(keyconf, "Frames", 0, 0); kmi = WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "cycle_speed", TRUE); diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c index 9008458cafa..fbb0df401f9 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.c +++ b/source/blender/editors/sculpt_paint/paint_hide.c @@ -223,10 +223,10 @@ static void partialvis_update_grids(Object *ob, static void rect_from_props(rcti *rect, PointerRNA *ptr) { - rect->xmin= RNA_int_get(ptr, "xmin"); - rect->ymin= RNA_int_get(ptr, "ymin"); - rect->xmax= RNA_int_get(ptr, "xmax"); - rect->ymax= RNA_int_get(ptr, "ymax"); + rect->xmin = RNA_int_get(ptr, "xmin"); + rect->ymin = RNA_int_get(ptr, "ymin"); + rect->xmax = RNA_int_get(ptr, "xmax"); + rect->ymax = RNA_int_get(ptr, "ymax"); } static void clip_planes_from_rect(bContext *C, diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index bb1833b4d5e..86af3505f65 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -443,7 +443,7 @@ static void ed_keymap_paint_brush_switch(wmKeyMap *keymap, const char *mode) int i; /* index 0-9 (zero key is tenth), shift key for index 10-19 */ for (i = 0; i < 20; i++) { - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", + kmi = WM_keymap_add_item(keymap, "BRUSH_OT_active_index_set", ZEROKEY + ((i + 1) % 10), KM_PRESS, i < 10 ? 0 : KM_SHIFT, 0); RNA_string_set(kmi->ptr, "mode", mode); RNA_int_set(kmi->ptr, "index", i); @@ -454,10 +454,10 @@ static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *UNUSED(path { wmKeyMapItem *kmi; - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_scale_size", LEFTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "BRUSH_OT_scale_size", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_float_set(kmi->ptr, "scalar", 0.9); - kmi= WM_keymap_add_item(keymap, "BRUSH_OT_scale_size", RIGHTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "BRUSH_OT_scale_size", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_float_set(kmi->ptr, "scalar", 10.0/9.0); // 1.1111.... } @@ -533,13 +533,13 @@ void paint_partial_visibility_keys(wmKeyMap *keymap) wmKeyMapItem *kmi; /* Partial visiblity */ - kmi= WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "action", PARTIALVIS_SHOW); RNA_enum_set(kmi->ptr, "area", PARTIALVIS_INSIDE); - kmi= WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "action", PARTIALVIS_HIDE); RNA_enum_set(kmi->ptr, "area", PARTIALVIS_INSIDE); - kmi= WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "PAINT_OT_hide_show", HKEY, KM_PRESS, KM_ALT, 0); RNA_enum_set(kmi->ptr, "action", PARTIALVIS_SHOW); RNA_enum_set(kmi->ptr, "area", PARTIALVIS_ALL); } @@ -551,8 +551,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf) int i; /* Sculpt mode */ - keymap= WM_keymap_find(keyconf, "Sculpt", 0, 0); - keymap->poll= sculpt_poll; + keymap = WM_keymap_find(keyconf, "Sculpt", 0, 0); + keymap->poll = sculpt_poll; RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "mode", BRUSH_STROKE_NORMAL); RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, KM_CTRL, 0)->ptr, "mode", BRUSH_STROKE_INVERT); @@ -565,11 +565,11 @@ void ED_keymap_paint(wmKeyConfig *keyconf) RNA_int_set(WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", ZEROKEY+i, KM_PRESS, KM_CTRL, 0)->ptr, "level", i); /* multires switch */ - kmi= WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEUPKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEUPKEY, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "level", 1); RNA_boolean_set(kmi->ptr, "relative", TRUE); - kmi= WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEDOWNKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEDOWNKEY, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "level", -1); RNA_boolean_set(kmi->ptr, "relative", TRUE); @@ -598,8 +598,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf) RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.texture_angle_source_random"); /* Vertex Paint mode */ - keymap= WM_keymap_find(keyconf, "Vertex Paint", 0, 0); - keymap->poll= vertex_paint_mode_poll; + keymap = WM_keymap_find(keyconf, "Vertex Paint", 0, 0); + keymap->poll = vertex_paint_mode_poll; WM_keymap_verify_item(keymap, "PAINT_OT_vertex_paint", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0); @@ -615,8 +615,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf) RNA_string_set(kmi->ptr, "data_path", "vertex_paint_object.data.use_paint_mask"); /* Weight Paint mode */ - keymap= WM_keymap_find(keyconf, "Weight Paint", 0, 0); - keymap->poll= weight_paint_mode_poll; + keymap = WM_keymap_find(keyconf, "Weight Paint", 0, 0); + keymap->poll = weight_paint_mode_poll; WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0); @@ -642,8 +642,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf) /*Weight paint's Vertex Selection Mode */ - keymap= WM_keymap_find(keyconf, "Weight Paint Vertex Selection", 0, 0); - keymap->poll= vert_paint_poll; + keymap = WM_keymap_find(keyconf, "Weight Paint Vertex Selection", 0, 0); + keymap->poll = vert_paint_poll; WM_keymap_add_item(keymap, "PAINT_OT_vert_select_all", AKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PAINT_OT_vert_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_select_border", BKEY, KM_PRESS, 0, 0); @@ -654,8 +654,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0); /* Image/Texture Paint mode */ - keymap= WM_keymap_find(keyconf, "Image Paint", 0, 0); - keymap->poll= image_texture_paint_poll; + keymap = WM_keymap_find(keyconf, "Image Paint", 0, 0); + keymap->poll = image_texture_paint_poll; WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PAINT_OT_grab_clone", RIGHTMOUSE, KM_PRESS, 0, 0); @@ -670,8 +670,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf) RNA_string_set(kmi->ptr, "data_path", "image_paint_object.data.use_paint_mask"); /* face-mask mode */ - keymap= WM_keymap_find(keyconf, "Face Mask", 0, 0); - keymap->poll= facemask_paint_poll; + keymap = WM_keymap_find(keyconf, "Face Mask", 0, 0); + keymap->poll = facemask_paint_poll; WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", AKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "PAINT_OT_face_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); @@ -684,8 +684,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked", LKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, KM_PRESS, 0, 0); - keymap= WM_keymap_find(keyconf, "UV Sculpt", 0, 0); - keymap->poll= uv_sculpt_poll; + keymap = WM_keymap_find(keyconf, "UV Sculpt", 0, 0); + keymap->poll = uv_sculpt_poll; kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", QKEY, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_uv_sculpt"); diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index f29dba4c568..024a9ffb57d 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -93,7 +93,7 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar) /* don't use totrect set, as the width stays the same * (NOTE: this is ok here, the configuration is pretty straightforward) */ - v2d->tot.ymin= (float)(-height); + v2d->tot.ymin = (float)(-height); } /* need to do a view-sync here, so that the keys area doesn't jump around (it must copy this) */ UI_view2d_sync(NULL, ac->sa, v2d, V2D_LOCK_COPY); @@ -209,7 +209,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) /* don't use totrect set, as the width stays the same * (NOTE: this is ok here, the configuration is pretty straightforward) */ - v2d->tot.ymin= (float)(-height); + v2d->tot.ymin = (float)(-height); /* first backdrop strips */ y= (float)(-ACHANNEL_HEIGHT); diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 17f1dfc0714..b8c310f8477 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -355,8 +355,8 @@ static int actkeys_viewall(bContext *C, const short onlySel) v2d->cur.xmax += extra; /* set vertical range */ - v2d->cur.ymax= 0.0f; - v2d->cur.ymin= (float)-(v2d->mask.ymax - v2d->mask.ymin); + v2d->cur.ymax = 0.0f; + v2d->cur.ymin = (float)-(v2d->mask.ymax - v2d->mask.ymin); /* do View2D syncing */ UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 82072c7c28a..f502a97967f 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -93,11 +93,11 @@ void ED_operatormacros_action(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot= WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); if (ot) { ot->description = "Make a copy of all selected keyframes and move them"; WM_operatortype_macro_define(ot, "ACTION_OT_duplicate"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE); } @@ -114,13 +114,13 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "column", FALSE); - kmi= WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "column", TRUE); - kmi= WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "column", FALSE); - kmi= WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "column", TRUE); @@ -128,14 +128,14 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST); - kmi= WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST); - kmi= WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_LEFT); - kmi= WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_RIGHT); @@ -225,7 +225,7 @@ void action_keymap(wmKeyConfig *keyconf) */ /* keyframes */ - keymap= WM_keymap_find(keyconf, "Dopesheet", SPACE_ACTION, 0); + keymap = WM_keymap_find(keyconf, "Dopesheet", SPACE_ACTION, 0); action_keymap_keyframes(keyconf, keymap); } diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 0fef3dd6e2b..3f3966b6f87 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -281,10 +281,10 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op) deselect_action_keys(&ac, 1, SELECT_SUBTRACT); /* get settings from operator */ - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); if (gesture_mode == GESTURE_MODAL_SELECT) diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 7bda0c9a510..8f14ef337c8 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -101,10 +101,10 @@ static SpaceLink *action_new(const bContext *C) BLI_addtail(&saction->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; - ar->v2d.tot.xmin= -10.0f; - ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f; - ar->v2d.tot.xmax= (float)(sa->winx); - ar->v2d.tot.ymax= 0.0f; + ar->v2d.tot.xmin = -10.0f; + ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f; + ar->v2d.tot.xmax = (float)(sa->winx); + ar->v2d.tot.ymax = 0.0f; ar->v2d.cur = ar->v2d.tot; @@ -160,7 +160,7 @@ static void action_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Dopesheet", SPACE_ACTION, 0); + keymap = WM_keymap_find(wm->defaultconf, "Dopesheet", SPACE_ACTION, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -223,7 +223,7 @@ static void action_channel_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 2b63e455e11..440c3c66a4b 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -994,7 +994,7 @@ void buttons_context_draw(const bContext *C, uiLayout *layout) block= uiLayoutGetBlock(row); uiBlockSetEmboss(block, UI_EMBOSSN); - but= uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag, 0, 0, 0, 0, "Follow context or keep fixed datablock displayed"); + but = uiDefIconButBitC(block, ICONTOG, SB_PIN_CONTEXT, 0, ICON_UNPINNED, 0, 0, UI_UNIT_X, UI_UNIT_Y, &sbuts->flag, 0, 0, 0, 0, "Follow context or keep fixed datablock displayed"); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ uiButSetFunc(but, pin_cb, NULL, NULL); diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index 6777e2c2d85..52327d3b59b 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -123,7 +123,7 @@ void buttons_header_buttons(const bContext *C, ARegion *ar) #define BUTTON_HEADER_CTX(_ctx, _icon, _tip) \ if(sbuts->pathflag & (1<<_ctx)) { \ - but= uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, TIP_(_tip)); \ + but = uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, TIP_(_tip)); \ uiButClearFlag(but, UI_BUT_UNDO); \ } \ diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index fb46dd55a12..ae1f504697e 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -395,11 +395,11 @@ void uiTemplateTextureUser(uiLayout *layout, bContext *C) BLI_snprintf(name, UI_MAX_NAME_STR, "%s", user->name); if(user->icon) { - but= uiDefIconTextMenuBut(block, template_texture_user_menu, NULL, + but = uiDefIconTextMenuBut(block, template_texture_user_menu, NULL, user->icon, name, 0, 0, UI_UNIT_X*4, UI_UNIT_Y, ""); } else { - but= uiDefMenuBut(block, template_texture_user_menu, NULL, + but = uiDefMenuBut(block, template_texture_user_menu, NULL, name, 0, 0, UI_UNIT_X*4, UI_UNIT_Y, ""); } @@ -459,7 +459,7 @@ void uiTemplateTextureShow(uiLayout *layout, bContext *C, PointerRNA *ptr, Prope uiBlock *block = uiLayoutGetBlock(layout); uiBut *but; - but= uiDefIconBut(block, BUT, 0, ICON_BUTS, 0, 0, UI_UNIT_X, UI_UNIT_Y, + but = uiDefIconBut(block, BUT, 0, ICON_BUTS, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Show texture in texture tab"); uiButSetFunc(but, template_texture_show, user->ptr.data, user->prop); } diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 6be8421422b..de6c1c2d9b3 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -139,7 +139,7 @@ static void buttons_main_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm->defaultconf, "Property Editor", SPACE_BUTS, 0); + keymap = WM_keymap_find(wm->defaultconf, "Property Editor", SPACE_BUTS, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -191,7 +191,7 @@ static void buttons_operatortypes(void) static void buttons_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Property Editor", SPACE_BUTS, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Property Editor", SPACE_BUTS, 0); WM_keymap_add_item(keymap, "BUTTONS_OT_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0); } diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c index ddfd403806c..0b191b7e1a5 100644 --- a/source/blender/editors/space_clip/clip_buttons.c +++ b/source/blender/editors/space_clip/clip_buttons.c @@ -152,8 +152,8 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname) scopesptr= RNA_property_pointer_get(ptr, prop); scopes= (MovieClipScopes *)scopesptr.data; - rect.xmin= 0; rect.xmax= 200; - rect.ymin= 0; rect.ymax= 120; + rect.xmin = 0; rect.xmax = 200; + rect.ymin = 0; rect.ymax = 120; block= uiLayoutAbsoluteBlock(layout); diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index c9428737770..6be1a83d7d9 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1065,15 +1065,15 @@ void ED_operatormacros_clip(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot= WM_operatortype_append_macro("CLIP_OT_add_marker_move", "Add Marker and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("CLIP_OT_add_marker_move", "Add Marker and Move", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Add new marker and move it on movie"; WM_operatortype_macro_define(ot, "CLIP_OT_add_marker"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_struct_idprops_unset(otmacro->ptr, "release_confirm"); - ot= WM_operatortype_append_macro("CLIP_OT_add_marker_slide", "Add Marker and Slide", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("CLIP_OT_add_marker_slide", "Add Marker and Slide", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Add new marker and slide it with mouse until mouse button release"; WM_operatortype_macro_define(ot, "CLIP_OT_add_marker"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); RNA_boolean_set(otmacro->ptr, "release_confirm", TRUE); } diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 48e5f74ee85..96c348fb6e2 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -77,10 +77,10 @@ static void init_preview_region(const bContext *C, ARegion *ar) ar->alignment= RGN_ALIGN_TOP; ar->flag|= RGN_FLAG_HIDDEN; - ar->v2d.tot.xmin= 0.0f; - ar->v2d.tot.ymin= -10.0f; - ar->v2d.tot.xmax= (float)scene->r.efra; - ar->v2d.tot.ymax= 10.0f; + ar->v2d.tot.xmin = 0.0f; + ar->v2d.tot.ymin = -10.0f; + ar->v2d.tot.xmax = (float)scene->r.efra; + ar->v2d.tot.ymax = 10.0f; ar->v2d.cur= ar->v2d.tot; @@ -400,7 +400,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf) /* ******** Global hotkeys avalaible for all regions ******** */ - keymap= WM_keymap_find(keyconf, "Clip", SPACE_CLIP, 0); + keymap = WM_keymap_find(keyconf, "Clip", SPACE_CLIP, 0); WM_keymap_add_item(keymap, "CLIP_OT_open", OKEY, KM_PRESS, KM_ALT, 0); @@ -408,25 +408,25 @@ static void clip_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "CLIP_OT_properties", NKEY, KM_PRESS, 0, 0); /* 2d tracking */ - kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", LEFTARROWKEY, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_track_markers", LEFTARROWKEY, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "backwards", TRUE); RNA_boolean_set(kmi->ptr, "sequence", FALSE); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_track_markers", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "backwards", FALSE); RNA_boolean_set(kmi->ptr, "sequence", FALSE); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "backwards", FALSE); RNA_boolean_set(kmi->ptr, "sequence", TRUE); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_track_markers", TKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "backwards", TRUE); RNA_boolean_set(kmi->ptr, "sequence", TRUE); /* mode */ - kmi= WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", SC_MODE_RECONSTRUCTION); RNA_boolean_set(kmi->ptr, "toggle", TRUE); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "mode", SC_MODE_DISTORTION); RNA_boolean_set(kmi->ptr, "toggle", TRUE); @@ -439,7 +439,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf) /* ******** Hotkeys avalaible for main region only ******** */ - keymap= WM_keymap_find(keyconf, "Clip Editor", SPACE_CLIP, 0); + keymap = WM_keymap_find(keyconf, "Clip Editor", SPACE_CLIP, 0); /* ** View/navigation ** */ @@ -470,16 +470,16 @@ static void clip_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "CLIP_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0); /* jump to special frame */ - kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "position", 0); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "position", 1); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "position", 2); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "position", 3); /* "timeline" */ @@ -506,23 +506,23 @@ static void clip_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "CLIP_OT_slide_marker", LEFTMOUSE, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_disable_markers", DKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_disable_markers", DKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "action", 2); /* toggle */ /* tracks */ WM_keymap_add_item(keymap, "CLIP_OT_delete_track", DELKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "CLIP_OT_delete_track", XKEY, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "action", 0); /* lock */ - kmi= WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_lock_tracks", LKEY, KM_PRESS, KM_ALT, 0); RNA_enum_set(kmi->ptr, "action", 1); /* unlock */ - kmi= WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "unselected", FALSE); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks", HKEY, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "unselected", TRUE); WM_keymap_add_item(keymap, "CLIP_OT_hide_tracks_clear", HKEY, KM_PRESS, KM_ALT, 0); @@ -534,34 +534,34 @@ static void clip_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_menu(keymap, "CLIP_MT_tracking_specials", WKEY, KM_PRESS, 0, 0); /* display */ - kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.lock_selection"); - kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", DKEY, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", DKEY, KM_PRESS, KM_ALT, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.show_disabled"); - kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_ALT, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.show_marker_search"); - kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.use_mute_footage"); transform_keymap_for_space(keyconf, keymap, SPACE_CLIP); /* clean-up */ - kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT, 0); RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_REMAINED); RNA_boolean_set(kmi->ptr, "clear_active", FALSE); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_UPTO); RNA_boolean_set(kmi->ptr, "clear_active", FALSE); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_ALL); RNA_boolean_set(kmi->ptr, "clear_active", FALSE); /* ******** Hotkeys avalaible for preview region only ******** */ - keymap= WM_keymap_find(keyconf, "Clip Graph Editor", SPACE_CLIP, 0); + keymap = WM_keymap_find(keyconf, "Clip Graph Editor", SPACE_CLIP, 0); /* "timeline" */ WM_keymap_add_item(keymap, "CLIP_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0); @@ -590,22 +590,22 @@ static void clip_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "CLIP_OT_graph_view_all", HOMEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "CLIP_OT_graph_center_current_frame", PADPERIOD, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.lock_time_cursor"); /* clean-up */ - kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT, 0); RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_REMAINED); RNA_boolean_set(kmi->ptr, "clear_active", TRUE); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_UPTO); RNA_boolean_set(kmi->ptr, "clear_active", TRUE); - kmi= WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_clear_track_path", TKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "action", TRACK_CLEAR_ALL); RNA_boolean_set(kmi->ptr, "clear_active", TRUE); /* tracks */ - kmi= WM_keymap_add_item(keymap, "CLIP_OT_graph_disable_markers", DKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "CLIP_OT_graph_disable_markers", DKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "action", 2); /* toggle */ transform_keymap_for_space(keyconf, keymap, SPACE_CLIP); @@ -712,14 +712,14 @@ static void movieclip_main_area_set_view2d(SpaceClip *sc, ARegion *ar) winx= ar->winrct.xmax - ar->winrct.xmin + 1; winy= ar->winrct.ymax - ar->winrct.ymin + 1; - ar->v2d.tot.xmin= 0; - ar->v2d.tot.ymin= 0; - ar->v2d.tot.xmax= w; - ar->v2d.tot.ymax= h; + ar->v2d.tot.xmin = 0; + ar->v2d.tot.ymin = 0; + ar->v2d.tot.xmax = w; + ar->v2d.tot.ymax = h; - ar->v2d.mask.xmin= ar->v2d.mask.ymin= 0; - ar->v2d.mask.xmax= winx; - ar->v2d.mask.ymax= winy; + ar->v2d.mask.xmin = ar->v2d.mask.ymin = 0; + ar->v2d.mask.xmax = winx; + ar->v2d.mask.ymax = winy; /* which part of the image space do we see? */ x1= ar->winrct.xmin+(winx-sc->zoom*w)/2.0f; @@ -729,12 +729,12 @@ static void movieclip_main_area_set_view2d(SpaceClip *sc, ARegion *ar) y1-= sc->zoom*sc->yof; /* relative display right */ - ar->v2d.cur.xmin= ((ar->winrct.xmin - (float)x1)/sc->zoom); - ar->v2d.cur.xmax= ar->v2d.cur.xmin + ((float)winx/sc->zoom); + ar->v2d.cur.xmin = ((ar->winrct.xmin - (float)x1)/sc->zoom); + ar->v2d.cur.xmax = ar->v2d.cur.xmin + ((float)winx/sc->zoom); /* relative display left */ - ar->v2d.cur.ymin= ((ar->winrct.ymin-(float)y1)/sc->zoom); - ar->v2d.cur.ymax= ar->v2d.cur.ymin + ((float)winy/sc->zoom); + ar->v2d.cur.ymin = ((ar->winrct.ymin-(float)y1)/sc->zoom); + ar->v2d.cur.ymax = ar->v2d.cur.ymin + ((float)winy/sc->zoom); /* normalize 0.0..1.0 */ ar->v2d.cur.xmin /= w; @@ -751,10 +751,10 @@ static void clip_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); + keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm->defaultconf, "Clip Editor", SPACE_CLIP, 0); + keymap = WM_keymap_find(wm->defaultconf, "Clip Editor", SPACE_CLIP, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -825,10 +825,10 @@ static void clip_preview_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); + keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0); + keymap = WM_keymap_find(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -925,7 +925,7 @@ static void clip_properties_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); + keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index f69e964e045..f1ce73a8ab0 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -859,10 +859,10 @@ static int border_select_exec(bContext *C, wmOperator *op) int change= 0, mode, extend; /* get rectangle from operator */ - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); ED_clip_point_stable_pos(C, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin); ED_clip_point_stable_pos(C, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index 4855121a4de..a57b0e7e066 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -214,8 +214,8 @@ static int console_textview_main__internal(struct SpaceConsole *sc, struct ARegi tvc.sel_start= sc->sel_start; tvc.sel_end= sc->sel_end; tvc.lheight= sc->lheight; - tvc.ymin= v2d->cur.ymin; - tvc.ymax= v2d->cur.ymax; + tvc.ymin = v2d->cur.ymin; + tvc.ymax = v2d->cur.ymax; tvc.winx= ar->winx; console_scrollback_prompt_begin(sc, &cl_dummy); diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 66626fadff1..6000784b4b6 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -143,12 +143,12 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar) /* always keep the bottom part of the view aligned, less annoying */ if(prev_y_min != ar->v2d.cur.ymin) { const float cur_y_range= ar->v2d.cur.ymax - ar->v2d.cur.ymin; - ar->v2d.cur.ymin= prev_y_min; - ar->v2d.cur.ymax= prev_y_min + cur_y_range; + ar->v2d.cur.ymin = prev_y_min; + ar->v2d.cur.ymax = prev_y_min + cur_y_range; } /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Console", SPACE_CONSOLE, 0); + keymap = WM_keymap_find(wm->defaultconf, "Console", SPACE_CONSOLE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); /* add drop boxes */ @@ -260,7 +260,7 @@ static void console_operatortypes(void) static void console_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Console", SPACE_CONSOLE, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Console", SPACE_CONSOLE, 0); wmKeyMapItem *kmi; #ifdef __APPLE__ diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 983653d65db..1faa69d60e0 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -285,7 +285,7 @@ static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon, /*if (icon == ICON_FILE_BLANK) alpha = 0.375f;*/ - but= uiDefIconBut(block, LABEL, 0, icon, x, y, width, height, NULL, 0.0f, 0.0f, 0.0f, 0.0f, ""); + but = uiDefIconBut(block, LABEL, 0, icon, x, y, width, height, NULL, 0.0f, 0.0f, 0.0f, 0.0f, ""); uiButSetDragPath(but, path); } @@ -376,7 +376,7 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int } /* dragregion */ - but= uiDefBut(block, LABEL, 0, "", xco, yco, ex, ey, NULL, 0.0, 0.0, 0, 0, ""); + but = uiDefBut(block, LABEL, 0, "", xco, yco, ex, ey, NULL, 0.0, 0.0, 0, 0, ""); uiButSetDragImage(but, file->path, get_file_icon(file), imb, scale); glDisable(GL_BLEND); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index a15037430c2..269a3a8fa0d 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -242,10 +242,10 @@ static int file_border_select_modal(bContext *C, wmOperator *op, wmEvent *event) if(result==OPERATOR_RUNNING_MODAL) { - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); BLI_isect_rcti(&(ar->v2d.mask), &rect, &rect); @@ -275,10 +275,10 @@ static int file_border_select_exec(bContext *C, wmOperator *op) int extend= RNA_boolean_get(op->ptr, "extend"); short select= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); if(!extend) { SpaceFile *sfile= CTX_wm_space_file(C); diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index a7cb800e5a7..ca0e7646a85 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -116,7 +116,7 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat BLI_strncpy(dir, entry, FILE_MAX); /* create list item */ - but= uiDefIconTextButS(block, LISTROW, 0, icon, dir, 0,0,UI_UNIT_X*10,UI_UNIT_Y, nr, 0, i, 0, 0, entry); + but = uiDefIconTextButS(block, LISTROW, 0, icon, dir, 0,0,UI_UNIT_X*10,UI_UNIT_Y, nr, 0, i, 0, 0, entry); uiButSetFunc(but, file_panel_cb, entry, NULL); uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 9eafd4533d2..8d156aed6b7 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -272,10 +272,10 @@ static void file_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); /* own keymaps */ - keymap= WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0); + keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm->defaultconf, "File Browser Main", SPACE_FILE, 0); + keymap = WM_keymap_find(wm->defaultconf, "File Browser Main", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); @@ -335,7 +335,7 @@ static void file_main_area_draw(const bContext *C, ARegion *ar) /* view2d has no type specific for filewindow case, which doesnt scroll vertically */ if(v2d->cur.ymax < 0) { v2d->cur.ymin -= v2d->cur.ymax; - v2d->cur.ymax= 0; + v2d->cur.ymax = 0; } } /* v2d has initialized flag, so this call will only set the mask correct */ @@ -395,7 +395,7 @@ static void file_keymap(struct wmKeyConfig *keyconf) { wmKeyMapItem *kmi; /* keys for all areas */ - wmKeyMap *keymap= WM_keymap_find(keyconf, "File Browser", SPACE_FILE, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "File Browser", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_bookmark_toggle", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_bookmark_add", BKEY, KM_PRESS, KM_CTRL, 0); @@ -408,8 +408,8 @@ static void file_keymap(struct wmKeyConfig *keyconf) WM_keymap_verify_item(keymap, "FILE_OT_smoothscroll", TIMER1, KM_ANY, KM_ANY, 0); /* keys for main area */ - keymap= WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0); - kmi= WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0); + keymap = WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0); + kmi = WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0); RNA_boolean_set(kmi->ptr, "need_active", TRUE); WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, 0, 0); kmi = WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_CLICK, KM_SHIFT, 0); @@ -438,7 +438,7 @@ static void file_keymap(struct wmKeyConfig *keyconf) /* keys for button area (top) */ - keymap= WM_keymap_find(keyconf, "File Browser Buttons", SPACE_FILE, 0); + keymap = WM_keymap_find(keyconf, "File Browser Buttons", SPACE_FILE, 0); kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "increment", 1); kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_SHIFT, 0); @@ -461,7 +461,7 @@ static void file_channel_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); /* own keymaps */ - keymap= WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0); + keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -485,7 +485,7 @@ static void file_header_area_init(wmWindowManager *wm, ARegion *ar) ED_region_header_init(ar); - keymap= WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0); + keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -502,10 +502,10 @@ static void file_ui_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0); + keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0); + keymap = WM_keymap_find(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -518,8 +518,8 @@ static void file_ui_area_draw(const bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); /* scrolling here is just annoying, disable it */ - ar->v2d.cur.ymax= ar->v2d.cur.ymax - ar->v2d.cur.ymin; - ar->v2d.cur.ymin= 0; + ar->v2d.cur.ymax = ar->v2d.cur.ymax - ar->v2d.cur.ymin; + ar->v2d.cur.ymin = 0; /* set view2d view matrix for scrolling (without scrollers) */ UI_view2d_view_ortho(&ar->v2d); diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index c28711d1c22..51b29deab81 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -614,11 +614,11 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) /* general actions - management */ col= uiLayoutColumn(pa->layout, 0); block= uiLayoutGetBlock(col); - but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Update Dependencies"), 0, 0, 10*UI_UNIT_X, 22, + but = uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Update Dependencies"), 0, 0, 10*UI_UNIT_X, 22, NULL, 0.0, 0.0, 0, 0, TIP_("Force updates of dependencies")); uiButSetFunc(but, driver_update_flags_cb, fcu, NULL); - but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Remove Driver"), 0, 0, 10*UI_UNIT_X, 18, + but = uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Remove Driver"), 0, 0, 10*UI_UNIT_X, 18, NULL, 0.0, 0.0, 0, 0, TIP_("Remove this driver")); uiButSetNFunc(but, driver_remove_cb, MEM_dupallocN(ale), NULL); @@ -662,7 +662,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) /* add driver variables */ col= uiLayoutColumn(pa->layout, 0); block= uiLayoutGetBlock(col); - but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Add Variable"), 0, 0, 10*UI_UNIT_X, UI_UNIT_Y, + but = uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Add Variable"), 0, 0, 10*UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, TIP_("Add a new target variable for this Driver")); uiButSetFunc(but, driver_add_var_cb, driver, NULL); @@ -686,7 +686,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) /* remove button */ uiBlockSetEmboss(block, UI_EMBOSSN); - but= uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y, + but = uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, IFACE_("Delete target variable")); uiButSetFunc(but, driver_delete_var_cb, driver, dvar); uiBlockSetEmboss(block, UI_EMBOSS); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index de253839f5a..2887fa1c881 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -241,11 +241,11 @@ void ED_operatormacros_graph(void) wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - ot= WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); if (ot) { ot->description = "Make a copy of all selected keyframes and move them"; WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE); } } @@ -273,23 +273,23 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "curves", FALSE); RNA_boolean_set(kmi->ptr, "column", FALSE); - kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "curves", FALSE); RNA_boolean_set(kmi->ptr, "column", TRUE); - kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "curves", FALSE); RNA_boolean_set(kmi->ptr, "column", FALSE); - kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "curves", FALSE); RNA_boolean_set(kmi->ptr, "column", TRUE); - kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "curves", TRUE); RNA_boolean_set(kmi->ptr, "column", FALSE); - kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "curves", TRUE); RNA_boolean_set(kmi->ptr, "column", FALSE); @@ -298,14 +298,14 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_TEST); - kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_TEST); - kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_LEFT); - kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_RIGHT); @@ -406,7 +406,7 @@ void graphedit_keymap(wmKeyConfig *keyconf) wmKeyMap *keymap; /* keymap for all regions */ - keymap= WM_keymap_find(keyconf, "Graph Editor Generic", SPACE_IPO, 0); + keymap = WM_keymap_find(keyconf, "Graph Editor Generic", SPACE_IPO, 0); WM_keymap_add_item(keymap, "GRAPH_OT_properties", NKEY, KM_PRESS, 0, 0); /* extrapolation works on channels, not keys */ WM_keymap_add_item(keymap, "GRAPH_OT_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0); @@ -418,7 +418,7 @@ void graphedit_keymap(wmKeyConfig *keyconf) */ /* keyframes */ - keymap= WM_keymap_find(keyconf, "Graph Editor", SPACE_IPO, 0); + keymap = WM_keymap_find(keyconf, "Graph Editor", SPACE_IPO, 0); graphedit_keymap_keyframes(keyconf, keymap); } diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 64422aff076..864708a873a 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -316,10 +316,10 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op) incl_handles = RNA_boolean_get(op->ptr, "include_handles"); /* get settings from operator */ - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); /* selection 'mode' depends on whether borderselect region only matters on one axis */ if (RNA_boolean_get(op->ptr, "axis_range")) { diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 08f21a3f5aa..6294e0ecd25 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -142,10 +142,10 @@ static SpaceLink *graph_new(const bContext *C) BLI_addtail(&sipo->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; - ar->v2d.tot.xmin= 0.0f; - ar->v2d.tot.ymin= (float)scene->r.sfra - 10.0f; - ar->v2d.tot.xmax= (float)scene->r.efra; - ar->v2d.tot.ymax= 10.0f; + ar->v2d.tot.xmin = 0.0f; + ar->v2d.tot.ymin = (float)scene->r.sfra - 10.0f; + ar->v2d.tot.xmax = (float)scene->r.efra; + ar->v2d.tot.ymax = 10.0f; ar->v2d.cur= ar->v2d.tot; @@ -211,9 +211,9 @@ static void graph_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Graph Editor", SPACE_IPO, 0); + keymap = WM_keymap_find(wm->defaultconf, "Graph Editor", SPACE_IPO, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0); + keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -310,9 +310,9 @@ static void graph_channel_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0); + keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -362,7 +362,7 @@ static void graph_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0); + keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 209e87ae703..054d342ce4b 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -289,10 +289,10 @@ static void preview_cb(struct ScrArea *sa, struct uiBlock *block) areamouseco_to_ipoco(v2d, mval, &dispf.xmax, &dispf.ymax); /* map to render coordinates */ - disprect->xmin= dispf.xmin; - disprect->xmax= dispf.xmax; - disprect->ymin= dispf.ymin; - disprect->ymax= dispf.ymax; + disprect->xmin = dispf.xmin; + disprect->xmax = dispf.xmax; + disprect->ymin = dispf.ymin; + disprect->ymax = dispf.ymax; CLAMP(disprect->xmin, 0, winx); CLAMP(disprect->xmax, 0, winx); @@ -532,14 +532,14 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image /* menu buts */ if(render_slot) { strp= slot_menu(); - but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu1, UI_UNIT_Y, render_slot, 0,0,0,0, "Select Slot"); + but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu1, UI_UNIT_Y, render_slot, 0,0,0,0, "Select Slot"); uiButSetFunc(but, image_multi_cb, rr, iuser); MEM_freeN(strp); } if(rr) { strp= layer_menu(rr, &iuser->layer); - but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu2, UI_UNIT_Y, &iuser->layer, 0,0,0,0, "Select Layer"); + but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu2, UI_UNIT_Y, &iuser->layer, 0,0,0,0, "Select Layer"); uiButSetFunc(but, image_multi_cb, rr, iuser); MEM_freeN(strp); @@ -549,7 +549,7 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, RenderResult *rr, Image rl= BLI_findlink(&rr->layers, layer); /* return NULL is meant to be */ strp= pass_menu(rl, &iuser->pass); - but= uiDefButS(block, MENU, 0, strp, 0, 0, wmenu3, UI_UNIT_Y, &iuser->pass, 0,0,0,0, "Select Pass"); + but = uiDefButS(block, MENU, 0, strp, 0, 0, wmenu3, UI_UNIT_Y, &iuser->pass, 0,0,0,0, "Select Pass"); uiButSetFunc(but, image_multi_cb, rr, iuser); MEM_freeN(strp); } @@ -572,17 +572,17 @@ static void uiblock_layer_pass_arrow_buttons(uiLayout *layout, RenderResult *rr, } /* decrease, increase arrows */ - but= uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0,0,17,20, NULL, 0, 0, 0, 0, "Previous Layer"); + but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0,0,17,20, NULL, 0, 0, 0, 0, "Previous Layer"); uiButSetFunc(but, image_multi_declay_cb, rr, iuser); - but= uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0,0,18,20, NULL, 0, 0, 0, 0, "Next Layer"); + but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0,0,18,20, NULL, 0, 0, 0, 0, "Next Layer"); uiButSetFunc(but, image_multi_inclay_cb, rr, iuser); uiblock_layer_pass_buttons(row, rr, iuser, 230 * dpi_fac, render_slot); /* decrease, increase arrows */ - but= uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0,0,17,20, NULL, 0, 0, 0, 0, "Previous Pass"); + but = uiDefIconBut(block, BUT, 0, ICON_TRIA_LEFT, 0,0,17,20, NULL, 0, 0, 0, 0, "Previous Pass"); uiButSetFunc(but, image_multi_decpass_cb, rr, iuser); - but= uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0,0,18,20, NULL, 0, 0, 0, 0, "Next Pass"); + but = uiDefIconBut(block, BUT, 0, ICON_TRIA_RIGHT, 0,0,18,20, NULL, 0, 0, 0, 0, "Next Pass"); uiButSetFunc(but, image_multi_incpass_cb, rr, iuser); uiBlockEndAlign(block); @@ -677,7 +677,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char uiBlockBeginAlign(block); uiDefIconTextBut(block, BUT, B_SIMA_RECORD, ICON_REC, "Record", 10,120,100,20, 0, 0, 0, 0, 0, ""); uiDefIconTextBut(block, BUT, B_SIMA_PLAY, ICON_PLAY, "Play", 110,120,100,20, 0, 0, 0, 0, 0, ""); - but= uiDefBut(block, BUT, B_NOP, "Free Cache", 210,120,100,20, 0, 0, 0, 0, 0, ""); + but = uiDefBut(block, BUT, B_NOP, "Free Cache", 210,120,100,20, 0, 0, 0, 0, 0, ""); uiButSetFunc(but, image_freecache_cb, ima, NULL); if(iuser->frames) @@ -766,7 +766,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE); if(ima->anim) { block= uiLayoutGetBlock(col); - but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence"); + but = uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence"); uiButSetFunc(but, set_frames_cb, ima, iuser); } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 1af37a66022..5005e0de9c5 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -495,7 +495,7 @@ static void image_operatortypes(void) static void image_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Image Generic", SPACE_IMAGE, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Image Generic", SPACE_IMAGE, 0); wmKeyMapItem *kmi; WM_keymap_add_item(keymap, "IMAGE_OT_new", NKEY, KM_PRESS, KM_ALT, 0); @@ -509,7 +509,7 @@ static void image_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, 0, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, KM_ALT, 0)->ptr, "reverse", TRUE); - keymap= WM_keymap_find(keyconf, "Image", SPACE_IMAGE, 0); + keymap = WM_keymap_find(keyconf, "Image", SPACE_IMAGE, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0); @@ -540,7 +540,7 @@ static void image_keymap(struct wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "IMAGE_OT_curves_point_set", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "point", 1); /* toggle editmode is handy to have while UV unwrapping */ - kmi= WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT); RNA_boolean_set(kmi->ptr, "toggle", TRUE); } @@ -724,14 +724,14 @@ static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar) winx= ar->winrct.xmax - ar->winrct.xmin + 1; winy= ar->winrct.ymax - ar->winrct.ymin + 1; - ar->v2d.tot.xmin= 0; - ar->v2d.tot.ymin= 0; - ar->v2d.tot.xmax= w; - ar->v2d.tot.ymax= h; + ar->v2d.tot.xmin = 0; + ar->v2d.tot.ymin = 0; + ar->v2d.tot.xmax = w; + ar->v2d.tot.ymax = h; - ar->v2d.mask.xmin= ar->v2d.mask.ymin= 0; - ar->v2d.mask.xmax= winx; - ar->v2d.mask.ymax= winy; + ar->v2d.mask.xmin = ar->v2d.mask.ymin = 0; + ar->v2d.mask.xmax = winx; + ar->v2d.mask.ymax = winy; /* which part of the image space do we see? */ x1= ar->winrct.xmin+(winx-sima->zoom*w)/2.0f; @@ -741,12 +741,12 @@ static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar) y1-= sima->zoom*sima->yof; /* relative display right */ - ar->v2d.cur.xmin= ((ar->winrct.xmin - (float)x1)/sima->zoom); - ar->v2d.cur.xmax= ar->v2d.cur.xmin + ((float)winx/sima->zoom); + ar->v2d.cur.xmin = ((ar->winrct.xmin - (float)x1)/sima->zoom); + ar->v2d.cur.xmax = ar->v2d.cur.xmin + ((float)winx/sima->zoom); /* relative display left */ - ar->v2d.cur.ymin= ((ar->winrct.ymin-(float)y1)/sima->zoom); - ar->v2d.cur.ymax= ar->v2d.cur.ymin + ((float)winy/sima->zoom); + ar->v2d.cur.ymin = ((ar->winrct.ymin-(float)y1)/sima->zoom); + ar->v2d.cur.ymax = ar->v2d.cur.ymin + ((float)winy/sima->zoom); /* normalize 0.0..1.0 */ ar->v2d.cur.xmin /= w; @@ -764,19 +764,19 @@ static void image_main_area_init(wmWindowManager *wm, ARegion *ar) // UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); /* image paint polls for mode */ - keymap= WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm->defaultconf, "UV Editor", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "UV Editor", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "UV Sculpt", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "UV Sculpt", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* own keymaps */ - keymap= WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0); + keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Image", SPACE_IMAGE, 0); + keymap = WM_keymap_find(wm->defaultconf, "Image", SPACE_IMAGE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -851,7 +851,7 @@ static void image_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0); + keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -890,7 +890,7 @@ static void image_scope_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0); + keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c index d2be3bd2812..19bbc33e606 100644 --- a/source/blender/editors/space_info/info_draw.c +++ b/source/blender/editors/space_info/info_draw.c @@ -270,8 +270,8 @@ static int info_textview_main__internal(struct SpaceInfo *sinfo, struct ARegion tvc.sel_start= 0; tvc.sel_end= 0; tvc.lheight= 14; //sc->lheight; - tvc.ymin= v2d->cur.ymin; - tvc.ymax= v2d->cur.ymax; + tvc.ymin = v2d->cur.ymin; + tvc.ymax = v2d->cur.ymax; tvc.winx= ar->winx; ret= textview_draw(&tvc, draw, mval, mouse_pick, pos_pick); diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c index ca467ea61fa..17b1c3fa269 100644 --- a/source/blender/editors/space_info/info_report.c +++ b/source/blender/editors/space_info/info_report.c @@ -231,10 +231,10 @@ static int borderselect_exec(bContext *C, wmOperator *op) short selecting= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); //int mval[2]; - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); #if 0 mval[0]= rect.xmin; diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index b9ef57e6850..2d3eb68c84d 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -131,7 +131,7 @@ static void info_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Info", SPACE_INFO, 0); + keymap = WM_keymap_find(wm->defaultconf, "Info", SPACE_INFO, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -196,12 +196,12 @@ static void info_operatortypes(void) static void info_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Window", 0, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Window", 0, 0); WM_keymap_verify_item(keymap, "INFO_OT_reports_display_update", TIMERREPORT, KM_ANY, KM_ANY, 0); /* info space */ - keymap= WM_keymap_find(keyconf, "Info", SPACE_INFO, 0); + keymap = WM_keymap_find(keyconf, "Info", SPACE_INFO, 0); /* report selection */ diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index 177b72567e5..5b461d8a518 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -245,8 +245,8 @@ int textview_draw(TextViewContext *tvc, int draw, int mval[2], void **mouse_pick cdc.console_width= (tvc->winx - (CONSOLE_DRAW_SCROLL + CONSOLE_DRAW_MARGIN*2) ) / cdc.cwidth; CLAMP(cdc.console_width, 1, INT_MAX); /* avoid divide by zero on small windows */ cdc.winx= tvc->winx-(CONSOLE_DRAW_MARGIN+CONSOLE_DRAW_SCROLL); - cdc.ymin= tvc->ymin; - cdc.ymax= tvc->ymax; + cdc.ymin = tvc->ymin; + cdc.ymax = tvc->ymax; cdc.xy= xy; cdc.sel= sel; cdc.pos_pick= pos_pick; diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c index 0acb15874c7..4117e07063d 100644 --- a/source/blender/editors/space_logic/logic_buttons.c +++ b/source/blender/editors/space_logic/logic_buttons.c @@ -137,10 +137,10 @@ static int cut_links_intersect(uiLinkLine *line, float mcoords[][2], int tot) int i, b; rcti rectlink; - rectlink.xmin= (int) (line->from->x1 + line->from->x2) / 2; - rectlink.ymin= (int) (line->from->y1 + line->from->y2) / 2; - rectlink.xmax= (int) (line->to->x1 + line->to->x2) / 2; - rectlink.ymax= (int) (line->to->y1 + line->to->y2) / 2; + rectlink.xmin = (int) (line->from->x1 + line->from->x2) / 2; + rectlink.ymin = (int) (line->from->y1 + line->from->y2) / 2; + rectlink.xmax = (int) (line->to->x1 + line->to->x2) / 2; + rectlink.ymax = (int) (line->to->y1 + line->to->y2) / 2; if(ui_link_bezier_points(&rectlink, coord_array, LINK_RESOL)){ for(i=0; ilevel, 0.0, 0.0, 0, 0, "Level detector, trigger controllers of new states (only applicable upon logic state transition)"); uiButSetFunc(but, verify_logicbutton_func, sens, &(sens->level)); - but= uiDefButS(block, TOG, 1, "Tap", + but = uiDefButS(block, TOG, 1, "Tap", (short)(x + 10 + 0.702 * (w-20)), (short)(y - 21), (short)(0.12 * (w-20)), 19, &sens->tap, 0.0, 0.0, 0, 0, "Trigger controllers only for an instant, even while the sensor remains true"); @@ -1302,14 +1302,14 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short if ((ks->type&1)==0) { /* is All Keys option off? */ /* line 2: hotkey and allkeys toggle */ - but= uiDefKeyevtButS(block, 0, "", xco+40, yco-44, (width)/2, 19, &ks->key, "Key code"); + but = uiDefKeyevtButS(block, 0, "", xco+40, yco-44, (width)/2, 19, &ks->key, "Key code"); uiButSetFunc(but, test_keyboard_event, ks, NULL); /* line 3: two key modifyers (qual1, qual2) */ uiDefBut(block, LABEL, 0, "Hold", xco, yco-68, 40, 19, NULL, 0, 0, 0, 0, ""); - but= uiDefKeyevtButS(block, 0, "", xco+40, yco-68, (width-50)/2, 19, &ks->qual, "Modifier key code"); + but = uiDefKeyevtButS(block, 0, "", xco+40, yco-68, (width-50)/2, 19, &ks->qual, "Modifier key code"); uiButSetFunc(but, test_keyboard_event, ks, NULL); - but= uiDefKeyevtButS(block, 0, "", xco+40+(width-50)/2, yco-68, (width-50)/2, 19, &ks->qual2, "Second Modifier key code"); + but = uiDefKeyevtButS(block, 0, "", xco+40+(width-50)/2, yco-68, (width-50)/2, 19, &ks->qual2, "Second Modifier key code"); uiButSetFunc(but, test_keyboard_event, ks, NULL); } @@ -4627,7 +4627,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) /* put link button to the right */ col = uiLayoutColumn(subsplit, 0); uiLayoutSetAlignment(col, UI_LAYOUT_ALIGN_LEFT); - but= uiDefIconBut(block, LINK, 0, ICON_LINK, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + but = uiDefIconBut(block, LINK, 0, ICON_LINK, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR); } } @@ -4693,7 +4693,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) /* put link button to the right */ col = uiLayoutColumn(split, 0); /* use old-school uiButtons for links for now */ - but= uiDefIconBut(block, LINK, 0, ICON_LINK, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + but = uiDefIconBut(block, LINK, 0, ICON_LINK, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER); } } @@ -4927,7 +4927,7 @@ void logic_buttons(bContext *C, ARegion *ar) if(cont->flag & CONT_SHOW) { cont->otype= cont->type; uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, UI_UNIT_Y, &cont->type, 0, 0, 0, 0, "Controller type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, MAX_NAME, 0, 0, "Controller name"); + but = uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, MAX_NAME, 0, 0, "Controller name"); uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0); ycoo= yco; @@ -4937,22 +4937,22 @@ void logic_buttons(bContext *C, ARegion *ar) else { cpack(0x999999); glRecti(xco+22, yco, xco+width-22,yco+19); - but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller type"); + but = uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller type"); //uiButSetFunc(but, old_sca_move_controller, cont, NULL); - but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name"); + but = uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name"); //uiButSetFunc(but, old_sca_move_controller, cont, NULL); uiBlockBeginAlign(block); - but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(110+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); + but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(110+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); uiButSetFunc(but, old_sca_move_controller, cont, (void *)TRUE); - but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(88+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); + but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(88+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); uiButSetFunc(but, old_sca_move_controller, cont, (void *)FALSE); uiBlockEndAlign(block); ycoo= yco; } - but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + but = uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR); uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, cont, LINK_CONTROLLER, 0, 0, 0, ""); @@ -5018,7 +5018,7 @@ void logic_buttons(bContext *C, ARegion *ar) ycoo= yco; if (sens->flag & SENS_SHOW) { uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 80, UI_UNIT_Y, &sens->type, 0, 0, 0, 0, "Sensor type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, MAX_NAME, 0, 0, "Sensor name"); + but = uiDefBut(block, TEX, 1, "", (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens->name, 0, MAX_NAME, 0, 0, "Sensor name"); uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0); sens->otype= sens->type; @@ -5028,20 +5028,20 @@ void logic_buttons(bContext *C, ARegion *ar) else { set_col_sensor(sens->type, 1); glRecti(xco+22, yco, xco+width-22,yco+19); - but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, ""); + but = uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, ""); //uiButSetFunc(but, old_sca_move_sensor, sens, NULL); - but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, MAX_NAME, 0, 0, ""); + but = uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, MAX_NAME, 0, 0, ""); //uiButSetFunc(but, old_sca_move_sensor, sens, NULL); uiBlockBeginAlign(block); - but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); + but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); uiButSetFunc(but, old_sca_move_sensor, sens, (void *)TRUE); - but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); + but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); uiButSetFunc(but, old_sca_move_sensor, sens, (void *)FALSE); uiBlockEndAlign(block); } - but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + but = uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER); yco-=20; @@ -5096,7 +5096,7 @@ void logic_buttons(bContext *C, ARegion *ar) if(act->flag & ACT_SHOW) { act->otype= act->type; uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 90, UI_UNIT_Y, &act->type, 0, 0, 0, 0, "Actuator type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act->name, 0, MAX_NAME, 0, 0, "Actuator name"); + but = uiDefBut(block, TEX, 1, "", (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act->name, 0, MAX_NAME, 0, 0, "Actuator name"); uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0); ycoo= yco; @@ -5112,9 +5112,9 @@ void logic_buttons(bContext *C, ARegion *ar) // uiButSetFunc(but, old_sca_move_actuator, act, NULL); uiBlockBeginAlign(block); - but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); + but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); uiButSetFunc(but, old_sca_move_actuator, act, (void *)TRUE); - but= uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); + but = uiDefIconBut(block, BUT, B_REDR, ICON_TRIA_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); uiButSetFunc(but, old_sca_move_actuator, act, (void *)FALSE); uiBlockEndAlign(block); diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c index a9b1acbcc04..c58fd072887 100644 --- a/source/blender/editors/space_logic/space_logic.c +++ b/source/blender/editors/space_logic/space_logic.c @@ -119,15 +119,15 @@ static SpaceLink *logic_new(const bContext *UNUSED(C)) BLI_addtail(&slogic->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; - ar->v2d.tot.xmin= 0.0f; - ar->v2d.tot.ymin= 0.0f; - ar->v2d.tot.xmax= 1280; - ar->v2d.tot.ymax= 240.0f; + ar->v2d.tot.xmin = 0.0f; + ar->v2d.tot.ymin = 0.0f; + ar->v2d.tot.xmax = 1280; + ar->v2d.tot.ymax = 240.0f; - ar->v2d.cur.xmin= 0.0f; - ar->v2d.cur.ymin= 0.0f; - ar->v2d.cur.xmax= 1280.0f; - ar->v2d.cur.ymax= 240.0f; + ar->v2d.cur.xmin = 0.0f; + ar->v2d.cur.ymin = 0.0f; + ar->v2d.cur.xmax = 1280.0f; + ar->v2d.cur.ymax = 240.0f; ar->v2d.min[0]= 1.0f; ar->v2d.min[1]= 1.0f; @@ -178,7 +178,7 @@ static void logic_operatortypes(void) static void logic_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Logic Editor", SPACE_LOGIC, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Logic Editor", SPACE_LOGIC, 0); WM_keymap_add_item(keymap, "LOGIC_OT_properties", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "LOGIC_OT_links_cut", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); @@ -236,7 +236,7 @@ static void logic_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymaps */ - keymap= WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0); + keymap = WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -275,7 +275,7 @@ static void logic_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0); + keymap = WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index f94918e4b4a..0b8565b93a2 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -498,10 +498,10 @@ static void nla_draw_strip_text (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, * - padding of 2 'units' on either side */ // TODO: make this centered? - rect.xmin= strip->start + xofs; - rect.ymin= yminc; - rect.xmax= strip->end - xofs; - rect.ymax= ymaxc; + rect.xmin = strip->start + xofs; + rect.ymin = yminc; + rect.xmax = strip->end - xofs; + rect.ymax = ymaxc; /* add this string to the cache of texts to draw */ UI_view2d_text_cache_rectf(v2d, &rect, str, col); @@ -559,7 +559,7 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar) /* don't use totrect set, as the width stays the same * (NOTE: this is ok here, the configuration is pretty straightforward) */ - v2d->tot.ymin= (float)(-height); + v2d->tot.ymin = (float)(-height); /* loop through channels, and set up drawing depending on their type */ y= (float)(-NLACHANNEL_HEIGHT(snla)); @@ -946,7 +946,7 @@ void draw_nla_channel_list (bContext *C, bAnimContext *ac, ARegion *ar) /* don't use totrect set, as the width stays the same * (NOTE: this is ok here, the configuration is pretty straightforward) */ - v2d->tot.ymin= (float)(-height); + v2d->tot.ymin = (float)(-height); /* need to do a view-sync here, so that the keys area doesn't jump around (it must copy this) */ UI_view2d_sync(NULL, ac->sa, v2d, V2D_LOCK_COPY); diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 105419c91f3..d191f1d1d35 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -309,8 +309,8 @@ static int nlaedit_viewall(bContext *C, const short onlySel) v2d->cur.xmax += extra; /* set vertical range */ - v2d->cur.ymax= 0.0f; - v2d->cur.ymin= (float)-(v2d->mask.ymax - v2d->mask.ymin); + v2d->cur.ymax = 0.0f; + v2d->cur.ymin = (float)-(v2d->mask.ymax - v2d->mask.ymin); /* do View2D syncing */ UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 55831de876c..78fb92f2ee4 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -200,21 +200,21 @@ static void nla_keymap_main (wmKeyConfig *keyconf, wmKeyMap *keymap) /* click select */ kmi = WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); - kmi= WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "NLA_OT_click_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); /* select left/right */ kmi = WM_keymap_add_item(keymap, "NLA_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_TEST); - kmi= WM_keymap_add_item(keymap, "NLA_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "NLA_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_TEST); - kmi= WM_keymap_add_item(keymap, "NLA_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "NLA_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_LEFT); - kmi= WM_keymap_add_item(keymap, "NLA_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "NLA_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_enum_set(kmi->ptr, "mode", NLAEDIT_LRSEL_RIGHT); @@ -301,7 +301,7 @@ void nla_keymap(wmKeyConfig *keyconf) wmKeyMap *keymap; /* keymap for all regions */ - keymap= WM_keymap_find(keyconf, "NLA Generic", SPACE_NLA, 0); + keymap = WM_keymap_find(keyconf, "NLA Generic", SPACE_NLA, 0); WM_keymap_add_item(keymap, "NLA_OT_properties", NKEY, KM_PRESS, 0, 0); /* channels */ @@ -311,11 +311,11 @@ void nla_keymap(wmKeyConfig *keyconf) * * However, those operations which involve clicking on channels and/or the placement of them in the view are implemented here instead */ - keymap= WM_keymap_find(keyconf, "NLA Channels", SPACE_NLA, 0); + keymap = WM_keymap_find(keyconf, "NLA Channels", SPACE_NLA, 0); nla_keymap_channels(keymap); /* data */ - keymap= WM_keymap_find(keyconf, "NLA Editor", SPACE_NLA, 0); + keymap = WM_keymap_find(keyconf, "NLA Editor", SPACE_NLA, 0); nla_keymap_main(keyconf, keymap); } diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index fba0e5157a6..1434bd8ddc2 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -294,10 +294,10 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op) deselect_nla_strips(&ac, DESELECT_STRIPS_TEST, SELECT_SUBTRACT); /* get settings from operator */ - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); if (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT) selectmode = SELECT_ADD; diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 2f0d39c5f91..4d126984529 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -140,10 +140,10 @@ static SpaceLink *nla_new(const bContext *C) BLI_addtail(&snla->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; - ar->v2d.tot.xmin= (float)(SFRA-10); - ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f; - ar->v2d.tot.xmax= (float)(EFRA+10); - ar->v2d.tot.ymax= 0.0f; + ar->v2d.tot.xmin = (float)(SFRA-10); + ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f; + ar->v2d.tot.xmax = (float)(EFRA+10); + ar->v2d.tot.ymax = 0.0f; ar->v2d.cur = ar->v2d.tot; @@ -210,13 +210,13 @@ static void nla_channel_area_init(wmWindowManager *wm, ARegion *ar) /* own keymap */ /* own channels map first to override some channel keymaps */ - keymap= WM_keymap_find(wm->defaultconf, "NLA Channels", SPACE_NLA, 0); + keymap = WM_keymap_find(wm->defaultconf, "NLA Channels", SPACE_NLA, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); /* now generic channels map for everything else that can apply */ - keymap= WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0); + keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -256,9 +256,9 @@ static void nla_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "NLA Editor", SPACE_NLA, 0); + keymap = WM_keymap_find(wm->defaultconf, "NLA Editor", SPACE_NLA, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0); + keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -336,7 +336,7 @@ static void nla_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0); + keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 4660b7703d8..b76eb6a4879 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -512,15 +512,15 @@ static int node_resize_area_default(bNode *node, int x, int y) if (node->flag & NODE_HIDDEN) { rctf totr= node->totr; /* right part of node */ - totr.xmin= node->totr.xmax-20.0f; + totr.xmin = node->totr.xmax-20.0f; return BLI_in_rctf(&totr, x, y); } else { /* rect we're interested in is just the bottom right corner */ rctf totr= node->totr; /* bottom right corner */ - totr.xmin= totr.xmax-10.0f; - totr.ymax= totr.ymin+10.0f; + totr.xmin = totr.xmax-10.0f; + totr.ymax = totr.ymin+10.0f; return BLI_in_rctf(&totr, x, y); } } @@ -952,13 +952,13 @@ static void node_update_frame(const bContext *UNUSED(C), bNodeTree *UNUSED(ntree /* get "global" coords */ nodeSpaceCoords(node, &locx, &locy); - node->prvr.xmin= locx + NODE_DYS; - node->prvr.xmax= locx + node->width- NODE_DYS; + node->prvr.xmin = locx + NODE_DYS; + node->prvr.xmax = locx + node->width- NODE_DYS; - node->totr.xmin= locx; - node->totr.xmax= locx + node->width; - node->totr.ymax= locy; - node->totr.ymin= locy - node->height; + node->totr.xmin = locx; + node->totr.xmax = locx + node->width; + node->totr.ymax = locy; + node->totr.ymin = locy - node->height; } static void node_common_set_butfunc(bNodeType *ntype) diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 3d5dc454768..8cb2aea953e 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -242,8 +242,8 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node) } } - node->prvr.xmin= locx + NODE_DYS; - node->prvr.xmax= locx + node->width- NODE_DYS; + node->prvr.xmin = locx + NODE_DYS; + node->prvr.xmax = locx + node->width- NODE_DYS; /* preview rect? */ if(node->flag & NODE_PREVIEW) { @@ -257,14 +257,14 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node) aspect= (float)node->preview->ysize/(float)node->preview->xsize; dy-= NODE_DYS/2; - node->prvr.ymax= dy; + node->prvr.ymax = dy; if(aspect <= 1.0f) - node->prvr.ymin= dy - aspect*(node->width-NODE_DY); + node->prvr.ymin = dy - aspect*(node->width-NODE_DY); else { float dx= (node->width - NODE_DYS) - (node->width- NODE_DYS)/aspect; /* width correction of image */ - node->prvr.ymin= dy - (node->width-NODE_DY); + node->prvr.ymin = dy - (node->width-NODE_DY); node->prvr.xmin+= 0.5f*dx; node->prvr.xmax-= 0.5f*dx; @@ -281,8 +281,8 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node) if(oldh==0.0f) oldh= 0.6f*node->width-NODE_DY; dy-= NODE_DYS/2; - node->prvr.ymax= dy; - node->prvr.ymin= dy - oldh; + node->prvr.ymax = dy; + node->prvr.ymin = dy - oldh; dy= node->prvr.ymin - NODE_DYS/2; } @@ -294,10 +294,10 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node) dy-= NODE_DYS/2; /* set this for uifunc() that don't use layout engine yet */ - node->butr.xmin= 0; - node->butr.xmax= node->width - 2*NODE_DYS; - node->butr.ymin= 0; - node->butr.ymax= 0; + node->butr.xmin = 0; + node->butr.xmax = node->width - 2*NODE_DYS; + node->butr.ymin = 0; + node->butr.ymax = 0; RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr); @@ -325,10 +325,10 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node) if(node->inputs.first || (node->flag & (NODE_OPTIONS|NODE_PREVIEW))==0 ) dy-= NODE_DYS/2; - node->totr.xmin= locx; - node->totr.xmax= locx + node->width; - node->totr.ymax= locy; - node->totr.ymin= MIN2(dy, locy-2*NODE_DY); + node->totr.xmin = locx; + node->totr.xmax = locx + node->width; + node->totr.ymax = locy; + node->totr.ymin = MIN2(dy, locy-2*NODE_DY); /* Set the block bounds to clip mouse events from underlying nodes. * Add a margin for sockets on each side. @@ -364,10 +364,10 @@ static void node_update_hidden(bNode *node) hiddenrad += 5.0f*(float)(tot-4); } - node->totr.xmin= locx; - node->totr.xmax= locx + 3*hiddenrad + node->miniwidth; - node->totr.ymax= locy + (hiddenrad - 0.5f*NODE_DY); - node->totr.ymin= node->totr.ymax - 2*hiddenrad; + node->totr.xmin = locx; + node->totr.xmax = locx + 3*hiddenrad + node->miniwidth; + node->totr.ymax = locy + (hiddenrad - 0.5f*NODE_DY); + node->totr.ymin = node->totr.ymax - 2*hiddenrad; /* output sockets */ rad=drad= (float)M_PI/(1.0f + (float)totout); diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 93263a2e54b..e1493b5b1a5 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -110,24 +110,24 @@ void ED_operatormacros_node(void) wmOperatorType *ot; wmOperatorTypeMacro *mot; - ot= WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Duplicate selected nodes and move them"; WM_operatortype_macro_define(ot, "NODE_OT_duplicate"); WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); /* modified operator call for duplicating with input links */ - ot= WM_operatortype_append_macro("NODE_OT_duplicate_move_keep_inputs", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("NODE_OT_duplicate_move_keep_inputs", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Duplicate selected nodes keeping input links and move them"; mot = WM_operatortype_macro_define(ot, "NODE_OT_duplicate"); RNA_boolean_set(mot->ptr, "keep_inputs", TRUE); WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - ot= WM_operatortype_append_macro("NODE_OT_select_link_viewer", "Link Viewer", OPTYPE_UNDO); + ot = WM_operatortype_append_macro("NODE_OT_select_link_viewer", "Link Viewer", OPTYPE_UNDO); ot->description = "Select node and link it to a viewer node"; WM_operatortype_macro_define(ot, "NODE_OT_select"); WM_operatortype_macro_define(ot, "NODE_OT_link_viewer"); - ot= WM_operatortype_append_macro("NODE_OT_move_detach_links", "Detach", OPTYPE_UNDO|OPTYPE_REGISTER); + ot = WM_operatortype_append_macro("NODE_OT_move_detach_links", "Detach", OPTYPE_UNDO|OPTYPE_REGISTER); ot->description = "Move a node to detach links"; WM_operatortype_macro_define(ot, "NODE_OT_links_detach"); mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); @@ -140,12 +140,12 @@ void node_keymap(struct wmKeyConfig *keyconf) wmKeyMapItem *kmi; /* Entire Editor only ----------------- */ - keymap= WM_keymap_find(keyconf, "Node Generic", SPACE_NODE, 0); + keymap = WM_keymap_find(keyconf, "Node Generic", SPACE_NODE, 0); WM_keymap_add_item(keymap, "NODE_OT_properties", NKEY, KM_PRESS, 0, 0); /* Main Area only ----------------- */ - keymap= WM_keymap_find(keyconf, "Node Editor", SPACE_NODE, 0); + keymap = WM_keymap_find(keyconf, "Node Editor", SPACE_NODE, 0); /* mouse select in nodes used to be both keys, but perhaps this should be reduced? * NOTE: mouse-clicks on left-mouse will fall through to allow transform-tweak, but also link/resize @@ -170,9 +170,9 @@ void node_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "NODE_OT_select_link_viewer", LEFTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); WM_keymap_add_item(keymap, "NODE_OT_backimage_move", MIDDLEMOUSE, KM_PRESS, KM_ALT, 0); - kmi= WM_keymap_add_item(keymap, "NODE_OT_backimage_zoom", VKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "NODE_OT_backimage_zoom", VKEY, KM_PRESS, 0, 0); RNA_float_set(kmi->ptr, "factor", 0.83333f); - kmi= WM_keymap_add_item(keymap, "NODE_OT_backimage_zoom", VKEY, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "NODE_OT_backimage_zoom", VKEY, KM_PRESS, KM_ALT, 0); RNA_float_set(kmi->ptr, "factor", 1.2f); WM_keymap_add_item(keymap, "NODE_OT_backimage_sample", ACTIONMOUSE, KM_PRESS, KM_ALT, 0); diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 9c77cbb86cc..da8fa577656 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -553,12 +553,12 @@ static int node_borderselect_exec(bContext *C, wmOperator *op) int gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); int extend= RNA_boolean_get(op->ptr, "extend"); - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); for(node= snode->edittree->nodes.first; node; node= node->next) { diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c index a9260e80e94..2ab24141c7d 100644 --- a/source/blender/editors/space_node/node_state.c +++ b/source/blender/editors/space_node/node_state.c @@ -67,7 +67,7 @@ static void snode_home(ScrArea *UNUSED(sa), ARegion *ar, SpaceNode* snode) oldwidth= cur->xmax - cur->xmin; oldheight= cur->ymax - cur->ymin; - cur->xmin= cur->ymin= 0.0f; + cur->xmin = cur->ymin = 0.0f; cur->xmax=ar->winx; cur->ymax=ar->winy; @@ -91,14 +91,14 @@ static void snode_home(ScrArea *UNUSED(sa), ARegion *ar, SpaceNode* snode) if(width > height) { float newheight; newheight= oldheight * width/oldwidth; - cur->ymin= cur->ymin - newheight/4; - cur->ymax= cur->ymax + newheight/4; + cur->ymin = cur->ymin - newheight/4; + cur->ymax = cur->ymax + newheight/4; } else { float newwidth; newwidth= oldwidth * height/oldheight; - cur->xmin= cur->xmin - newwidth/4; - cur->xmax= cur->xmax + newwidth/4; + cur->xmin = cur->xmin - newwidth/4; + cur->xmax = cur->xmax + newwidth/4; } ar->v2d.tot= ar->v2d.cur; diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index c0d366a3ed3..298867c18af 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -509,10 +509,10 @@ void uiTemplateNodeLink(uiLayout *layout, bNodeTree *ntree, bNode *node, bNodeSo if(sock->link || sock->type == SOCK_SHADER || (sock->flag & SOCK_HIDE_VALUE)) { char name[UI_MAX_NAME_STR]; ui_node_sock_name(sock, name); - but= uiDefMenuBut(block, ui_template_node_link_menu, NULL, name, 0, 0, UI_UNIT_X*4, UI_UNIT_Y, ""); + but = uiDefMenuBut(block, ui_template_node_link_menu, NULL, name, 0, 0, UI_UNIT_X*4, UI_UNIT_Y, ""); } else - but= uiDefIconMenuBut(block, ui_template_node_link_menu, NULL, ICON_NONE, 0, 0, UI_UNIT_X, UI_UNIT_Y, ""); + but = uiDefIconMenuBut(block, ui_template_node_link_menu, NULL, ICON_NONE, 0, 0, UI_UNIT_X, UI_UNIT_Y, ""); but->type= MENU; but->flag |= UI_TEXT_LEFT|UI_BUT_NODE_LINK; diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 93d3b22e092..fc5965535b1 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -125,15 +125,15 @@ static SpaceLink *node_new(const bContext *UNUSED(C)) BLI_addtail(&snode->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; - ar->v2d.tot.xmin= -256.0f; - ar->v2d.tot.ymin= -256.0f; - ar->v2d.tot.xmax= 768.0f; - ar->v2d.tot.ymax= 768.0f; + ar->v2d.tot.xmin = -256.0f; + ar->v2d.tot.ymin = -256.0f; + ar->v2d.tot.xmax = 768.0f; + ar->v2d.tot.ymax = 768.0f; - ar->v2d.cur.xmin= -256.0f; - ar->v2d.cur.ymin= -256.0f; - ar->v2d.cur.xmax= 768.0f; - ar->v2d.cur.ymax= 768.0f; + ar->v2d.cur.xmin = -256.0f; + ar->v2d.cur.ymin = -256.0f; + ar->v2d.cur.xmax = 768.0f; + ar->v2d.cur.ymax = 768.0f; ar->v2d.min[0]= 1.0f; ar->v2d.min[1]= 1.0f; @@ -330,7 +330,7 @@ static void node_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0); + keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -348,10 +348,10 @@ static void node_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymaps */ - keymap= WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0); + keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Node Editor", SPACE_NODE, 0); + keymap = WM_keymap_find(wm->defaultconf, "Node Editor", SPACE_NODE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); /* add drop boxes */ diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 12b93e17f9f..5cc09bf7d97 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -584,7 +584,7 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa static void operator_call_cb(struct bContext *UNUSED(C), void *arg_kmi, void *arg2) { wmOperatorType *ot= arg2; - wmKeyMapItem *kmi= arg_kmi; + wmKeyMapItem *kmi = arg_kmi; if(ot) BLI_strncpy(kmi->idname, ot->idname, OP_MAX_TYPENAME); @@ -616,7 +616,7 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi) static char search[OP_MAX_TYPENAME]; wmEvent event; wmWindow *win= CTX_wm_window(C); - wmKeyMapItem *kmi= arg_kmi; + wmKeyMapItem *kmi = arg_kmi; wmOperatorType *ot= WM_operatortype_find(kmi->idname, 0); uiBlock *block; uiBut *but; @@ -630,7 +630,7 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi) /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, UI_UNIT_Y, 0, 0, ""); + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, UI_UNIT_Y, 0, 0, ""); uiButSetSearchFunc(but, operator_search_cb, arg_kmi, operator_call_cb, ot); uiBoundsBlock(block, 6); @@ -735,7 +735,7 @@ static const char *keymap_tweak_dir_menu(void) static void keymap_type_cb(bContext *C, void *kmi_v, void *UNUSED(arg_v)) { - wmKeyMapItem *kmi= kmi_v; + wmKeyMapItem *kmi = kmi_v; short maptype= keymap_menu_type(kmi->type); if(maptype!=kmi->maptype) { @@ -778,7 +778,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo int butw3= 43; /* modifiers */ if(tselem->type == TSE_KEYMAP_ITEM) { - wmKeyMapItem *kmi= te->directdata; + wmKeyMapItem *kmi = te->directdata; /* modal map? */ if(kmi->propvalue); @@ -791,7 +791,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo kmi->maptype= keymap_menu_type(kmi->type); str= keymap_type_menu(); - but= uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, UI_UNIT_Y-1, &kmi->maptype, 0, 0, 0, 0, "Event type"); + but = uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, UI_UNIT_Y-1, &kmi->maptype, 0, 0, 0, 0, "Event type"); uiButSetFunc(but, keymap_type_cb, kmi, NULL); xstart+= butw2+5; @@ -902,7 +902,7 @@ static void tselem_draw_icon_uibut(struct DrawIconArg *arg, int icon) } else { /* XXX investigate: button placement of icons is way different than UI_icon_draw? */ float ufac= UI_UNIT_X/20.0f; - uiBut *but= uiDefIconBut(arg->block, LABEL, 0, icon, arg->x-3.0f*ufac, arg->y, UI_UNIT_X-4.0f*ufac, UI_UNIT_Y-4.0f*ufac, NULL, 0.0, 0.0, 1.0, arg->alpha, (arg->id && arg->id->lib) ? arg->id->lib->name : ""); + uiBut *but = uiDefIconBut(arg->block, LABEL, 0, icon, arg->x-3.0f*ufac, arg->y, UI_UNIT_X-4.0f*ufac, UI_UNIT_Y-4.0f*ufac, NULL, 0.0, 0.0, 1.0, arg->alpha, (arg->id && arg->id->lib) ? arg->id->lib->name : ""); if(arg->id) uiButSetDragID(but, arg->id); @@ -917,7 +917,7 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto /* make function calls a bit compacter */ arg.block= block; arg.id= tselem->id; - arg.xmax= xmax; + arg.xmax = xmax; arg.x= x; arg.y= y; arg.alpha= alpha; diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 27f0231ad05..cdd566f6da9 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -612,8 +612,8 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) ytop= (int)(te->ys + (v2d->mask.ymax - v2d->mask.ymin)/2); if (ytop>0) ytop= 0; - v2d->cur.ymax= (float)ytop; - v2d->cur.ymin= (float)(ytop-(v2d->mask.ymax - v2d->mask.ymin)); + v2d->cur.ymax = (float)ytop; + v2d->cur.ymin = (float)(ytop-(v2d->mask.ymax - v2d->mask.ymin)); /* make te->xs ==> te->xend center of view */ xdelta = (int)(te->xs - v2d->cur.xmin); @@ -791,8 +791,8 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so /* make te->ys center of view */ ytop= (int)(te->ys + (ar->v2d.mask.ymax-ar->v2d.mask.ymin)/2); if(ytop>0) ytop= 0; - ar->v2d.cur.ymax= (float)ytop; - ar->v2d.cur.ymin= (float)(ytop-(ar->v2d.mask.ymax-ar->v2d.mask.ymin)); + ar->v2d.cur.ymax = (float)ytop; + ar->v2d.cur.ymin = (float)(ytop-(ar->v2d.mask.ymax-ar->v2d.mask.ymin)); /* make te->xs ==> te->xend center of view */ xdelta = (int)(te->xs - ar->v2d.cur.xmin); diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c index 17434d0f6c9..d2ef4573ccf 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -84,7 +84,7 @@ void outliner_operatortypes(void) void outliner_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0); wmKeyMapItem *kmi; WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_DBL_CLICK, 0, 0); diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index ef9077d09ed..8270d26d974 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -644,7 +644,7 @@ static int tree_element_active_sequence_dup(Scene *scene, TreeElement *te, TreeS static int tree_element_active_keymap_item(bContext *UNUSED(C), TreeElement *te, TreeStoreElem *UNUSED(tselem), int set) { - wmKeyMapItem *kmi= te->directdata; + wmKeyMapItem *kmi = te->directdata; if(set==0) { if(kmi->flag & KMI_INACTIVE) return 0; @@ -909,12 +909,12 @@ static int outliner_border_select_exec(bContext *C, wmOperator *op) rctf rectf; int gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); for(te= soops->tree.first; te; te= te->next) { diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index d8a9e75ebc6..b702bea5168 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1075,7 +1075,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i if(TSELEM_OPEN(tselem,soops)) { a= 0; - for (kmi= km->items.first; kmi; kmi= kmi->next, a++) { + for (kmi = km->items.first; kmi; kmi = kmi->next, a++) { const char *key= WM_key_event_string(kmi->type); if(key[0]) { diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index ebbe28e62fa..d55fe40653e 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -66,7 +66,7 @@ static void outliner_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Outliner", SPACE_OUTLINER, 0); + keymap = WM_keymap_find(wm->defaultconf, "Outliner", SPACE_OUTLINER, 0); /* don't pass on view2d mask, it's always set with scrollbar space, hide fails */ WM_event_add_keymap_handler_bb(&ar->handlers, keymap, NULL, &ar->winrct); diff --git a/source/blender/editors/space_script/script_ops.c b/source/blender/editors/space_script/script_ops.c index 3ae89eefda3..0c99d9b34c4 100644 --- a/source/blender/editors/space_script/script_ops.c +++ b/source/blender/editors/space_script/script_ops.c @@ -60,7 +60,7 @@ void script_operatortypes(void) void script_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Script", SPACE_SCRIPT, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Script", SPACE_SCRIPT, 0); /* TODO - this is just while we have no way to load a text datablock */ RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_python_file_run", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0)->ptr, "filepath", "test.py"); diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index dbda276b20c..bad9a01fbcf 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -135,7 +135,7 @@ static void script_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Script", SPACE_SCRIPT, 0); + keymap = WM_keymap_find(wm->defaultconf, "Script", SPACE_SCRIPT, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index d0659cfc01d..3adae356706 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -582,10 +582,10 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float } col[3]= 255; - rect.xmin= x1; - rect.ymin= y1; - rect.xmax= x2; - rect.ymax= y2; + rect.xmin = x1; + rect.ymin = y1; + rect.xmax = x2; + rect.ymax = y2; UI_view2d_text_cache_rectf(v2d, &rect, str, col); } @@ -883,10 +883,10 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq if(frame_ofs) { rctf tot_clip; - tot_clip.xmin= v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmin); - tot_clip.ymin= v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymin); - tot_clip.xmax= v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmax); - tot_clip.ymax= v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymax); + tot_clip.xmin = v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmin); + tot_clip.ymin = v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymin); + tot_clip.xmax = v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmax); + tot_clip.ymax = v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymax); glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymin);glVertex2f(tot_clip.xmin, tot_clip.ymin); glTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymax);glVertex2f(tot_clip.xmin, tot_clip.ymax); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 8d04edd0c7f..7fc807cf17f 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -223,12 +223,12 @@ static void seq_proxy_build_job(const bContext *C) void seq_rectf(Sequence *seq, rctf *rectf) { - if(seq->startstill) rectf->xmin= seq->start; - else rectf->xmin= seq->startdisp; - rectf->ymin= seq->machine+SEQ_STRIP_OFSBOTTOM; - if(seq->endstill) rectf->xmax= seq->start+seq->len; - else rectf->xmax= seq->enddisp; - rectf->ymax= seq->machine+SEQ_STRIP_OFSTOP; + if(seq->startstill) rectf->xmin = seq->start; + else rectf->xmin = seq->startdisp; + rectf->ymin = seq->machine+SEQ_STRIP_OFSBOTTOM; + if(seq->endstill) rectf->xmax = seq->start+seq->len; + else rectf->xmax = seq->enddisp; + rectf->ymax = seq->machine+SEQ_STRIP_OFSTOP; } static void UNUSED_FUNCTION(change_plugin_seq)(Scene *scene, char *str) /* called from fileselect */ @@ -276,10 +276,10 @@ void boundbox_seq(Scene *scene, rctf *rect) seq= seq->next; } - rect->xmin= min[0]; - rect->xmax= max[0]; - rect->ymin= min[1]; - rect->ymax= max[1]; + rect->xmin = min[0]; + rect->xmax = max[0]; + rect->ymin = min[1]; + rect->ymax = max[1]; } @@ -2223,18 +2223,18 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op)) orig_height= v2d->cur.ymax - v2d->cur.ymin; - v2d->cur.xmin= xmin; - v2d->cur.xmax= xmax; + v2d->cur.xmin = xmin; + v2d->cur.xmax = xmax; - v2d->cur.ymin= ymin; - v2d->cur.ymax= ymax; + v2d->cur.ymin = ymin; + v2d->cur.ymax = ymax; /* only zoom out vertically */ if (orig_height > v2d->cur.ymax - v2d->cur.ymin) { ymid= (v2d->cur.ymax + v2d->cur.ymin) / 2; - v2d->cur.ymin= ymid - (orig_height/2); - v2d->cur.ymax= ymid + (orig_height/2); + v2d->cur.ymin = ymid - (orig_height/2); + v2d->cur.ymax = ymid + (orig_height/2); } UI_view2d_curRect_validate(v2d); diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index 88b9c61a033..2e24a8be346 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -126,14 +126,14 @@ void sequencer_keymap(wmKeyConfig *keyconf) /* Common items ------------------------------------------------------------------ */ keymap = WM_keymap_find(keyconf, "SequencerCommon", SPACE_SEQ, 0); - kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, KM_SHIFT, 0); RNA_string_set(kmi->ptr, "data_path", "scene.sequence_editor.show_overlay"); /* operators common to sequence and preview view */ WM_keymap_add_item(keymap, "SEQUENCER_OT_view_toggle", TABKEY, KM_PRESS, KM_CTRL, 0); /* Strips Region --------------------------------------------------------------- */ - keymap= WM_keymap_find(keyconf, "Sequencer", SPACE_SEQ, 0); + keymap = WM_keymap_find(keyconf, "Sequencer", SPACE_SEQ, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0); @@ -224,20 +224,20 @@ void sequencer_keymap(wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "linked_right", TRUE); - kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0); RNA_boolean_set(kmi->ptr, "linked_left", TRUE); RNA_boolean_set(kmi->ptr, "linked_right", TRUE); - kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL|KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL|KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "linked_left", TRUE); RNA_boolean_set(kmi->ptr, "linked_right", TRUE); - kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "linked_left", TRUE); - kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "linked_right", TRUE); #endif @@ -249,21 +249,21 @@ void sequencer_keymap(wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "left_right", FALSE); RNA_boolean_set(kmi->ptr, "linked_time", FALSE); - kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "linked_handle", TRUE); RNA_boolean_set(kmi->ptr, "left_right", FALSE); RNA_boolean_set(kmi->ptr, "linked_time", FALSE); /* match action editor */ - kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "linked_handle", FALSE); RNA_boolean_set(kmi->ptr, "left_right", TRUE); /* grr, these conflict - only use left_right if not over an active seq */ RNA_boolean_set(kmi->ptr, "linked_time", TRUE); /* adjusted since 2.4 */ - kmi= WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", TRUE); RNA_boolean_set(kmi->ptr, "linked_handle", FALSE); RNA_boolean_set(kmi->ptr, "left_right", FALSE); @@ -287,7 +287,7 @@ void sequencer_keymap(wmKeyConfig *keyconf) WM_keymap_add_menu(keymap, "SEQUENCER_MT_change", CKEY, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", OKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", OKEY, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", "scene.sequence_editor.overlay_frame"); RNA_int_set(kmi->ptr, "value", 0); @@ -298,7 +298,7 @@ void sequencer_keymap(wmKeyConfig *keyconf) /* Preview Region ----------------------------------------------------------- */ - keymap= WM_keymap_find(keyconf, "SequencerPreview", SPACE_SEQ, 0); + keymap = WM_keymap_find(keyconf, "SequencerPreview", SPACE_SEQ, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_view_all_preview", HOMEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index f97e36131fb..e93eb0e0a0e 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -848,10 +848,10 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op) if(ed==NULL) return OPERATOR_CANCELLED; - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); mval[0]= rect.xmin; mval[1]= rect.ymin; diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index e3e362c53a8..dd4315e6651 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -134,10 +134,10 @@ static SpaceLink *sequencer_new(const bContext *C) ar->v2d.keepzoom= V2D_KEEPASPECT | V2D_KEEPZOOM; ar->v2d.minzoom= 0.00001f; ar->v2d.maxzoom= 100000.0f; - ar->v2d.tot.xmin= -960.0f; /* 1920 width centered */ - ar->v2d.tot.ymin= -540.0f; /* 1080 height centered */ - ar->v2d.tot.xmax= 960.0f; - ar->v2d.tot.ymax= 540.0f; + ar->v2d.tot.xmin = -960.0f; /* 1920 width centered */ + ar->v2d.tot.ymin = -540.0f; /* 1080 height centered */ + ar->v2d.tot.xmax = 960.0f; + ar->v2d.tot.ymax = 540.0f; ar->v2d.min[0]= 0.0f; ar->v2d.min[1]= 0.0f; ar->v2d.max[0]= 12000.0f; @@ -156,10 +156,10 @@ static SpaceLink *sequencer_new(const bContext *C) /* seq space goes from (0,8) to (0, efra) */ - ar->v2d.tot.xmin= 0.0f; - ar->v2d.tot.ymin= 0.0f; - ar->v2d.tot.xmax= scene->r.efra; - ar->v2d.tot.ymax= 8.0f; + ar->v2d.tot.xmin = 0.0f; + ar->v2d.tot.ymin = 0.0f; + ar->v2d.tot.xmax = scene->r.efra; + ar->v2d.tot.ymax = 8.0f; ar->v2d.cur= ar->v2d.tot; @@ -300,11 +300,11 @@ static void sequencer_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); - keymap= WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0); + keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Sequencer", SPACE_SEQ, 0); + keymap = WM_keymap_find(wm->defaultconf, "Sequencer", SPACE_SEQ, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); /* add drop boxes */ @@ -424,11 +424,11 @@ static void sequencer_preview_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); - keymap= WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0); + keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0); + keymap = WM_keymap_find(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index a416e9cf973..d06a8139b6f 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -235,7 +235,7 @@ static void text_keymap(struct wmKeyConfig *keyconf) wmKeyMap *keymap; wmKeyMapItem *kmi; - keymap= WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0); + keymap = WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0); #ifdef __APPLE__ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); @@ -411,7 +411,7 @@ static void text_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Text", SPACE_TEXT, 0); + keymap = WM_keymap_find(wm->defaultconf, "Text", SPACE_TEXT, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); /* add drop boxes */ diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 1c8ff4639cf..20f2654971b 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1103,15 +1103,15 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back) blank_lines = st->viewlines / 2; /* nicer code: use scroll rect for entire bar */ - back->xmin= ar->winx -18; - back->xmax= ar->winx; - back->ymin= 0; - back->ymax= ar->winy; + back->xmin = ar->winx -18; + back->xmax = ar->winx; + back->ymin = 0; + back->ymax = ar->winy; - scroll->xmin= ar->winx - 17; - scroll->xmax= ar->winx - 5; - scroll->ymin= 4; - scroll->ymax= 4+pix_available; + scroll->xmin = ar->winx - 17; + scroll->xmax = ar->winx - 5; + scroll->ymin = 4; + scroll->ymax = 4+pix_available; /* when re-sizing a view-port with the bar at the bottom to a greater height more blank lines will be added */ if(ltexth + blank_lines < st->top + st->viewlines) { @@ -1196,8 +1196,8 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back) } st->txtscroll= *scroll; - st->txtscroll.ymax= ar->winy - pix_top_margin - hlstart; - st->txtscroll.ymin= ar->winy - pix_top_margin - hlend; + st->txtscroll.ymax = ar->winy - pix_top_margin - hlstart; + st->txtscroll.ymin = ar->winy - pix_top_margin - hlend; CLAMP(st->txtscroll.ymin, pix_bottom_margin, ar->winy - pix_top_margin); CLAMP(st->txtscroll.ymax, pix_bottom_margin, ar->winy - pix_top_margin); diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index bf1b1ddc18a..82ec3c46c73 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -416,8 +416,8 @@ static void time_listener(ScrArea *sa, wmNotifier *wmn) for (ar= sa->regionbase.first; ar; ar= ar->next) { if (ar->regiontype==RGN_TYPE_WINDOW) { - ar->v2d.tot.xmin= (float)(SFRA - 4); - ar->v2d.tot.xmax= (float)(EFRA + 4); + ar->v2d.tot.xmin = (float)(SFRA - 4); + ar->v2d.tot.xmax = (float)(EFRA + 4); break; } } @@ -449,7 +449,7 @@ static void time_main_area_init(wmWindowManager *wm, ARegion *ar) UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_find(wm->defaultconf, "Timeline", SPACE_TIME, 0); + keymap = WM_keymap_find(wm->defaultconf, "Timeline", SPACE_TIME, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -599,10 +599,10 @@ static SpaceLink *time_new(const bContext *C) BLI_addtail(&stime->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; - ar->v2d.tot.xmin= (float)(SFRA - 4); - ar->v2d.tot.ymin= 0.0f; - ar->v2d.tot.xmax= (float)(EFRA + 4); - ar->v2d.tot.ymax= 50.0f; + ar->v2d.tot.xmin = (float)(SFRA - 4); + ar->v2d.tot.ymin = 0.0f; + ar->v2d.tot.xmax = (float)(EFRA + 4); + ar->v2d.tot.ymax = 50.0f; ar->v2d.cur= ar->v2d.tot; diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c index 45267563243..3eaf2b8100e 100644 --- a/source/blender/editors/space_time/time_ops.c +++ b/source/blender/editors/space_time/time_ops.c @@ -147,8 +147,8 @@ static int time_view_all_exec (bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; /* set extents of view to start/end frames (Preview Range too) */ - v2d->cur.xmin= (float)PSFRA; - v2d->cur.xmax= (float)PEFRA; + v2d->cur.xmin = (float)PSFRA; + v2d->cur.xmax = (float)PEFRA; /* we need an extra "buffer" factor on either side so that the endpoints are visible */ extra= 0.01f * (v2d->cur.xmax - v2d->cur.xmin); @@ -187,7 +187,7 @@ void time_operatortypes(void) void time_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Timeline", SPACE_TIME, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Timeline", SPACE_TIME, 0); WM_keymap_add_item(keymap, "TIME_OT_start_frame_set", SKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "TIME_OT_end_frame_set", EKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 405ce80323b..0d0d1bd3139 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -384,72 +384,72 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar) /* object ops. */ /* important to be before Pose keymap since they can both be enabled at once */ - keymap= WM_keymap_find(wm->defaultconf, "Face Mask", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Face Mask", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* pose is not modal, operator poll checks for this */ - keymap= WM_keymap_find(wm->defaultconf, "Pose", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Pose", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Object Mode", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Object Mode", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Vertex Paint", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Vertex Paint", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Weight Paint", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Weight Paint", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Sculpt", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Sculpt", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Mesh", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Mesh", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Curve", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Curve", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Armature", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Armature", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Pose", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Pose", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Metaball", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Metaball", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Lattice", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Lattice", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* armature sketching needs to take over mouse */ - keymap= WM_keymap_find(wm->defaultconf, "Armature Sketch", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Armature Sketch", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Particle", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Particle", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* editfont keymap swallows all... */ - keymap= WM_keymap_find(wm->defaultconf, "Font", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Font", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Object Non-modal", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Object Non-modal", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Frames", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Frames", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* own keymap, last so modes can override it */ - keymap= WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0); + keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "3D View", SPACE_VIEW3D, 0); + keymap = WM_keymap_find(wm->defaultconf, "3D View", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* add drop boxes */ @@ -812,7 +812,7 @@ static void view3d_main_area_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion /* add handlers, stuff you only do once or on area/region changes */ static void view3d_header_area_init(wmWindowManager *wm, ARegion *ar) { - wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0); + wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); @@ -856,7 +856,7 @@ static void view3d_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0); + keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -955,7 +955,7 @@ static void view3d_tools_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0); + keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index a9521a61eb2..953f22a2b65 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1004,11 +1004,11 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob) uiDefBut(block, LABEL, 0, "Location:", 0, 240, 100, 20, 0, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); - but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "X:", 0, 220, 120, 19, pchan->loc, -lim, lim, 100, 3, ""); + but = uiDefButF(block, NUM, B_ARMATUREPANEL2, "X:", 0, 220, 120, 19, pchan->loc, -lim, lim, 100, 3, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); - but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "Y:", 0, 200, 120, 19, pchan->loc+1, -lim, lim, 100, 3, ""); + but = uiDefButF(block, NUM, B_ARMATUREPANEL2, "Y:", 0, 200, 120, 19, pchan->loc+1, -lim, lim, 100, 3, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); - but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "Z:", 0, 180, 120, 19, pchan->loc+2, -lim, lim, 100, 3, ""); + but = uiDefButF(block, NUM, B_ARMATUREPANEL2, "Z:", 0, 180, 120, 19, pchan->loc+2, -lim, lim, 100, 3, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); uiBlockEndAlign(block); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 6b3e80e9224..03b571a8f73 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -956,10 +956,10 @@ static void view3d_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionV rect_camera= params.viewplane; /* get camera border within viewport */ - viewborder_r->xmin= ((rect_camera.xmin - rect_view.xmin)/(rect_view.xmax - rect_view.xmin))*ar->winx; - viewborder_r->xmax= ((rect_camera.xmax - rect_view.xmin)/(rect_view.xmax - rect_view.xmin))*ar->winx; - viewborder_r->ymin= ((rect_camera.ymin - rect_view.ymin)/(rect_view.ymax - rect_view.ymin))*ar->winy; - viewborder_r->ymax= ((rect_camera.ymax - rect_view.ymin)/(rect_view.ymax - rect_view.ymin))*ar->winy; + viewborder_r->xmin = ((rect_camera.xmin - rect_view.xmin)/(rect_view.xmax - rect_view.xmin))*ar->winx; + viewborder_r->xmax = ((rect_camera.xmax - rect_view.xmin)/(rect_view.xmax - rect_view.xmin))*ar->winx; + viewborder_r->ymin = ((rect_camera.ymin - rect_view.ymin)/(rect_view.ymax - rect_view.ymin))*ar->winy; + viewborder_r->ymax = ((rect_camera.ymax - rect_view.ymin)/(rect_view.ymax - rect_view.ymin))*ar->winy; } void ED_view3d_calc_camera_border_size(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, float size_r[2]) @@ -1236,19 +1236,19 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) float sensor_scale = (x2i-x1i) / sensor_x; float sensor_height = sensor_scale * sensor_y; - rect.xmin= x1i; - rect.xmax= x2i; - rect.ymin= (y1i + y2i)*0.5f - sensor_height*0.5f; - rect.ymax= rect.ymin + sensor_height; + rect.xmin = x1i; + rect.xmax = x2i; + rect.ymin = (y1i + y2i)*0.5f - sensor_height*0.5f; + rect.ymax = rect.ymin + sensor_height; } else { float sensor_scale = (y2i-y1i) / sensor_y; float sensor_width = sensor_scale * sensor_x; - rect.xmin= (x1i + x2i)*0.5f - sensor_width*0.5f; - rect.xmax= rect.xmin + sensor_width; - rect.ymin= y1i; - rect.ymax= y2i; + rect.xmin = (x1i + x2i)*0.5f - sensor_width*0.5f; + rect.xmax = rect.xmin + sensor_width; + rect.ymin = y1i; + rect.ymax = y2i; } /* draw */ @@ -1908,10 +1908,10 @@ void view3d_update_depths_rect(ARegion *ar, ViewDepths *d, rcti *rect) rcti r; /* clamp rect by area */ - r.xmin= 0; - r.xmax= ar->winx-1; - r.ymin= 0; - r.ymax= ar->winy-1; + r.xmin = 0; + r.xmax = ar->winx-1; + r.ymin = 0; + r.ymax = ar->winy-1; /* Constrain rect to depth bounds */ BLI_isect_rcti(&r, rect, rect); @@ -2403,10 +2403,10 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, ar->winx= winx; ar->winy= winy; - ar->winrct.xmin= 0; - ar->winrct.ymin= 0; - ar->winrct.xmax= winx; - ar->winrct.ymax= winy; + ar->winrct.xmin = 0; + ar->winrct.ymin = 0; + ar->winrct.xmax = winx; + ar->winrct.ymax = winy; /* set flags */ diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 4ddc518b814..a2616de124a 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2352,18 +2352,18 @@ static int render_border_exec(bContext *C, wmOperator *op) rctf vb; /* get border select values using rna */ - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); /* calculate range */ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &vb, FALSE); - scene->r.border.xmin= ((float)rect.xmin-vb.xmin)/(vb.xmax-vb.xmin); - scene->r.border.ymin= ((float)rect.ymin-vb.ymin)/(vb.ymax-vb.ymin); - scene->r.border.xmax= ((float)rect.xmax-vb.xmin)/(vb.xmax-vb.xmin); - scene->r.border.ymax= ((float)rect.ymax-vb.ymin)/(vb.ymax-vb.ymin); + scene->r.border.xmin = ((float)rect.xmin-vb.xmin)/(vb.xmax-vb.xmin); + scene->r.border.ymin = ((float)rect.ymin-vb.ymin)/(vb.ymax-vb.ymin); + scene->r.border.xmax = ((float)rect.xmax-vb.xmin)/(vb.xmax-vb.xmin); + scene->r.border.ymax = ((float)rect.ymax-vb.ymin)/(vb.ymax-vb.ymin); /* actually set border */ CLAMP(scene->r.border.xmin, 0.0f, 1.0f); @@ -2441,10 +2441,10 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) view3d_operator_needs_opengl(C); /* get border select values using rna */ - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); /* Get Z Depths, needed for perspective, nice for ortho */ bgl_get_mats(&mats); @@ -3180,10 +3180,10 @@ static int view3d_clipping_exec(bContext *C, wmOperator *op) bglMats mats; rcti rect; - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); rv3d->rflag |= RV3D_CLIPPING; rv3d->clipbb= MEM_callocN(sizeof(BoundBox), "clipbb"); @@ -3415,10 +3415,10 @@ static float view_autodist_depth_margin(ARegion *ar, const int mval[2], int marg if (margin==0) { /* Get Z Depths, needed for perspective, nice for ortho */ - rect.xmin= mval[0]; - rect.ymin= mval[1]; - rect.xmax= mval[0] + 1; - rect.ymax= mval[1] + 1; + rect.xmin = mval[0]; + rect.ymin = mval[1]; + rect.xmax = mval[0] + 1; + rect.ymax = mval[1] + 1; } else { rect.xmax = mval[0] + margin; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 532ca805125..c20ea004e9d 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -538,11 +538,11 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) block= uiLayoutGetBlock(row); if (v3d->twflag & V3D_USE_MANIPULATOR) { - but= uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Translate manipulator - Shift-Click for multiple modes")); + but = uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Translate manipulator - Shift-Click for multiple modes")); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ - but= uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Rotate manipulator - Shift-Click for multiple modes")); + but = uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Rotate manipulator - Shift-Click for multiple modes")); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ - but= uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Scale manipulator - Shift-Click for multiple modes")); + but = uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Scale manipulator - Shift-Click for multiple modes")); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ } @@ -551,7 +551,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) } str_menu = BIF_menustringTransformOrientation(C, "Orientation"); - but= uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, TIP_("Transform Orientation")); + but = uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, TIP_("Transform Orientation")); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ MEM_freeN((void *)str_menu); } diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 759f3edf20f..e4133723089 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -112,13 +112,13 @@ void view3d_keymap(wmKeyConfig *keyconf) wmKeyMap *keymap; wmKeyMapItem *kmi; - keymap= WM_keymap_find(keyconf, "3D View Generic", SPACE_VIEW3D, 0); + keymap = WM_keymap_find(keyconf, "3D View Generic", SPACE_VIEW3D, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_properties", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_toolshelf", TKEY, KM_PRESS, 0, 0); /* only for region 3D window */ - keymap= WM_keymap_find(keyconf, "3D View", SPACE_VIEW3D, 0); + keymap = WM_keymap_find(keyconf, "3D View", SPACE_VIEW3D, 0); kmi = WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, KM_ANY, 0); RNA_boolean_set(kmi->ptr, "release_confirm", TRUE); @@ -196,22 +196,22 @@ void view3d_keymap(wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", WHEELDOWNMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0)->ptr, "type", V3D_VIEW_STEPDOWN); /* active aligned, replaces '*' key in 2.4x */ - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_FRONT); RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_RIGHT); RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_TOP); RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_SHIFT|KM_CTRL, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BACK); RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_SHIFT|KM_CTRL, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_LEFT); RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_SHIFT|KM_CTRL, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_BOTTOM); RNA_boolean_set(kmi->ptr, "align_active", TRUE); @@ -227,13 +227,13 @@ void view3d_keymap(wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_BOTTOM, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_BOTTOM); /* 3D mouse align */ - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_FRONT, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_FRONT, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_FRONT); RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_RIGHT, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_RIGHT, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_RIGHT); RNA_boolean_set(kmi->ptr, "align_active", TRUE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_TOP, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", NDOF_BUTTON_TOP, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "type", RV3D_VIEW_TOP); RNA_boolean_set(kmi->ptr, "align_active", TRUE); @@ -275,12 +275,12 @@ void view3d_keymap(wmKeyConfig *keyconf) RNA_boolean_set(kmi->ptr, "center", FALSE); RNA_boolean_set(kmi->ptr, "object", FALSE); RNA_boolean_set(kmi->ptr, "enumerate", FALSE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "center", TRUE); RNA_boolean_set(kmi->ptr, "object", TRUE); /* use Ctrl+Select for 2 purposes */ RNA_boolean_set(kmi->ptr, "enumerate", FALSE); - kmi= WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); + kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", FALSE); RNA_boolean_set(kmi->ptr, "center", FALSE); RNA_boolean_set(kmi->ptr, "object", FALSE); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 22e5eabe5b0..b15dc6ab3c7 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -458,14 +458,14 @@ static void lasso_select_boundbox(rcti *rect, int mcords[][2], short moves) { short a; - rect->xmin= rect->xmax= mcords[0][0]; - rect->ymin= rect->ymax= mcords[0][1]; + rect->xmin = rect->xmax = mcords[0][0]; + rect->ymin = rect->ymax = mcords[0][1]; for (a=1; axmin) rect->xmin= mcords[a][0]; - else if (mcords[a][0]>rect->xmax) rect->xmax= mcords[a][0]; - if (mcords[a][1]ymin) rect->ymin= mcords[a][1]; - else if (mcords[a][1]>rect->ymax) rect->ymax= mcords[a][1]; + if (mcords[a][0]xmin) rect->xmin = mcords[a][0]; + else if (mcords[a][0]>rect->xmax) rect->xmax = mcords[a][0]; + if (mcords[a][1]ymin) rect->ymin = mcords[a][1]; + else if (mcords[a][1]>rect->ymax) rect->ymax = mcords[a][1]; } } @@ -2063,10 +2063,10 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) view3d_set_viewcontext(C, &vc); select= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); extend = RNA_boolean_get(op->ptr, "extend"); if (vc.obedit) { diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 3db9be02af1..88a490e23b8 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -176,7 +176,7 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase) /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, ""); + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, 150, 19, 0, 0, ""); uiButSetSearchFunc(but, operator_search_cb, arg_listbase, operator_call_cb, NULL); uiBoundsBlock(block, 6); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index b3d41150a31..19dc48c648c 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1049,13 +1049,13 @@ void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect) /* rect: for pick if (rect) { /* picking */ rect->xmin/= (float)ar->winx; - rect->xmin= x1+rect->xmin*(x2-x1); + rect->xmin = x1+rect->xmin*(x2-x1); rect->ymin/= (float)ar->winy; - rect->ymin= y1+rect->ymin*(y2-y1); + rect->ymin = y1+rect->ymin*(y2-y1); rect->xmax/= (float)ar->winx; - rect->xmax= x1+rect->xmax*(x2-x1); + rect->xmax = x1+rect->xmax*(x2-x1); rect->ymax/= (float)ar->winy; - rect->ymax= y1+rect->ymax*(y2-y1); + rect->ymax = y1+rect->ymax*(y2-y1); if (orth) wmOrtho(rect->xmin, rect->xmax, rect->ymin, rect->ymax, -clipend, clipend); else wmFrustum(rect->xmin, rect->xmax, rect->ymin, rect->ymax, clipsta, clipend); @@ -1210,17 +1210,17 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b G.f |= G_PICKSEL; /* case not a border select */ - if (input->xmin==input->xmax) { - rect.xmin= input->xmin-12; // seems to be default value for bones only now - rect.xmax= input->xmin+12; - rect.ymin= input->ymin-12; - rect.ymax= input->ymin+12; + if (input->xmin ==input->xmax) { + rect.xmin = input->xmin-12; // seems to be default value for bones only now + rect.xmax = input->xmin+12; + rect.ymin = input->ymin-12; + rect.ymax = input->ymin+12; } else { - rect.xmin= input->xmin; - rect.xmax= input->xmax; - rect.ymin= input->ymin; - rect.ymax= input->ymax; + rect.xmin = input->xmin; + rect.xmax = input->xmax; + rect.ymin = input->ymin; + rect.ymax = input->ymax; } setwinmatrixview3d(ar, v3d, &rect); diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 6eba3d7bd0a..faf8071bd45 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1545,10 +1545,10 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], fl G.f |= G_PICKSEL; - rect.xmin= mval[0]-hotspot; - rect.xmax= mval[0]+hotspot; - rect.ymin= mval[1]-hotspot; - rect.ymax= mval[1]+hotspot; + rect.xmin = mval[0]-hotspot; + rect.xmax = mval[0]+hotspot; + rect.ymin = mval[1]-hotspot; + rect.ymax = mval[1]+hotspot; setwinmatrixview3d(ar, v3d, &rect); mult_m4_m4m4(rv3d->persmat, rv3d->winmat, rv3d->viewmat); diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index dc96cf25586..ac6243e74ed 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -897,19 +897,19 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac break; case SPACE_ACTION: - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TIME_TRANSLATE); - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TIME_TRANSLATE); - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND); - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SCALE); - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, KM_SHIFT, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SLIDE); break; case SPACE_IPO: @@ -917,7 +917,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0); - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND); WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0); @@ -925,24 +925,24 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0); break; case SPACE_NLA: - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TRANSLATION); - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TRANSLATION); - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND); - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TIME_SCALE); break; case SPACE_NODE: WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0); + kmi = WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_A, KM_ANY, 0, 0); RNA_boolean_set(kmi->ptr, "release_confirm", TRUE); - kmi= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0); + kmi = WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0); RNA_boolean_set(kmi->ptr, "release_confirm", TRUE); WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0); @@ -961,7 +961,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac WM_keymap_add_item(keymap, OP_SEQ_SLIDE, EVT_TWEAK_S, KM_ANY, 0, 0); - kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", TFM_TIME_EXTEND); break; case SPACE_IMAGE: diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 6066ea759a0..6c050355a3e 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -2431,10 +2431,10 @@ static int border_select_exec(bContext *C, wmOperator *op) int change, pinned, select, faces, extend; /* get rectangle from operator */ - rect.xmin= RNA_int_get(op->ptr, "xmin"); - rect.ymin= RNA_int_get(op->ptr, "ymin"); - rect.xmax= RNA_int_get(op->ptr, "xmax"); - rect.ymax= RNA_int_get(op->ptr, "ymax"); + rect.xmin = RNA_int_get(op->ptr, "xmin"); + rect.ymin = RNA_int_get(op->ptr, "ymin"); + rect.xmax = RNA_int_get(op->ptr, "xmax"); + rect.ymax = RNA_int_get(op->ptr, "ymax"); UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin); UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); @@ -3571,8 +3571,8 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf) wmKeyMap *keymap; wmKeyMapItem *kmi; - keymap= WM_keymap_find(keyconf, "UV Editor", 0, 0); - keymap->poll= ED_operator_uvedit_can_uv_sculpt; + keymap = WM_keymap_find(keyconf, "UV Editor", 0, 0); + keymap->poll = ED_operator_uvedit_can_uv_sculpt; /* Uv sculpt toggle */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", QKEY, KM_PRESS, 0, 0); diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c index f51cd008904..25c073922df 100644 --- a/source/blender/nodes/composite/node_composite_util.c +++ b/source/blender/nodes/composite/node_composite_util.c @@ -53,10 +53,10 @@ CompBuf *alloc_compbuf(int sizex, int sizey, int type, int alloc) cbuf->rect= MEM_mapallocN(sizeof(float)*sizex*sizey, "compbuf Fac rect"); cbuf->malloc= 1; } - cbuf->disprect.xmin= 0; - cbuf->disprect.ymin= 0; - cbuf->disprect.xmax= sizex; - cbuf->disprect.ymax= sizey; + cbuf->disprect.xmin = 0; + cbuf->disprect.ymin = 0; + cbuf->disprect.xmax = sizex; + cbuf->disprect.ymax = sizey; return cbuf; } @@ -138,8 +138,8 @@ CompBuf *get_cropped_compbuf(rcti *drect, float *rectf, int rectx, int recty, in float *outfp; int dx, y; - if(disprect.xmax>rectx) disprect.xmax= rectx; - if(disprect.ymax>recty) disprect.ymax= recty; + if(disprect.xmax>rectx) disprect.xmax = rectx; + if(disprect.ymax>recty) disprect.ymax = recty; if(disprect.xmin>= disprect.xmax) return NULL; if(disprect.ymin>= disprect.ymax) return NULL; diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 3aa69171aa5..6e2d33cdf10 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -166,10 +166,10 @@ RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, h= re->result->recty - y; /* allocate a render result */ - disprect.xmin= x; - disprect.xmax= x+w; - disprect.ymin= y; - disprect.ymax= y+h; + disprect.xmin = x; + disprect.xmax = x+w; + disprect.ymin = y; + disprect.ymax = y+h; result= render_result_new(re, &disprect, 0, RR_USE_MEM); BLI_addtail(&engine->fullresult, result); diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 0d509e64eaa..bbca11e09fd 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -306,18 +306,18 @@ static void clipx_rctf_swap(rctf *stack, short *count, float x1, float x2) rf->xmax+= (x2-x1); } else { - if(rf->xmax>x2) rf->xmax= x2; + if(rf->xmax>x2) rf->xmax = x2; newrct= stack+ *count; (*count)++; - newrct->xmax= x2; - newrct->xmin= rf->xmin+(x2-x1); - newrct->ymin= rf->ymin; - newrct->ymax= rf->ymax; + newrct->xmax = x2; + newrct->xmin = rf->xmin+(x2-x1); + newrct->ymin = rf->ymin; + newrct->ymax = rf->ymax; - if(newrct->xmin==newrct->xmax) (*count)--; + if(newrct->xmin ==newrct->xmax) (*count)--; - rf->xmin= x1; + rf->xmin = x1; } } else if(rf->xmax>x2) { @@ -326,18 +326,18 @@ static void clipx_rctf_swap(rctf *stack, short *count, float x1, float x2) rf->xmax-= (x2-x1); } else { - if(rf->xminxmin= x1; + if(rf->xminxmin = x1; newrct= stack+ *count; (*count)++; - newrct->xmin= x1; - newrct->xmax= rf->xmax-(x2-x1); - newrct->ymin= rf->ymin; - newrct->ymax= rf->ymax; + newrct->xmin = x1; + newrct->xmax = rf->xmax-(x2-x1); + newrct->ymin = rf->ymin; + newrct->ymax = rf->ymax; - if(newrct->xmin==newrct->xmax) (*count)--; + if(newrct->xmin ==newrct->xmax) (*count)--; - rf->xmax= x2; + rf->xmax = x2; } } rf++; @@ -359,18 +359,18 @@ static void clipy_rctf_swap(rctf *stack, short *count, float y1, float y2) rf->ymax+= (y2-y1); } else { - if(rf->ymax>y2) rf->ymax= y2; + if(rf->ymax>y2) rf->ymax = y2; newrct= stack+ *count; (*count)++; - newrct->ymax= y2; - newrct->ymin= rf->ymin+(y2-y1); - newrct->xmin= rf->xmin; - newrct->xmax= rf->xmax; + newrct->ymax = y2; + newrct->ymin = rf->ymin+(y2-y1); + newrct->xmin = rf->xmin; + newrct->xmax = rf->xmax; if(newrct->ymin==newrct->ymax) (*count)--; - rf->ymin= y1; + rf->ymin = y1; } } else if(rf->ymax>y2) { @@ -379,18 +379,18 @@ static void clipy_rctf_swap(rctf *stack, short *count, float y1, float y2) rf->ymax-= (y2-y1); } else { - if(rf->yminymin= y1; + if(rf->yminymin = y1; newrct= stack+ *count; (*count)++; - newrct->ymin= y1; - newrct->ymax= rf->ymax-(y2-y1); - newrct->xmin= rf->xmin; - newrct->xmax= rf->xmax; + newrct->ymin = y1; + newrct->ymax = rf->ymax-(y2-y1); + newrct->xmin = rf->xmin; + newrct->xmax = rf->xmax; if(newrct->ymin==newrct->ymax) (*count)--; - rf->ymax= y2; + rf->ymax = y2; } } rf++; @@ -413,10 +413,10 @@ static float clipx_rctf(rctf *rf, float x1, float x2) size= rf->xmax - rf->xmin; if(rf->xminxmin= x1; + rf->xmin = x1; } if(rf->xmax>x2) { - rf->xmax= x2; + rf->xmax = x2; } if(rf->xmin > rf->xmax) { rf->xmin = rf->xmax; @@ -435,10 +435,10 @@ static float clipy_rctf(rctf *rf, float y1, float y2) size= rf->ymax - rf->ymin; if(rf->yminymin= y1; + rf->ymin = y1; } if(rf->ymax>y2) { - rf->ymax= y2; + rf->ymax = y2; } if(rf->ymin > rf->ymax) { @@ -552,10 +552,10 @@ static void boxsample(ImBuf *ibuf, float minx, float miny, float maxx, float max short count=1; rf= stack; - rf->xmin= minx*(ibuf->x); - rf->xmax= maxx*(ibuf->x); - rf->ymin= miny*(ibuf->y); - rf->ymax= maxy*(ibuf->y); + rf->xmin = minx*(ibuf->x); + rf->xmax = maxx*(ibuf->x); + rf->ymin = miny*(ibuf->y); + rf->ymax = maxy*(ibuf->y); texr.talpha= texres->talpha; /* is read by boxsample_clip */ @@ -979,10 +979,10 @@ static void alpha_clip_aniso(ImBuf *ibuf, float minx, float miny, float maxx, fl // if this is actually correct for the all the filtering algorithms .. if(!(extflag == TXC_REPT || extflag == TXC_EXTD)) { - rf.xmin= minx*(ibuf->x); - rf.xmax= maxx*(ibuf->x); - rf.ymin= miny*(ibuf->y); - rf.ymax= maxy*(ibuf->y); + rf.xmin = minx*(ibuf->x); + rf.xmax = maxx*(ibuf->x); + rf.ymin = miny*(ibuf->y); + rf.ymax = maxy*(ibuf->y); alphaclip = clipx_rctf(&rf, 0.0, (float)(ibuf->x)); alphaclip*= clipy_rctf(&rf, 0.0, (float)(ibuf->y)); diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index b7254cd1221..9b68d28e0cf 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -594,23 +594,23 @@ void initparts(Render *re) xd= (nr % xparts); yd= (nr-xd)/xparts; - disprect.xmin= xminb+ xd*partx; - disprect.ymin= yminb+ yd*party; + disprect.xmin = xminb+ xd*partx; + disprect.ymin = yminb+ yd*party; /* ensure we cover the entire picture, so last parts go to end */ if(xd xmaxb) disprect.xmax = xmaxb; } - else disprect.xmax= xmaxb; + else disprect.xmax = xmaxb; if(yd ymaxb) disprect.ymax = ymaxb; } - else disprect.ymax= ymaxb; + else disprect.ymax = ymaxb; rectx= disprect.xmax - disprect.xmin; recty= disprect.ymax - disprect.ymin; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index da4950fae24..b2092f94af8 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -430,9 +430,9 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer * re->recty= disprect->ymax-disprect->ymin; } else { - re->disprect.xmin= re->disprect.ymin= 0; - re->disprect.xmax= winx; - re->disprect.ymax= winy; + re->disprect.xmin = re->disprect.ymin = 0; + re->disprect.xmax = winx; + re->disprect.ymax = winy; re->rectx= winx; re->recty= winy; } @@ -1209,9 +1209,9 @@ static void do_render_fields_blur_3d(Render *re) /* this copying sequence could become function? */ /* weak is: it chances disprect from border */ - re->disprect.xmin= re->disprect.ymin= 0; - re->disprect.xmax= re->winx; - re->disprect.ymax= re->winy; + re->disprect.xmin = re->disprect.ymin = 0; + re->disprect.xmax = re->winx; + re->disprect.ymax = re->winy; re->rectx= re->winx; re->recty= re->winy; @@ -1928,16 +1928,16 @@ static int render_initialize_from_main(Render *re, Main *bmain, Scene *scene, Sc /* we always render smaller part, inserting it in larger image is compositor bizz, it uses disprect for it */ if(scene->r.mode & R_BORDER) { - disprect.xmin= scene->r.border.xmin*winx; - disprect.xmax= scene->r.border.xmax*winx; + disprect.xmin = scene->r.border.xmin*winx; + disprect.xmax = scene->r.border.xmax*winx; - disprect.ymin= scene->r.border.ymin*winy; - disprect.ymax= scene->r.border.ymax*winy; + disprect.ymin = scene->r.border.ymin*winy; + disprect.ymax = scene->r.border.ymax*winy; } else { - disprect.xmin= disprect.ymin= 0; - disprect.xmax= winx; - disprect.ymax= winy; + disprect.xmin = disprect.ymin = 0; + disprect.xmax = winx; + disprect.ymax = winy; } re->main= bmain; @@ -2282,16 +2282,16 @@ int RE_ReadRenderResult(Scene *scene, Scene *scenode) /* only in movie case we render smaller part */ if(scene->r.mode & R_BORDER) { - disprect.xmin= scene->r.border.xmin*winx; - disprect.xmax= scene->r.border.xmax*winx; + disprect.xmin = scene->r.border.xmin*winx; + disprect.xmax = scene->r.border.xmax*winx; - disprect.ymin= scene->r.border.ymin*winy; - disprect.ymax= scene->r.border.ymax*winy; + disprect.ymin = scene->r.border.ymin*winy; + disprect.ymax = scene->r.border.ymax*winy; } else { - disprect.xmin= disprect.ymin= 0; - disprect.xmax= winx; - disprect.ymax= winy; + disprect.xmin = disprect.ymin = 0; + disprect.xmax = winx; + disprect.ymax = winy; } if(scenode) diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index f9ceaa63fc1..2cf5346fdd7 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -430,15 +430,15 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf rr= MEM_callocN(sizeof(RenderResult), "new render result"); rr->rectx= rectx; rr->recty= recty; - rr->renrect.xmin= 0; rr->renrect.xmax= rectx-2*crop; + rr->renrect.xmin = 0; rr->renrect.xmax = rectx-2*crop; /* crop is one or two extra pixels rendered for filtering, is used for merging and display too */ rr->crop= crop; /* tilerect is relative coordinates within render disprect. do not subtract crop yet */ - rr->tilerect.xmin= partrct->xmin - re->disprect.xmin; - rr->tilerect.xmax= partrct->xmax - re->disprect.xmax; - rr->tilerect.ymin= partrct->ymin - re->disprect.ymin; - rr->tilerect.ymax= partrct->ymax - re->disprect.ymax; + rr->tilerect.xmin = partrct->xmin - re->disprect.xmin; + rr->tilerect.xmax = partrct->xmax - re->disprect.xmax; + rr->tilerect.ymin = partrct->ymin - re->disprect.ymin; + rr->tilerect.ymax = partrct->ymax - re->disprect.ymax; if(savebuffers) { rr->exrhandle= IMB_exr_get_handle(); diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 28988af64c4..da598cb4733 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -832,8 +832,8 @@ static void shadeDA_tile(RenderPart *pa, RenderLayer *rl) } /* scanline updates have to be 2 lines behind */ - rr->renrect.ymin= 0; - rr->renrect.ymax= -2*crop; + rr->renrect.ymin = 0; + rr->renrect.ymax = -2*crop; rr->renlay= rl; for(y=pa->disprect.ymin+crop; ydisprect.ymax-crop; y++, rr->renrect.ymax++) { @@ -1293,7 +1293,7 @@ void zbufshadeDA_tile(RenderPart *pa) MEM_freeN(pa->rectz); pa->rectz= NULL; /* display active layer */ - rr->renrect.ymin=rr->renrect.ymax= 0; + rr->renrect.ymin=rr->renrect.ymax = 0; rr->renlay= render_get_active_layer(&R, rr); } @@ -1339,7 +1339,7 @@ void zbufshade_tile(RenderPart *pa) } /* initialize scanline updates for main thread */ - rr->renrect.ymin= 0; + rr->renrect.ymin = 0; rr->renlay= rl; if(rl->layflag & SCE_LAY_SOLID) { @@ -1448,7 +1448,7 @@ void zbufshade_tile(RenderPart *pa) } /* display active layer */ - rr->renrect.ymin=rr->renrect.ymax= 0; + rr->renrect.ymin=rr->renrect.ymax = 0; rr->renlay= render_get_active_layer(&R, rr); MEM_freeN(pa->recto); pa->recto= NULL; @@ -1674,7 +1674,7 @@ void zbufshade_sss_tile(RenderPart *pa) if(display) { /* initialize scanline updates for main thread */ - rr->renrect.ymin= 0; + rr->renrect.ymin = 0; rr->renlay= rl; } @@ -1784,7 +1784,7 @@ void zbufshade_sss_tile(RenderPart *pa) if(display) { /* display active layer */ - rr->renrect.ymin=rr->renrect.ymax= 0; + rr->renrect.ymin=rr->renrect.ymax = 0; rr->renlay= render_get_active_layer(&R, rr); } diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 3ef62f7b383..49e331cc44c 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -1462,10 +1462,10 @@ typedef struct BSPFace { /* boxes are in lamp projection */ static void init_box(Boxf *box) { - box->xmin= 1000000.0f; - box->xmax= 0; - box->ymin= 1000000.0f; - box->ymax= 0; + box->xmin = 1000000.0f; + box->xmax = 0; + box->ymin = 1000000.0f; + box->ymax = 0; box->zmin= 0x7FFFFFFF; box->zmax= - 0x7FFFFFFF; } @@ -1473,10 +1473,10 @@ static void init_box(Boxf *box) /* use v1 to calculate boundbox */ static void bound_boxf(Boxf *box, const float v1[3]) { - if(v1[0] < box->xmin) box->xmin= v1[0]; - if(v1[0] > box->xmax) box->xmax= v1[0]; - if(v1[1] < box->ymin) box->ymin= v1[1]; - if(v1[1] > box->ymax) box->ymax= v1[1]; + if(v1[0] < box->xmin) box->xmin = v1[0]; + if(v1[0] > box->xmax) box->xmax = v1[0]; + if(v1[1] < box->ymin) box->ymin = v1[1]; + if(v1[1] > box->ymax) box->ymax = v1[1]; if(v1[2] < box->zmin) box->zmin= v1[2]; if(v1[2] > box->zmax) box->zmax= v1[2]; } @@ -1484,10 +1484,10 @@ static void bound_boxf(Boxf *box, const float v1[3]) /* use v1 to calculate boundbox */ static void bound_rectf(rctf *box, const float v1[2]) { - if(v1[0] < box->xmin) box->xmin= v1[0]; - if(v1[0] > box->xmax) box->xmax= v1[0]; - if(v1[1] < box->ymin) box->ymin= v1[1]; - if(v1[1] > box->ymax) box->ymax= v1[1]; + if(v1[0] < box->xmin) box->xmin = v1[0]; + if(v1[0] > box->xmax) box->xmax = v1[0]; + if(v1[1] < box->ymin) box->ymin = v1[1]; + if(v1[1] > box->ymax) box->ymax = v1[1]; } @@ -1517,12 +1517,12 @@ static void isb_bsp_split_init(ISBBranch *root, MemArena *mem, int level) left->box= root->box; right->box= root->box; if(i==0) { - left->box.xmax= root->divider[0]; - right->box.xmin= root->divider[0]; + left->box.xmax = root->divider[0]; + right->box.xmin = root->divider[0]; } else { - left->box.ymax= root->divider[1]; - right->box.ymin= root->divider[1]; + left->box.ymax = root->divider[1]; + right->box.ymin = root->divider[1]; } isb_bsp_split_init(left, mem, level-1); isb_bsp_split_init(right, mem, level-1); @@ -1591,12 +1591,12 @@ static void isb_bsp_split(ISBBranch *root, MemArena *mem) left->box= root->box; right->box= root->box; if(i==0) { - left->box.xmax= root->divider[0]; - right->box.xmin= root->divider[0]; + left->box.xmax = root->divider[0]; + right->box.xmin = root->divider[0]; } else { - left->box.ymax= root->divider[1]; - right->box.ymin= root->divider[1]; + left->box.ymax = root->divider[1]; + right->box.ymin = root->divider[1]; } } @@ -2224,8 +2224,8 @@ static void isb_make_buffer(RenderPart *pa, LampRen *lar) /* setup bsp root */ memset(&root, 0, sizeof(ISBBranch)); - root.box.xmin= (float)shb->size; - root.box.ymin= (float)shb->size; + root.box.xmin = (float)shb->size; + root.box.ymin = (float)shb->size; /* create the sample buffers */ for(sindex=0, y=0; yrecty; y++) { @@ -2428,8 +2428,8 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la /* setup bsp root */ memset(&root, 0, sizeof(ISBBranch)); - root.box.xmin= (float)shb->size; - root.box.ymin= (float)shb->size; + root.box.xmin = (float)shb->size; + root.box.ymin = (float)shb->size; /* create the sample buffers */ for(ap= apixbuf, sindex=0, y=0; yrecty; y++) { diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index d5ed5c7a824..46520001d2d 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3449,10 +3449,10 @@ void zbuffer_abuf_shadow(Render *re, LampRen *lar, float winmat[][4], APixstr *A memset(&pa, 0, sizeof(RenderPart)); pa.rectx= size; pa.recty= size; - pa.disprect.xmin= 0; - pa.disprect.ymin= 0; - pa.disprect.xmax= size; - pa.disprect.ymax= size; + pa.disprect.xmin = 0; + pa.disprect.ymin = 0; + pa.disprect.xmax = size; + pa.disprect.ymax = size; zbuffer_abuf(re, &pa, APixbuf, apsmbase, lay, 0, winmat, size, size, samples, jit, 1.0f, 1); if(APixbufstrand) @@ -4034,8 +4034,8 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas } /* init scanline updates */ - rr->renrect.ymin= 0; - rr->renrect.ymax= -pa->crop; + rr->renrect.ymin = 0; + rr->renrect.ymax = -pa->crop; rr->renlay= rl; /* render the tile */ diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 299266154dd..7f9633f939a 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -280,13 +280,13 @@ static const char *wm_drag_name(wmDrag *drag) static void drag_rect_minmax(rcti *rect, int x1, int y1, int x2, int y2) { if(rect->xmin > x1) - rect->xmin= x1; + rect->xmin = x1; if(rect->xmax < x2) - rect->xmax= x2; + rect->xmax = x2; if(rect->ymin > y1) - rect->ymin= y1; + rect->ymin = y1; if(rect->ymax < y2) - rect->ymax= y2; + rect->ymax = y2; } /* called in wm_draw.c */ @@ -300,8 +300,8 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect) cursorx= win->eventstate->x; cursory= win->eventstate->y; if(rect) { - rect->xmin= rect->xmax= cursorx; - rect->ymin= rect->ymax= cursory; + rect->xmin = rect->xmax = cursorx; + rect->ymin = rect->ymax = cursory; } /* XXX todo, multiline drag draws... but maybe not, more types mixed wont work well */ diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 4751dbb87ff..94df54dcdfc 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -252,7 +252,7 @@ static void wm_method_draw_overlap_all(bContext *C, wmWindow *win, int exchange) /* flush drag item */ if(rect.xmin!=rect.xmax) { wm_flush_regions_down(screen, &rect); - rect.xmin= rect.xmax = 0; + rect.xmin = rect.xmax = 0; } if(wm->drags.first) { /* doesnt draw, fills rect with boundbox */ diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index fcdebff82be..565b86f6a5f 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1087,7 +1087,7 @@ int WM_operator_call_py(bContext *C, wmOperatorType *ot, int context, PointerRNA retval = wm_operator_call_internal(C, ot, properties, reports, context, FALSE); - if (wm == CTX_wm_manager(C)) wm->op_undo_depth--; + if (wm && (wm == CTX_wm_manager(C))) wm->op_undo_depth--; /* keep the reports around if needed later */ if ( (retval & OPERATOR_RUNNING_MODAL) || @@ -1331,7 +1331,7 @@ static void wm_event_modalkeymap(const bContext *C, wmOperator *op, wmEvent *eve wmKeyMap *keymap= WM_keymap_active(CTX_wm_manager(C), op->type->modalkeymap); wmKeyMapItem *kmi; - for(kmi= keymap->items.first; kmi; kmi= kmi->next) { + for(kmi = keymap->items.first; kmi; kmi = kmi->next) { if(wm_eventmatch(event, kmi)) { event->type= EVT_MODAL_MAP; @@ -1663,7 +1663,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) wmKeyMapItem *kmi; if(!keymap->poll || keymap->poll(C)) { - for(kmi= keymap->items.first; kmi; kmi= kmi->next) { + for(kmi = keymap->items.first; kmi; kmi = kmi->next) { if(wm_eventmatch(event, kmi)) { /* weak, but allows interactive callback to not use rawkey */ diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index b9b8f57b971..46f307d5ee5 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -79,17 +79,17 @@ wmGesture *WM_gesture_new(bContext *C, wmEvent *event, int type) rcti *rect= MEM_callocN(sizeof(rcti), "gesture rect new"); gesture->customdata= rect; - rect->xmin= event->x - sx; - rect->ymin= event->y - sy; + rect->xmin = event->x - sx; + rect->ymin = event->y - sy; if(type==WM_GESTURE_CIRCLE) { #ifdef GESTURE_MEMORY - rect->xmax= circle_select_size; + rect->xmax = circle_select_size; #else - rect->xmax= 25; // XXX temp + rect->xmax = 25; // XXX temp #endif } else { - rect->xmax= event->x - sx; - rect->ymax= event->y - sy; + rect->xmax = event->x - sx; + rect->ymax = event->y - sy; } } else if (ELEM(type, WM_GESTURE_LINES, WM_GESTURE_LASSO)) { diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index ff811ae4ce7..8e218e405b6 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -335,11 +335,11 @@ wmKeyMapItem *WM_keymap_verify_item(wmKeyMap *keymap, const char *idname, int ty { wmKeyMapItem *kmi; - for(kmi= keymap->items.first; kmi; kmi= kmi->next) + for(kmi = keymap->items.first; kmi; kmi = kmi->next) if(strncmp(kmi->idname, idname, OP_MAX_TYPENAME)==0) break; if(kmi==NULL) { - kmi= MEM_callocN(sizeof(wmKeyMapItem), "keymap entry"); + kmi = MEM_callocN(sizeof(wmKeyMapItem), "keymap entry"); BLI_addtail(&keymap->items, kmi); BLI_strncpy(kmi->idname, idname, OP_MAX_TYPENAME); @@ -355,7 +355,7 @@ wmKeyMapItem *WM_keymap_verify_item(wmKeyMap *keymap, const char *idname, int ty /* always add item */ wmKeyMapItem *WM_keymap_add_item(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier) { - wmKeyMapItem *kmi= MEM_callocN(sizeof(wmKeyMapItem), "keymap entry"); + wmKeyMapItem *kmi = MEM_callocN(sizeof(wmKeyMapItem), "keymap entry"); BLI_addtail(&keymap->items, kmi); BLI_strncpy(kmi->idname, idname, OP_MAX_TYPENAME); @@ -373,7 +373,7 @@ wmKeyMapItem *WM_keymap_add_item(wmKeyMap *keymap, const char *idname, int type, /* menu wrapper for WM_keymap_add_item */ wmKeyMapItem *WM_keymap_add_menu(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier) { - wmKeyMapItem *kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", type, val, modifier, keymodifier); + wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_menu", type, val, modifier, keymodifier); RNA_string_set(kmi->ptr, "name", idname); return kmi; } @@ -695,7 +695,7 @@ wmKeyMap *WM_modalkeymap_get(wmKeyConfig *keyconf, const char *idname) wmKeyMapItem *WM_modalkeymap_add_item(wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value) { - wmKeyMapItem *kmi= MEM_callocN(sizeof(wmKeyMapItem), "keymap entry"); + wmKeyMapItem *kmi = MEM_callocN(sizeof(wmKeyMapItem), "keymap entry"); BLI_addtail(&km->items, kmi); kmi->propvalue= value; @@ -874,7 +874,7 @@ char *WM_key_event_operator_string( const bContext *C, const char *opname, int opcontext, IDProperty *properties, const short sloppy, char *str, int len) { - wmKeyMapItem *kmi= wm_keymap_item_find(C, opname, opcontext, properties, 0, sloppy, NULL); + wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, 0, sloppy, NULL); if(kmi) { WM_keymap_item_to_string(kmi, str, len); @@ -888,7 +888,7 @@ int WM_key_event_operator_id( const bContext *C, const char *opname, int opcontext, IDProperty *properties, int hotkey, wmKeyMap **keymap_r) { - wmKeyMapItem *kmi= wm_keymap_item_find(C, opname, opcontext, properties, hotkey, TRUE, keymap_r); + wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, hotkey, TRUE, keymap_r); if(kmi) return kmi->id; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index ed4f47249fc..953d266e7f5 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -740,7 +740,7 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op) uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); //uiDefBut(block, LABEL, 0, op->type->name, 10, 10, 180, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); // ok, this isn't so easy... - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9*UI_UNIT_X, UI_UNIT_Y, 0, 0, ""); + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9*UI_UNIT_X, UI_UNIT_Y, 0, 0, ""); uiButSetSearchFunc(but, operator_enum_search_cb, op->type, operator_enum_call_cb, NULL); /* fake button, it holds space for search items */ @@ -1238,7 +1238,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiStyle *style= UI_GetStyle(); struct RecentFile *recent; int i; - MenuType *mt= WM_menutype_find("USERPREF_MT_splash", TRUE); + MenuType *mt = WM_menutype_find("USERPREF_MT_splash", TRUE); char url[96]; #ifndef WITH_HEADLESS @@ -1269,7 +1269,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN); - but= uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */ + but = uiDefBut(block, BUT_IMAGE, 0, "", 0, 10, 501, 282, ibuf, 0.0, 0.0, 0, 0, ""); /* button owns the imbuf now */ uiButSetFunc(but, wm_block_splash_close, block, NULL); uiBlockSetFunc(block, wm_block_splash_refreshmenu, block, NULL); @@ -1408,7 +1408,7 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *UNUSED(arg_ block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); - but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9*UI_UNIT_X, UI_UNIT_Y, 0, 0, ""); + but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9*UI_UNIT_X, UI_UNIT_Y, 0, 0, ""); uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); /* fake button, it holds space for search items */ @@ -2296,7 +2296,7 @@ static int border_apply_rect(wmOperator *op) wmGesture *gesture= op->customdata; rcti *rect= gesture->customdata; - if(rect->xmin==rect->xmax || rect->ymin==rect->ymax) + if(rect->xmin ==rect->xmax || rect->ymin==rect->ymax) return 0; @@ -2360,12 +2360,12 @@ int WM_border_select_modal(bContext *C, wmOperator *op, wmEvent *event) wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy); if(gesture->type==WM_GESTURE_CROSS_RECT && gesture->mode==0) { - rect->xmin= rect->xmax= event->x - sx; - rect->ymin= rect->ymax= event->y - sy; + rect->xmin = rect->xmax = event->x - sx; + rect->ymin = rect->ymax = event->y - sy; } else { - rect->xmax= event->x - sx; - rect->ymax= event->y - sy; + rect->xmax = event->x - sx; + rect->ymax = event->y - sy; } border_apply_rect(op); @@ -2460,8 +2460,8 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, wmEvent *event) if(event->type== MOUSEMOVE) { wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy); - rect->xmin= event->x - sx; - rect->ymin= event->y - sy; + rect->xmin = event->x - sx; + rect->ymin = event->y - sy; wm_gesture_tag_redraw(C); @@ -2476,7 +2476,7 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, wmEvent *event) break; case GESTURE_MODAL_CIRCLE_SUB: rect->xmax -= 2 + rect->xmax/10; - if(rect->xmax < 1) rect->xmax= 1; + if(rect->xmax < 1) rect->xmax = 1; wm_gesture_tag_redraw(C); break; case GESTURE_MODAL_SELECT: @@ -2549,8 +2549,8 @@ static void tweak_gesture_modal(bContext *C, wmEvent *event) wm_subwindow_getorigin(window, gesture->swinid, &sx, &sy); - rect->xmax= event->x - sx; - rect->ymax= event->y - sy; + rect->xmax = event->x - sx; + rect->ymax = event->y - sy; if((val= wm_gesture_evaluate(gesture))) { wmEvent tevent; @@ -2786,7 +2786,7 @@ static int straightline_apply(bContext *C, wmOperator *op) wmGesture *gesture= op->customdata; rcti *rect= gesture->customdata; - if(rect->xmin==rect->xmax && rect->ymin==rect->ymax) + if(rect->xmin ==rect->xmax && rect->ymin==rect->ymax) return 0; /* operator arguments and storage. */ @@ -2827,12 +2827,12 @@ int WM_gesture_straightline_modal(bContext *C, wmOperator *op, wmEvent *event) wm_subwindow_getorigin(CTX_wm_window(C), gesture->swinid, &sx, &sy); if(gesture->mode==0) { - rect->xmin= rect->xmax= event->x - sx; - rect->ymin= rect->ymax= event->y - sy; + rect->xmin = rect->xmax = event->x - sx; + rect->ymin = rect->ymax = event->y - sy; } else { - rect->xmax= event->x - sx; - rect->ymax= event->y - sy; + rect->xmax = event->x - sx; + rect->ymax = event->y - sy; straightline_apply(C, op); } @@ -3858,7 +3858,7 @@ static void gesture_zoom_border_modal_keymap(wmKeyConfig *keyconf) /* default keymap for windows and screens, only call once per WM */ void wm_window_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(keyconf, "Window", 0, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Window", 0, 0); wmKeyMapItem *kmi; /* note, this doesn't replace existing keymap items */ @@ -3877,7 +3877,7 @@ void wm_window_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "WM_OT_link_append", OKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); - kmi= WM_keymap_add_item(keymap, "WM_OT_link_append", F1KEY, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_link_append", F1KEY, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "link", FALSE); RNA_boolean_set(kmi->ptr, "instance_groups", FALSE); @@ -3885,7 +3885,7 @@ void wm_window_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0); - kmi= WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_ALT|KM_CTRL, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_ALT|KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "copy", TRUE); WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_ALT, 0); @@ -3945,19 +3945,19 @@ void wm_window_keymap(wmKeyConfig *keyconf) RNA_string_set(kmi->ptr, "value", "DOPESHEET_EDITOR"); /* ndof speed */ - kmi= WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_PLUS, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_PLUS, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "decrease", FALSE); RNA_boolean_set(kmi->ptr, "fast", FALSE); - kmi= WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_MINUS, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_MINUS, KM_PRESS, 0, 0); RNA_boolean_set(kmi->ptr, "decrease", TRUE); RNA_boolean_set(kmi->ptr, "fast", FALSE); - kmi= WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_PLUS, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_PLUS, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "decrease", FALSE); RNA_boolean_set(kmi->ptr, "fast", TRUE); - kmi= WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_MINUS, KM_PRESS, KM_SHIFT, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_ndof_sensitivity_change", NDOF_BUTTON_MINUS, KM_PRESS, KM_SHIFT, 0); RNA_boolean_set(kmi->ptr, "decrease", TRUE); RNA_boolean_set(kmi->ptr, "fast", TRUE); diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 5e11e31c045..662c8eb254c 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -220,9 +220,9 @@ void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct) */ if (swin->winrct.xmax > win->sizex) - swin->winrct.xmax= win->sizex; + swin->winrct.xmax = win->sizex; if (swin->winrct.ymax > win->sizey) - swin->winrct.ymax= win->sizey; + swin->winrct.ymax = win->sizey; /* extra service */ wmSubWindowSet(win, swinid); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 86d71504f8e..cc5b9abdd69 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -138,8 +138,8 @@ static void wm_window_check_position(rcti *rect) rect->ymin -= d; } - if(rect->xmin < 0) rect->xmin= 0; - if(rect->ymin < 0) rect->ymin= 0; + if(rect->xmin < 0) rect->xmin = 0; + if(rect->ymin < 0) rect->ymin = 0; } @@ -437,13 +437,13 @@ void wm_window_add_ghostwindows(wmWindowManager *wm) win->eventstate= MEM_callocN(sizeof(wmEvent), "window event state"); /* add keymap handlers (1 handler for all keys in map!) */ - keymap= WM_keymap_find(wm->defaultconf, "Window", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Window", 0, 0); WM_event_add_keymap_handler(&win->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Screen", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Screen", 0, 0); WM_event_add_keymap_handler(&win->handlers, keymap); - keymap= WM_keymap_find(wm->defaultconf, "Screen Editing", 0, 0); + keymap = WM_keymap_find(wm->defaultconf, "Screen Editing", 0, 0); WM_event_add_keymap_handler(&win->modalhandlers, keymap); /* add drop boxes */ -- cgit v1.2.3