diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-17 13:58:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-17 13:58:26 +0400 |
commit | f5f25b81e8963aeba0a4c09f09358de070e0f927 (patch) | |
tree | c7fd6345d3a372845a0621e90087f88c90e4b8b8 /source/blender/editors | |
parent | 245c94a75e60c2c0b58c1f39d189258e2e424e29 (diff) |
style cleanup:
also fix for building ghost test and fix double free in one of the tests
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 8 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 3 | ||||
-rw-r--r-- | source/blender/editors/object/object_lattice.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 16 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawvolume.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 2 |
13 files changed, 30 insertions, 27 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index a8f8d2974e5..3883dce7671 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -156,7 +156,7 @@ void duplicate_fcurve_keys(FCurve *fcu) memcpy(newbezt, fcu->bezt, sizeof(BezTriple) * (i + 1)); memcpy(newbezt + i + 1, fcu->bezt + i, sizeof(BezTriple)); - memcpy(newbezt + i + 2, fcu->bezt + i + 1, sizeof (BezTriple) * (fcu->totvert - (i + 1))); + memcpy(newbezt + i + 2, fcu->bezt + i + 1, sizeof(BezTriple) * (fcu->totvert - (i + 1))); fcu->totvert++; /* reassign pointers... (free old, and add new) */ diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 3c802020747..0007facdf8f 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -878,7 +878,7 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), glPopMatrix(); /* min max */ - glColor3f(.5f, .5f, .5f); + glColor3f(0.5f, 0.5f, 0.5f); min = yofs + scopes->minmax[0][0] * h; max = yofs + scopes->minmax[0][1] * h; CLAMP(min, rect.ymin, rect.ymax); @@ -1012,7 +1012,9 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wco int i, j; float w, h, centerx, centery, diam; float alpha; - const float colors[6][3] = {{.75, 0, 0}, {.75, .75, 0}, {0, .75, 0}, {0, .75, .75}, {0, 0, .75}, {.75, 0, .75}}; + const float colors[6][3] = { + {0.75, 0.0, 0.0}, {0.75, 0.75, 0.0}, {0.0, 0.75, 0.0}, + {0.0, 0.75, 0.75}, {0.0, 0.0, 0.75}, {0.75, 0.0, 0.75}}; GLint scissor[4]; rect.xmin = (float)recti->xmin + 1; @@ -1375,7 +1377,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax); } - /* grid, every .25 step */ + /* grid, every 0.25 step */ gl_shaded_color((unsigned char *)wcol->inner, -16); ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 0.25f); /* grid, every 1.0 step */ diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 385f74acbd2..737c0377f27 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -347,7 +347,7 @@ static void vicon_editmode_dehlt_draw(int x, int y, int w, int h, float UNUSED(a glColor4f(0.0f, 0.0f, 0.0f, 1); viconutil_draw_lineloop_smooth(pts, 3); - glColor3f(.9f, .9f, .9f); + glColor3f(0.9f, 0.9f, 0.9f); viconutil_draw_points(pts, 3, 1); } diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 02f34873ea7..fe46a5dc9c5 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -737,7 +737,8 @@ void ui_theme_init_default(void) rgba_char_args_set(btheme->tv3d.lastsel_point, 0xff, 0xff, 0xff, 255); rgba_char_args_set(btheme->tv3d.bone_solid, 200, 200, 200, 255); - rgba_char_args_set(btheme->tv3d.bone_pose, 80, 200, 255, 80); // alpha 80 is not meant editable, used for wire+action draw + /* alpha 80 is not meant editable, used for wire+action draw */ + rgba_char_args_set(btheme->tv3d.bone_pose, 80, 200, 255, 80); rgba_char_args_set(btheme->tv3d.bundle_solid, 200, 200, 200, 255); rgba_char_args_set(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255); diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index 0a9944debe1..e85f47837ef 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -102,7 +102,7 @@ void make_editLatt(Object *obedit) if (lt->dvert) { int tot = lt->pntsu * lt->pntsv * lt->pntsw; - lt->editlatt->latt->dvert = MEM_mallocN(sizeof (MDeformVert) * tot, "Lattice MDeformVert"); + lt->editlatt->latt->dvert = MEM_mallocN(sizeof(MDeformVert) * tot, "Lattice MDeformVert"); copy_dverts(lt->editlatt->latt->dvert, lt->dvert, tot); } @@ -162,7 +162,7 @@ void load_editLatt(Object *obedit) if (editlt->dvert) { tot = lt->pntsu * lt->pntsv * lt->pntsw; - lt->dvert = MEM_mallocN(sizeof (MDeformVert) * tot, "Lattice MDeformVert"); + lt->dvert = MEM_mallocN(sizeof(MDeformVert) * tot, "Lattice MDeformVert"); copy_dverts(lt->dvert, editlt->dvert, tot); } } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 4e98d2ae967..55fb130e2c0 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1175,7 +1175,7 @@ static int area_split_menu_init(bContext *C, wmOperator *op) sAreaSplitData *sd; /* custom data */ - sd = (sAreaSplitData *)MEM_callocN(sizeof (sAreaSplitData), "op_area_split"); + sd = (sAreaSplitData *)MEM_callocN(sizeof(sAreaSplitData), "op_area_split"); op->customdata = sd; sd->sarea = CTX_wm_area(C); @@ -1210,7 +1210,7 @@ static int area_split_init(bContext *C, wmOperator *op) if (dir == 'h' && sa->winy < 2 * areaminy) return 0; /* custom data */ - sd = (sAreaSplitData *)MEM_callocN(sizeof (sAreaSplitData), "op_area_split"); + sd = (sAreaSplitData *)MEM_callocN(sizeof(sAreaSplitData), "op_area_split"); op->customdata = sd; sd->sarea = sa; @@ -2180,7 +2180,7 @@ static int area_join_init(bContext *C, wmOperator *op) return 0; } - jd = (sAreaJoinData *)MEM_callocN(sizeof (sAreaJoinData), "op_area_join"); + jd = (sAreaJoinData *)MEM_callocN(sizeof(sAreaJoinData), "op_area_join"); jd->sa1 = sa1; jd->sa1->flag |= AREA_FLAG_DRAWJOINFROM; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 4dee83dbb82..b0867608840 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5096,8 +5096,8 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) /* This can be removed once fixed properly in * BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user) - * at zero pressure we should do nothing 1/2^12 is .0002 which is the sensitivity of the most sensitive pen tablet available */ - if (tablet && (pressure < .0002f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || BKE_brush_use_alpha_pressure(scene, pop->s.brush) || BKE_brush_use_size_pressure(scene, pop->s.brush))) + * at zero pressure we should do nothing 1/2^12 is 0.0002 which is the sensitivity of the most sensitive pen tablet available */ + if (tablet && (pressure < 0.0002f) && ((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) || BKE_brush_use_alpha_pressure(scene, pop->s.brush) || BKE_brush_use_size_pressure(scene, pop->s.brush))) return; } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 32e6f588e27..59e47363a22 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -550,7 +550,7 @@ static void image_keymap(struct wmKeyConfig *keyconf) /* fast switch to render slots */ for (i = 0; i < MAX2(IMA_MAX_RENDER_SLOT, 9); i++) { - kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY+i, KM_PRESS, 0, 0); + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY + i, KM_PRESS, 0, 0); RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot"); RNA_int_set(kmi->ptr, "value", i); } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 8aa56823baf..4ed9acf1481 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1002,7 +1002,7 @@ static void node_draw_frame(const bContext *C, ARegion *ar, SpaceNode *snode, bN glDisable(GL_BLEND); /* outline active and selected emphasis */ - if (node->flag & (NODE_ACTIVE | SELECT) ) { + if (node->flag & (NODE_ACTIVE | SELECT)) { glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH); @@ -1105,7 +1105,7 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED( /* XXX only kept for debugging * selection state is indicated by socket outline below! */ - #if 0 +#if 0 /* body */ uiSetRoundBox(15); UI_ThemeColor4(TH_NODE); @@ -1116,18 +1116,18 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED( /* outline active and selected emphasis */ if (node->flag & (NODE_ACTIVE | SELECT)) { glEnable(GL_BLEND); - glEnable( GL_LINE_SMOOTH ); + glEnable(GL_LINE_SMOOTH); /* using different shades of TH_TEXT_HI for the empasis, like triangle */ - if( node->flag & NODE_ACTIVE ) + if (node->flag & NODE_ACTIVE) UI_ThemeColorShadeAlpha(TH_TEXT_HI, 0, -40); else UI_ThemeColorShadeAlpha(TH_TEXT_HI, -20, -120); uiDrawBox(GL_LINE_LOOP, rct->xmin, rct->ymin, rct->xmax, rct->ymax, size); - glDisable( GL_LINE_SMOOTH ); + glDisable(GL_LINE_SMOOTH); glDisable(GL_BLEND); } - #endif +#endif /* only draw input socket. as they all are placed on the same position. * highlight also if node itself is selected, since we don't display the node body separately! @@ -1194,7 +1194,7 @@ static void node_buts_image_user(uiLayout *layout, bContext *C, PointerRNA *imap uiLayout *col; int source; - if(!imaptr->data) + if (!imaptr->data) return; col = uiLayoutColumn(layout, 0); @@ -2429,7 +2429,7 @@ static void node_composit_buts_viewer_but(uiLayout *layout, bContext *UNUSED(C), static void node_composit_buts_mask(uiLayout *layout, bContext *C, PointerRNA *ptr) { uiTemplateID(layout, C, ptr, "mask", NULL, NULL, NULL); - uiItemR(layout, ptr, "smooth_mask", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "smooth_mask", 0, NULL, ICON_NONE); } diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 463a262c09c..8be5b644afb 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -825,7 +825,7 @@ typedef struct DrawCache { static void text_drawcache_init(SpaceText *st) { - DrawCache *drawcache = MEM_callocN(sizeof (DrawCache), "text draw cache"); + DrawCache *drawcache = MEM_callocN(sizeof(DrawCache), "text draw cache"); drawcache->winx = -1; drawcache->nlines = BLI_countlist(&st->text->lines); diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 43252111303..7d39a89a130 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -431,7 +431,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float min[3], float max[3], int r } tend(); - // printf ( "Draw Time: %f\n",( float ) tval() ); + // printf ( "Draw Time: %f\n",(float) tval() ); if (tex_shadow) GPU_texture_unbind(tex_shadow); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index d632314f3ca..cc3d2d383b8 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1669,7 +1669,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op) if (rv3d->camzoom > RV3D_CAMZOOM_MAX) rv3d->camzoom = RV3D_CAMZOOM_MAX; } else if (rv3d->dist > 0.001f * v3d->grid) { - view_zoom_mouseloc(ar, .83333f, mx, my); + view_zoom_mouseloc(ar, 0.83333f, mx, my); } } @@ -1921,7 +1921,7 @@ static int viewdolly_exec(bContext *C, wmOperator *op) view_dolly_mouseloc(ar, rv3d->ofs, mousevec, 1.2f); } else { - view_dolly_mouseloc(ar, rv3d->ofs, mousevec, .83333f); + view_dolly_mouseloc(ar, rv3d->ofs, mousevec, 0.83333f); } if (rv3d->viewlock & RV3D_BOXVIEW) diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 9ebd43cd0d1..90b67951614 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -221,7 +221,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t) setlinestyle(0); cpack(0x0); fdrawline(-0.020 / w, 0, -0.1 / w, 0); - fdrawline(0.1 / w, 0, .020 / w, 0); + fdrawline(0.1 / w, 0, 0.020 / w, 0); fdrawline(0, -0.020 / h, 0, -0.1 / h); fdrawline(0, 0.1 / h, 0, 0.020 / h); |