[Bf-blender-cvs] [6a1d59c188f] greasepencil-object: Cleanup: quiet warnings for GCC

Campbell Barton noreply at git.blender.org
Mon Sep 18 11:43:38 CEST 2017


Commit: 6a1d59c188f3e34a6e24785339be1ec8d344f053
Author: Campbell Barton
Date:   Mon Sep 18 19:50:50 2017 +1000
Branches: greasepencil-object
https://developer.blender.org/rB6a1d59c188f3e34a6e24785339be1ec8d344f053

Cleanup: quiet warnings for GCC

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

M	source/blender/blenkernel/BKE_gpencil.h
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/gpencil_modifier.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M	source/blender/draw/engines/gpencil/gpencil_engine.c
M	source/blender/draw/engines/gpencil/gpencil_geom.c
M	source/blender/draw/engines/gpencil/gpencil_vfx.c
M	source/blender/editors/gpencil/gpencil_brush.c
M	source/blender/editors/gpencil/gpencil_data.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/object/object_add.c
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_gpencil.c
M	source/blender/modifiers/intern/MOD_gpencilarray.c
M	source/blender/modifiers/intern/MOD_gpencilcolor.c
M	source/blender/modifiers/intern/MOD_gpencildupli.c
M	source/blender/modifiers/intern/MOD_gpencillattice.c
M	source/blender/modifiers/intern/MOD_gpencilnoise.c
M	source/blender/modifiers/intern/MOD_gpencilopacity.c
M	source/blender/modifiers/intern/MOD_gpencilsimplify.c
M	source/blender/modifiers/intern/MOD_gpencilsubdiv.c
M	source/blender/modifiers/intern/MOD_gpencilthick.c
M	source/blender/modifiers/intern/MOD_gpenciltint.c

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

diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index 78c4486a998..a1f5f941229 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -31,11 +31,13 @@
  *  \author Joshua Leung
  */
 
+struct bContext;
 struct ToolSettings;
 struct ListBase;
 struct bGPdata;
 struct bGPDlayer;
 struct bGPDframe;
+struct bGPDspoint;
 struct bGPDstroke;
 struct bGPDpalette;
 struct bGPDpalettecolor;
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index f4dfaa57720..cdc2e8f6982 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -139,7 +139,7 @@ bool BKE_gpencil_free_strokes(bGPDframe *gpf)
 }
 
 /* Free strokes and colors belonging to a gp-frame */
-bool BKE_gpencil_free_layer_temp_data(bGPDlayer *gpl, bGPDframe *derived_gpf)
+bool BKE_gpencil_free_layer_temp_data(bGPDlayer *UNUSED(gpl), bGPDframe *derived_gpf)
 {
 	bGPDstroke *gps_next;
 	if (!derived_gpf) {
@@ -1670,7 +1670,7 @@ void BKE_gpencil_batch_cache_alldirty()
 }
 
 /* get stroke min max values */
-void static gpencil_minmax(bGPdata *gpd, float min[3], float max[3])
+static void gpencil_minmax(bGPdata *gpd, float min[3], float max[3])
 {
 	int i;
 	bGPDspoint *pt;
@@ -1859,8 +1859,9 @@ static void gpencil_add_points(bGPDstroke *gps, float *array, int totpoints)
 	}
 }
 
-static bGPDstroke *gpencil_add_stroke(bGPDframe *gpf, Palette *palette, PaletteColor *palcolor, int totpoints, 
-	char *colorname, short thickness)
+static bGPDstroke *gpencil_add_stroke(
+        bGPDframe *gpf, Palette *palette, PaletteColor *palcolor, int totpoints,
+        const char *colorname, short thickness)
 {
 	/* allocate memory for a new stroke */
 	bGPDstroke *gps = MEM_callocN(sizeof(bGPDstroke), "gp_stroke");
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index ae1db303ed7..81f599faef4 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -794,13 +794,12 @@ static void gpencil_stroke_project_2d(const bGPDspoint *points, int totpoints, t
 * Ramer - Douglas - Peucker algorithm
 * by http ://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
 * -------------------------------------------------------------------------- */
-void gpencil_rdp_stroke(bGPDstroke *gps, tbGPDspoint *points2d, float epsilon)
+static void gpencil_rdp_stroke(bGPDstroke *gps, tbGPDspoint *points2d, float epsilon)
 {
 	tbGPDspoint *old_points2d = points2d;
 	int totpoints = gps->totpoints;
 	char *marked = NULL;
 	char work;
-	int i;
 
 	int start = 1;
 	int end = gps->totpoints - 2;
@@ -835,7 +834,7 @@ void gpencil_rdp_stroke(bGPDstroke *gps, tbGPDspoint *points2d, float epsilon)
 			v1[1] = old_points2d[le].p2d[0] - old_points2d[ls].p2d[0];
 			v1[0] = old_points2d[ls].p2d[1] - old_points2d[le].p2d[1];
 
-			for (i = ls + 1; i < le; i++) {
+			for (int i = ls + 1; i < le; i++) {
 				float mul;
 				float dist;
 				float v2[2];
@@ -895,7 +894,7 @@ void gpencil_rdp_stroke(bGPDstroke *gps, tbGPDspoint *points2d, float epsilon)
 }
 
 /* (wrapper api) simplify stroke using Ramer-Douglas-Peucker algorithm */
-void BKE_gpencil_simplify_stroke(bGPDlayer *gpl, bGPDstroke *gps, float factor)
+void BKE_gpencil_simplify_stroke(bGPDlayer *UNUSED(gpl), bGPDstroke *gps, float factor)
 {
 	/* first create temp data and convert points to 2D */
 	tbGPDspoint *points2d = MEM_mallocN(sizeof(tbGPDspoint) * gps->totpoints, "GP Stroke temp 2d points");
@@ -955,7 +954,7 @@ bool BKE_gpencil_has_geometry_modifiers(Object *ob)
 }
 
 /* apply stroke modifiers */
-void BKE_gpencil_stroke_modifiers(Object *ob, bGPDlayer *gpl, bGPDframe *gpf, bGPDstroke *gps)
+void BKE_gpencil_stroke_modifiers(Object *ob, bGPDlayer *gpl, bGPDframe *UNUSED(gpf), bGPDstroke *gps)
 {
 	ModifierData *md;
 	bGPdata *gpd = ob->gpd;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 69862f4abb8..042b7d1a5c9 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6528,12 +6528,11 @@ static void lib_link_gpencil(FileData *fd, Main *main)
 	int palette_count = BLI_listbase_count(&main->palettes);
 	GHash **gp_palettecolors_buffer = MEM_mallocN(sizeof(struct GHash *) * palette_count, "Hash Palettes Array");
 	int i = 0;
-	for (Palette *palette = main->palettes.first; palette; palette = palette->id.next) {
+	for (Palette *palette = main->palettes.first; palette; palette = palette->id.next, i++) {
 		gp_palettecolors_buffer[i] = BLI_ghash_str_new("GPencil Hash Colors");
 		for (PaletteColor *palcolor = palette->colors.first; palcolor; palcolor = palcolor->next) {
 			BLI_ghash_insert(gp_palettecolors_buffer[i], palcolor->info, palcolor);
 		}
-		++i;
 	}
 
 	for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) {
@@ -6567,7 +6566,7 @@ static void lib_link_gpencil(FileData *fd, Main *main)
 	}
 
 	/* free hash buffer */
-	for (int i = 0; i < palette_count; ++i) {
+	for (i = 0; i < palette_count; ++i) {
 		if (gp_palettecolors_buffer[i]) {
 			BLI_ghash_free(gp_palettecolors_buffer[i], NULL, NULL);
 			gp_palettecolors_buffer[i] = NULL;
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 2c8b0a0f1e5..5f0d212e0e3 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -143,8 +143,11 @@ void BLO_update_defaults_startup_blend(Main *bmain)
 			if (ts->gp_sculpt.brush[0].size == 0) {
 				GP_BrushEdit_Settings *gset = &ts->gp_sculpt;
 				GP_EditBrush_Data *brush;
-				float curcolor[3], curcolor_add[3], curcolor_sub[3];
+				float curcolor_add[3], curcolor_sub[3];
+#if 0
+				float curcolor[3];
 				ARRAY_SET_ITEMS(curcolor, 1.0f, 1.0f, 1.0f);
+#endif
 				ARRAY_SET_ITEMS(curcolor_add, 1.0f, 0.6f, 0.6f);
 				ARRAY_SET_ITEMS(curcolor_sub, 0.6f, 0.6f, 1.0f);
 
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index a06b2b3ebd4..47126c9b4cb 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -159,7 +159,7 @@ static void gpencil_batch_cache_resize(GpencilBatchCache *cache, int slots)
 }
 
 /* check size and increase if no free slots */
-static void gpencil_batch_cache_check_free_slots(Object *ob, bGPdata *gpd)
+static void gpencil_batch_cache_check_free_slots(Object *ob, bGPdata *UNUSED(gpd))
 {
 	GpencilBatchCache *cache = gpencil_batch_get_element(ob);
 
@@ -607,7 +607,6 @@ static void gpencil_add_editpoints_shgroup(GPENCIL_StorageList *stl, GpencilBatc
 	if ((gpl->flag & GP_LAYER_LOCKED) == 0 && (gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE)))
 	{
 		const DRWContextState *draw_ctx = DRW_context_state_get();
-		Scene *scene = draw_ctx->scene;
 		Object *obact = draw_ctx->obact;
 		bool is_weight_paint = (gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE);
 
@@ -836,8 +835,9 @@ void DRW_gpencil_populate_buffer_strokes(void *vedata, ToolSettings *ts, Object
 }
 
 /* draw onion-skinning for a layer */
-static void gpencil_draw_onionskins(GpencilBatchCache *cache, GPENCIL_e_data *e_data, void *vedata,
-	ToolSettings *ts, Object *ob, bGPdata *gpd, bGPDlayer *gpl, bGPDframe *gpf)
+static void gpencil_draw_onionskins(
+        GpencilBatchCache *cache, GPENCIL_e_data *e_data, void *vedata,
+        Object *ob, bGPdata *gpd, bGPDlayer *gpl, bGPDframe *gpf)
 {
 	const float default_color[3] = { UNPACK3(U.gpencil_new_layer_col) };
 	const float alpha = 1.0f;
@@ -1022,7 +1022,6 @@ static void gpencil_draw_onionskins(GpencilBatchCache *cache, GPENCIL_e_data *e_
 /* populate a datablock for multiedit (no onions, no modifiers) */
 void DRW_gpencil_populate_multiedit(GPENCIL_e_data *e_data, void *vedata, Scene *scene, Object *ob, ToolSettings *ts, bGPdata *gpd)
 {
-	ListBase tmp_frames = { NULL, NULL };
 	bGPDframe *gpf = NULL;
 
 	GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
@@ -1065,7 +1064,9 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene
 {
 	GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
 	bGPDframe *derived_gpf = NULL;
+#if 0
 	bool is_edit = (bool)(gpd->flag & (GP_DATA_STROKE_EDITMODE | GP_DATA_STROKE_SCULPTMODE | GP_DATA_STROKE_WEIGHTMODE));
+#endif
 	bool no_onion = (bool)(gpd->flag & GP_DATA_STROKE_WEIGHTMODE);
 
 	if (G.debug_value == 668) {
@@ -1119,7 +1120,7 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene
 			(gpl->onion_flag & GP_LAYER_ONIONSKIN) &&
 			((!playing) || (gpd->onion_flag & GP_ONION_GHOST_ALWAYS)))
 		{
-			gpencil_draw_onionskins(cache, e_data, vedata, ts, ob, gpd, gpl, gpf);
+			gpencil_draw_onionskins(cache, e_data, vedata, ob, gpd, gpl, gpf);
 		}
 
 		/* draw normal strokes */
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 352e0e31c28..b41146d6988 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -240,7 +240,6 @@ static void GPENCIL_cache_init(void *vedata)
 		stl->g_data->shgrps_edit_volumetric = DRW_gpencil_shgroup_edit_volumetric_create(psl->edit_pass, e_data.gpencil_volumetric_sh);
 		stl->g_data->shgrps_edit_line = DRW_gpencil_shgroup_edit_volumetric_create(psl->edit_pass, e_data.gpencil_line_sh);
 		/* drawing buffer pass */
-		const DRWContextState *draw_ctx = DRW_context_state_get();
 		/* detect if playing animation */
 		int oldsts = stl->storage->playing;
 		stl->storage->playing = 0;
@@ -369,7 +368,9 @@ static void GPENCIL_cache_init(void *vedata)
 static void GPENCIL_cache_populate(void *vedata, Object *ob)
 {
 	GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
+#if 0
 	GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl;
+#endif
 	const DRWContextState *draw_ctx = DRW_context_state_get(

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list