[Bf-blender-cvs] [ced1978] master: Fix mismatch (missing 'const' to mactch funcs declarations).

Bastien Montagne noreply at git.blender.org
Mon Feb 23 13:57:17 CET 2015


Commit: ced19783fdd31f127593f523772026a40f8655b4
Author: Bastien Montagne
Date:   Mon Feb 23 13:55:11 2015 +0100
Branches: master
https://developer.blender.org/rBced19783fdd31f127593f523772026a40f8655b4

Fix mismatch (missing 'const' to mactch funcs declarations).

Was breaking windows compile, reported by bdancer over IRC, thanks.

Also, quite some annoying 'unused vars' warnings (debug-only vars).

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

M	source/blender/bmesh/intern/bmesh_interp.c
M	source/blender/bmesh/intern/bmesh_queries.c
M	source/blender/bmesh/tools/bmesh_decimate_collapse.c
M	source/blender/python/bmesh/bmesh_py_utils.c

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

diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c
index c0add42..f745972 100644
--- a/source/blender/bmesh/intern/bmesh_interp.c
+++ b/source/blender/bmesh/intern/bmesh_interp.c
@@ -821,6 +821,7 @@ void BM_data_layer_free(BMesh *bm, CustomData *data, int type)
 	has_layer = CustomData_free_layer_active(data, type, 0);
 	/* assert because its expensive to realloc - better not do if layer isnt present */
 	BLI_assert(has_layer != false);
+	UNUSED_VARS_NDEBUG(has_layer);
 
 	update_data_blocks(bm, &olddata, data);
 	if (olddata.layers) MEM_freeN(olddata.layers);
@@ -840,7 +841,8 @@ void BM_data_layer_free_n(BMesh *bm, CustomData *data, int type, int n)
 	has_layer = CustomData_free_layer(data, type, 0, CustomData_get_layer_index_n(data, type, n));
 	/* assert because its expensive to realloc - better not do if layer isnt present */
 	BLI_assert(has_layer != false);
-	
+	UNUSED_VARS_NDEBUG(has_layer);
+
 	update_data_blocks(bm, &olddata, data);
 	if (olddata.layers) MEM_freeN(olddata.layers);
 }
@@ -1001,7 +1003,7 @@ static void bm_loop_walk_data(struct LoopWalkCtx *lwc, BMLoop *l_walk)
 }
 
 LinkNode *BM_vert_loop_groups_data_layer_create(
-        BMesh *bm, BMVert *v, int layer_n, const float *loop_weights, MemArena *arena)
+        BMesh *bm, BMVert *v, const int layer_n, const float *loop_weights, MemArena *arena)
 {
 	struct LoopWalkCtx lwc;
 	LinkNode *groups = NULL;
@@ -1135,7 +1137,8 @@ void BM_vert_loop_groups_data_layer_merge(BMesh *bm, LinkNode *groups, const int
  * A version of #BM_vert_loop_groups_data_layer_merge
  * that takes an array of loop-weights (aligned with #BM_LOOPS_OF_VERT iterator)
  */
-void BM_vert_loop_groups_data_layer_merge_weights(BMesh *bm, LinkNode *groups, int layer_n, const float *loop_weights)
+void BM_vert_loop_groups_data_layer_merge_weights(
+        BMesh *bm, LinkNode *groups, const int layer_n, const float *loop_weights)
 {
 	const int type = bm->ldata.layers[layer_n].type;
 	const int size = CustomData_sizeof(type);
@@ -1146,4 +1149,4 @@ void BM_vert_loop_groups_data_layer_merge_weights(BMesh *bm, LinkNode *groups, i
 	} while ((groups = groups->next));
 }
 
-/** \} */
\ No newline at end of file
+/** \} */
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c
index 4d2361a..c3fa1e6 100644
--- a/source/blender/bmesh/intern/bmesh_queries.c
+++ b/source/blender/bmesh/intern/bmesh_queries.c
@@ -2178,6 +2178,7 @@ int BM_mesh_calc_face_groups(BMesh *bm, int *r_groups_array, int (**r_group_inde
 		}
 
 		BLI_assert(ok == true);
+		UNUSED_VARS_NDEBUG(ok);
 
 		/* manage arrays */
 		if (group_index_len == group_curr) {
@@ -2332,6 +2333,7 @@ int BM_mesh_calc_edge_groups(BMesh *bm, int *r_groups_array, int (**r_group_inde
 		}
 
 		BLI_assert(ok == true);
+		UNUSED_VARS_NDEBUG(ok);
 
 		/* manage arrays */
 		if (group_index_len == group_curr) {
diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
index 230cb30..811a144 100644
--- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c
+++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
@@ -723,6 +723,7 @@ static bool bm_edge_collapse(BMesh *bm, BMEdge *e_clear, BMVert *v_clear, int r_
 		BLI_assert(ok == true);
 		BLI_assert(l_a->f->len == 3);
 		BLI_assert(l_b->f->len == 3);
+		UNUSED_VARS_NDEBUG(ok);
 
 		/* keep 'v_clear' 0th */
 		if (BM_vert_in_edge(l_a->prev->e, v_clear)) {
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index 0b667ab..2e32a57 100644
--- a/source/blender/python/bmesh/bmesh_py_utils.c
+++ b/source/blender/python/bmesh/bmesh_py_utils.c
@@ -255,6 +255,7 @@ static PyObject *bpy_bm_utils_vert_splice(PyObject *UNUSED(self), PyObject *args
 	/* should always succeed */
 	ok = BM_vert_splice(bm, py_vert->v, py_vert_target->v);
 	BLI_assert(ok == true);
+	UNUSED_VARS_NDEBUG(ok);
 
 	Py_RETURN_NONE;
 }




More information about the Bf-blender-cvs mailing list