From a99a8a60705216c42368054e9bc78d012084b5fa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 26 Mar 2014 07:48:51 +1100 Subject: Code cleanup: style and warnings --- intern/guardedalloc/intern/mallocn_guarded_impl.c | 2 +- intern/guardedalloc/intern/mallocn_lockfree_impl.c | 2 +- source/blender/blenkernel/intern/mball.c | 3 ++- source/blender/editors/sculpt_paint/sculpt.c | 2 +- source/blender/editors/space_clip/clip_ops.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 2 +- source/blender/makesrna/intern/rna_curve.c | 2 ++ source/blender/nodes/shader/nodes/node_shader_tex_wave.c | 2 -- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.c b/intern/guardedalloc/intern/mallocn_guarded_impl.c index 352d18df732..7a8545de524 100644 --- a/intern/guardedalloc/intern/mallocn_guarded_impl.c +++ b/intern/guardedalloc/intern/mallocn_guarded_impl.c @@ -544,7 +544,7 @@ void *MEM_guarded_mapallocN(size_t len, const char *str) /* on 64 bit, simply use calloc instead, as mmap does not support * allocating > 4 GB on Windows. the only reason mapalloc exists * is to get around address space limitations in 32 bit OSes. */ - if(sizeof(void*) >= 8) + if (sizeof(void *) >= 8) return MEM_guarded_callocN(len, str); len = SIZET_ALIGN_4(len); diff --git a/intern/guardedalloc/intern/mallocn_lockfree_impl.c b/intern/guardedalloc/intern/mallocn_lockfree_impl.c index 2c7c087966a..1d131ed339a 100644 --- a/intern/guardedalloc/intern/mallocn_lockfree_impl.c +++ b/intern/guardedalloc/intern/mallocn_lockfree_impl.c @@ -268,7 +268,7 @@ void *MEM_lockfree_mapallocN(size_t len, const char *str) /* on 64 bit, simply use calloc instead, as mmap does not support * allocating > 4 GB on Windows. the only reason mapalloc exists * is to get around address space limitations in 32 bit OSes. */ - if(sizeof(void*) >= 8) + if (sizeof(void *) >= 8) return MEM_lockfree_callocN(len, str); len = SIZET_ALIGN_4(len); diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 9e83d97b450..39da0676f5e 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -751,7 +751,8 @@ static octal_node *find_metaball_octal_node(octal_node *node, float x, float y, } } - return node; + /* all cases accounted for */ + BLI_assert(0); } static float metaball(PROCESS *process, float x, float y, float z) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 7e5df865093..8bbee491d7a 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5381,8 +5381,8 @@ static int sculpt_sample_detail_size_modal(bContext *C, wmOperator *op, const wm ScrArea *sa = CTX_wm_area(C); WM_cursor_modal_restore(CTX_wm_window(C)); ED_area_headerprint(sa, NULL); + return OPERATOR_CANCELLED; - break; } } diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 124852c5182..d9a2ccbe70e 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -115,7 +115,7 @@ static void sclip_zoom_set(const bContext *C, float zoom, float location[2]) ED_space_clip_get_size(sc, &width, &height); dx = ((location[0] - 0.5f) * width - sc->xof) * (sc->zoom - oldzoom) / sc->zoom; - dy= ((location[1] - 0.5f) * height - sc->yof) * (sc->zoom - oldzoom) / sc->zoom; + dy = ((location[1] - 0.5f) * height - sc->yof) * (sc->zoom - oldzoom) / sc->zoom; if (sc->flag & SC_LOCK_SELECTION) { sc->xlockof += dx; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 102d8c77366..fa3e511f945 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -834,7 +834,7 @@ static float view3d_quat_axis[6][4] = { {0.5f, -0.5f, -0.5f, -0.5f}, /* RV3D_VIEW_RIGHT */ {1.0f, 0.0f, 0.0f, 0.0f}, /* RV3D_VIEW_TOP */ {0.0f, -1.0f, 0.0f, 0.0f}, /* RV3D_VIEW_BOTTOM */ - }; +}; bool ED_view3d_quat_from_axis_view(const char view, float quat[4]) diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index a4d099c69c7..ee6d9df1726 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -114,6 +114,7 @@ static const EnumPropertyItem curve3d_fill_mode_items[] = { {0, NULL, 0, NULL, NULL} }; +#ifdef RNA_RUNTIME static const EnumPropertyItem curve2d_fill_mode_items[] = { {0, "NONE", 0, "None", ""}, {CU_BACK, "BACK", 0, "Back", ""}, @@ -121,6 +122,7 @@ static const EnumPropertyItem curve2d_fill_mode_items[] = { {CU_FRONT | CU_BACK, "BOTH", 0, "Both", ""}, {0, NULL, 0, NULL, NULL} }; +#endif #ifdef RNA_RUNTIME diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c index 7dc97ad5eab..ef79aac0d32 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_wave.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_wave.c @@ -38,8 +38,6 @@ static bNodeSocketTemplate sh_node_tex_wave_in[] = { { -1, 0, "" } }; -const bool internal_links[5] = {0, 0, 0, 0, 0}; - static bNodeSocketTemplate sh_node_tex_wave_out[] = { { SOCK_RGBA, 0, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_NO_INTERNAL_LINK}, { SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR, SOCK_NO_INTERNAL_LINK}, -- cgit v1.2.3