[Bf-blender-cvs] [a99a8a6] master: Code cleanup: style and warnings

Campbell Barton noreply at git.blender.org
Tue Mar 25 21:59:14 CET 2014


Commit: a99a8a60705216c42368054e9bc78d012084b5fa
Author: Campbell Barton
Date:   Wed Mar 26 07:48:51 2014 +1100
https://developer.blender.org/rBa99a8a60705216c42368054e9bc78d012084b5fa

Code cleanup: style and warnings

===================================================================

M	intern/guardedalloc/intern/mallocn_guarded_impl.c
M	intern/guardedalloc/intern/mallocn_lockfree_impl.c
M	source/blender/blenkernel/intern/mball.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/space_clip/clip_ops.c
M	source/blender/editors/space_view3d/view3d_view.c
M	source/blender/makesrna/intern/rna_curve.c
M	source/blender/nodes/shader/nodes/node_shader_tex_wave.c

===================================================================

diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.c b/intern/guardedalloc/intern/mallocn_guarded_impl.c
index 352d18d..7a8545d 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 2c7c087..1d131ed 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 9e83d97..39da067 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 7e5df86..8bbee49 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 124852c..d9a2ccb 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 102d8c7..fa3e511 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 a4d099c..ee6d9df 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 7dc97ad..ef79aac 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},




More information about the Bf-blender-cvs mailing list