[Bf-blender-cvs] [543ddbe6bfa] master: Cleanup: warnings (clang)

Campbell Barton noreply at git.blender.org
Sun Dec 30 05:13:39 CET 2018


Commit: 543ddbe6bfa8072b4c09ccc9abe27237d3598db5
Author: Campbell Barton
Date:   Sun Dec 30 15:14:00 2018 +1100
Branches: master
https://developer.blender.org/rB543ddbe6bfa8072b4c09ccc9abe27237d3598db5

Cleanup: warnings (clang)

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

M	source/blender/blenlib/intern/BLI_timer.c
M	source/blender/blenlib/intern/noise.c
M	source/blender/bmesh/tools/bmesh_bevel.c
M	source/blender/draw/engines/eevee/eevee_shaders.c
M	source/blender/draw/engines/workbench/workbench_volume.c
M	source/blender/draw/intern/draw_cache.c
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/editors/gpencil/annotate_paint.c
M	source/blender/editors/gpencil/gpencil_intern.h
M	source/blender/gpu/intern/gpu_framebuffer.c
M	source/blender/imbuf/intern/colormanagement.c
M	source/blender/makesrna/intern/rna_gpencil.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/modifiers/intern/MOD_build.c
M	source/blender/modifiers/intern/MOD_particleinstance.c

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

diff --git a/source/blender/blenlib/intern/BLI_timer.c b/source/blender/blenlib/intern/BLI_timer.c
index 7bb919d47e0..fdd89771077 100644
--- a/source/blender/blenlib/intern/BLI_timer.c
+++ b/source/blender/blenlib/intern/BLI_timer.c
@@ -50,7 +50,7 @@ typedef struct TimerContainer {
 	bool file_load_cb_registered;
 } TimerContainer;
 
-static TimerContainer GlobalTimer = { 0 };
+static TimerContainer GlobalTimer = {{0}};
 
 static void ensure_callback_is_registered(void);
 
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index 8ee99544ca5..ee2bab11ade 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -188,7 +188,7 @@ const unsigned char hash[512] = {
 };
 
 
-const float hashvectf[768] = {
+static const float hashvectf[768] = {
 	0.33783, 0.715698, -0.611206, -0.944031, -0.326599, -0.045624, -0.101074, -0.416443, -0.903503, 0.799286, 0.49411,
 	-0.341949, -0.854645, 0.518036, 0.033936, 0.42514, -0.437866, -0.792114, -0.358948, 0.597046, 0.717377, -0.985413,
 	0.144714, 0.089294, -0.601776, -0.33728, -0.723907, -0.449921, 0.594513, 0.666382, 0.208313, -0.10791, 0.972076,
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index f0c2a343d4a..e48616ea231 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -1741,9 +1741,8 @@ static void bevel_harden_normals_mode(BevelParams *bp, BevVert *bv, BMOperator *
 		/* Set normals.out for vertices as computed earlier */
 		if (BMO_slot_map_contains(nslot, bcur->nv.v) != true) {
 
-			float(*vert_normal) = MEM_callocN(sizeof(*vert_normal) * 3, __func__);
-			add_v3_v3(vert_normal, n_final);
-			normalize_v3(vert_normal);
+			float *vert_normal = MEM_mallocN(sizeof(*vert_normal) * 3, __func__);
+			normalize_v3_v3(vert_normal, n_final);
 
 			BMO_slot_map_insert(op, nslot, bcur->nv.v, vert_normal);
 		}
diff --git a/source/blender/draw/engines/eevee/eevee_shaders.c b/source/blender/draw/engines/eevee/eevee_shaders.c
index 6fbd0ae5173..29b30e7763e 100644
--- a/source/blender/draw/engines/eevee/eevee_shaders.c
+++ b/source/blender/draw/engines/eevee/eevee_shaders.c
@@ -33,7 +33,7 @@
 
 #include "eevee_private.h"
 
-const char *filter_defines = "#define HAMMERSLEY_SIZE " STRINGIFY(HAMMERSLEY_SIZE) "\n"
+static const char *filter_defines = "#define HAMMERSLEY_SIZE " STRINGIFY(HAMMERSLEY_SIZE) "\n"
 #if defined(IRRADIANCE_SH_L2)
 	                             "#define IRRADIANCE_SH_L2\n"
 #elif defined(IRRADIANCE_CUBEMAP)
diff --git a/source/blender/draw/engines/workbench/workbench_volume.c b/source/blender/draw/engines/workbench/workbench_volume.c
index a4cd81e7fd2..408212f6814 100644
--- a/source/blender/draw/engines/workbench/workbench_volume.c
+++ b/source/blender/draw/engines/workbench/workbench_volume.c
@@ -52,7 +52,7 @@ static struct {
 	struct GPUShader *volume_slice_coba_sh;
 	struct GPUTexture *dummy_tex;
 	struct GPUTexture *dummy_coba_tex;
-} e_data = {NULL};
+} e_data = {{NULL}};
 
 extern char datatoc_workbench_volume_vert_glsl[];
 extern char datatoc_workbench_volume_frag_glsl[];
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index ff4fb0c85f6..f0a147f17b1 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -2714,7 +2714,7 @@ GPUBatch *DRW_cache_bone_arrows_get(void)
 	return SHC.drw_bone_arrows;
 }
 
-const float staticSine[16] = {
+static const float staticSine[16] = {
 	0.0f, 0.104528463268f, 0.207911690818f, 0.309016994375f,
 	0.406736643076f, 0.5f, 0.587785252292f, 0.669130606359f,
 	0.743144825477f, 0.809016994375f, 0.866025403784f,
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 30a940e27f6..9d9f7c47b14 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -268,7 +268,7 @@ typedef struct MeshRenderData {
 	int *loose_verts;
 
 	float (*poly_normals)[3];
-	float (*vert_weight);
+	float *vert_weight;
 	char (*vert_color)[3];
 	GPUPackedNormal *poly_normals_pack;
 	GPUPackedNormal *vert_normals_pack;
@@ -1422,7 +1422,7 @@ static float evaluate_vertex_weight(const MDeformVert *dvert, const DRW_MeshWeig
 /** Ensure #MeshRenderData.vert_weight */
 static void mesh_render_data_ensure_vert_weight(MeshRenderData *rdata, const struct DRW_MeshWeightState *wstate)
 {
-	float (*vweight) = rdata->vert_weight;
+	float *vweight = rdata->vert_weight;
 	if (vweight == NULL) {
 		if (wstate->defgroup_active == -1) {
 			goto fallback;
@@ -3245,7 +3245,7 @@ static void mesh_create_weights(MeshRenderData *rdata, GPUVertBuf *vbo, DRW_Mesh
 	const int vbo_len_capacity = mesh_render_data_verts_len_get_maybe_mapped(rdata);
 
 	mesh_render_data_ensure_vert_weight(rdata, wstate);
-	const float (*vert_weight) = rdata->vert_weight;
+	const float *vert_weight = rdata->vert_weight;
 
 	GPU_vertbuf_init_with_format(vbo, &format);
 	/* Meh, another allocation / copy for no benefit.
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index a868e98e3dd..b6f81c81823 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -1697,8 +1697,8 @@ static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event, Depsg
 	/* verify key status for straight lines */
 	if ((event->ctrl > 0) || (event->alt > 0)) {
 		if (p->straight[0] == 0) {
-			int dx = abs(p->mval[0] - p->mvalo[0]);
-			int dy = abs(p->mval[1] - p->mvalo[1]);
+			int dx = abs((int)(p->mval[0] - p->mvalo[0]));
+			int dy = abs((int)(p->mval[1] - p->mvalo[1]));
 			if ((dx > 0) || (dy > 0)) {
 				/* check mouse direction to replace the other coordinate with previous values */
 				if (dx >= dy) {
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index 71d293d5244..aaeb2603acc 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -508,7 +508,7 @@ struct GP_EditableStrokes_Iter {
  */
 #define GP_EDITABLE_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)                           \
 {                                                                                       \
-	struct GP_EditableStrokes_Iter gpstroke_iter = {0};                                 \
+	struct GP_EditableStrokes_Iter gpstroke_iter = {{{0}}};                             \
 	Depsgraph *depsgraph_ = CTX_data_depsgraph(C);                                      \
 	Object *obact_ = CTX_data_active_object(C);                                         \
 	bGPdata *gpd_ = CTX_data_gpencil_data(C);                                           \
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c
index 8714c72686c..915a7669326 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -479,7 +479,7 @@ static void gpu_framebuffer_update_attachments_and_fill_empty_slots(GPUFrameBuff
 static struct {
 	GPUFrameBuffer *framebuffers[FRAMEBUFFER_STACK_DEPTH];
 	uint top;
-} FrameBufferStack = { 0 };
+} FrameBufferStack = {{0}};
 
 static void gpuPushFrameBuffer(GPUFrameBuffer *fbo)
 {
diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c
index 395bb90d686..887e2390718 100644
--- a/source/blender/imbuf/intern/colormanagement.c
+++ b/source/blender/imbuf/intern/colormanagement.c
@@ -97,8 +97,8 @@ static int global_tot_looks = 0;
 float imbuf_luma_coefficients[3] = {0.0f};
 float imbuf_xyz_to_rgb[3][3] = {{0.0f}};
 float imbuf_rgb_to_xyz[3][3] = {{0.0f}};
-float imbuf_xyz_to_linear_srgb[3][3] = {{0.0f}};
-float imbuf_linear_srgb_to_xyz[3][3] = {{0.0f}};
+static float imbuf_xyz_to_linear_srgb[3][3] = {{0.0f}};
+static float imbuf_linear_srgb_to_xyz[3][3] = {{0.0f}};
 
 /* lock used by pre-cached processors getters, so processor wouldn't
  * be created several times
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 92d29b4c2c5..e632bf36d67 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -72,7 +72,7 @@ static EnumPropertyItem rna_enum_gpencil_onion_modes_items[] = {
 	{0, NULL, 0, NULL, NULL}
 };
 
-const EnumPropertyItem rna_enum_gplayer_move_type_items[] = {
+static const EnumPropertyItem rna_enum_gplayer_move_type_items[] = {
    {-1, "UP", 0, "Up", ""},
    {1, "DOWN", 0, "Down", ""},
    {0, NULL, 0, NULL, NULL}
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 411c6af5a3f..661a3c25e45 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -110,7 +110,7 @@ const EnumPropertyItem rna_enum_object_empty_drawtype_items[] = {
 	{0, NULL, 0, NULL, NULL}
 };
 
-const EnumPropertyItem rna_enum_object_empty_image_depth_items[] = {
+static const EnumPropertyItem rna_enum_object_empty_image_depth_items[] = {
 	{OB_EMPTY_IMAGE_DEPTH_DEFAULT, "DEFAULT", 0, "Default", ""},
 	{OB_EMPTY_IMAGE_DEPTH_FRONT, "FRONT", 0, "Front", ""},
 	{OB_EMPTY_IMAGE_DEPTH_BACK, "BACK", 0, "Back", ""},
diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c
index e2c13d02827..77f607d19a2 100644
--- a/source/blender/modifiers/intern/MOD_build.c
+++ b/source/blender/modifiers/intern/MOD_build.c
@@ -32,7 +32,6 @@
  *  \ingroup modifiers
  */
 
-
 #include "MEM_guardedalloc.h"
 
 #include "BLI_utildefines.h"
@@ -51,6 +50,8 @@
 #include "BKE_particle.h"
 #include "BKE_scene.h"
 
+#include "MOD_modifiertypes.h"
+
 static void initData(ModifierData *md)
 {
 	BuildModifierData *bmd = (BuildModifierData *) md;
diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c
index 0a5b34c90ee..fa305f4c8a7 100644
--- a/source/blender/modifiers/intern/MOD_particleinstance.c
+++ b/source/blender/modifiers/intern/MOD_par

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list