[Bf-blender-cvs] [a27a2069028] greasepencil-object: Cleanup: various warnings

Campbell Barton noreply at git.blender.org
Mon Apr 16 21:21:20 CEST 2018


Commit: a27a20690284746f9657a56b468b07e423c85e5c
Author: Campbell Barton
Date:   Mon Apr 16 21:20:51 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBa27a20690284746f9657a56b468b07e423c85e5c

Cleanup: various warnings

Now compiles w/o warnings for GCC

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

M	source/blender/blenkernel/BKE_brush.h
M	source/blender/blenkernel/BKE_gpencil.h
M	source/blender/blenkernel/BKE_paint.h
M	source/blender/blenkernel/intern/paint.c
M	source/blender/draw/engines/gpencil/gpencil_cache_utils.c
M	source/blender/draw/engines/gpencil/gpencil_engine.h
M	source/blender/editors/gpencil/gpencil_add_monkey.c
M	source/blender/editors/gpencil/gpencil_colorpick.c
M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/space_outliner/outliner_select.c
M	source/blender/makesrna/intern/rna_brush.c
M	source/blender/modifiers/intern/MOD_gpencilbuild.c

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

diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index c6d322505d8..0fe2d796b38 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -35,6 +35,7 @@ struct ImBuf;
 struct ImagePool;
 struct Main;
 struct Scene;
+struct ToolSettings;
 struct UnifiedPaintSettings;
 // enum eCurveMappingPreset;
 
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index 0a534600341..aa13fe3cc1d 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -53,6 +53,7 @@ struct bDeformGroup;
 struct GpencilSimplifyModifierData;
 struct GpencilArrayModifierData;
 struct GpencilLatticeModifierData;
+struct Palette;
 
 /* ------------ Grease-Pencil API ------------------ */
 
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 4f1141cc886..f9aa7e95b73 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -115,7 +115,7 @@ void                 BKE_palette_set_active_byname(const struct bContext *C, cha
 
 struct PaletteColor *BKE_palette_color_add(struct Palette *palette);
 struct PaletteColor *BKE_palette_color_add_name(struct Palette *palette, const char *name);
-struct PaletteColor *BKE_palette_color_getbyname(struct Palette *palette, char *name);
+struct PaletteColor *BKE_palette_color_getbyname(struct Palette *palette, const char *name);
 struct PaletteColor *BKE_gpencil_palettecolor_getbyrgb(struct Palette *palette, float rgb[3]);
 struct PaletteColor *BKE_gpencil_palettecolor_getbyrgba(struct Palette *palette, float rgba[4]);
 void                 BKE_palette_color_remove(struct Palette *palette, struct PaletteColor *color);
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 7928e48a61c..1f7b2c02904 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -610,7 +610,7 @@ bool BKE_palette_is_empty(const struct Palette *palette)
 }
 
 /* get the palettecolor looking by name */
-PaletteColor *BKE_palette_color_getbyname(Palette *palette, char *name)
+PaletteColor *BKE_palette_color_getbyname(Palette *palette, const char *name)
 {
 	/* error checking */
 	if (ELEM(NULL, palette, name)) {
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index a925bb4aca6..164954cae5a 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -35,6 +35,8 @@
 
 #include "gpencil_engine.h"
 
+#include "draw_cache_impl.h"
+
  /* allocate cache to store GP objects */
 tGPencilObjectCache *gpencil_object_cache_allocate(tGPencilObjectCache *cache, int *gp_cache_size, int *gp_cache_used)
 {
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index a592b401063..43bb90aae34 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -29,6 +29,7 @@
 #include "GPU_batch.h"
 
 struct tGPspoint;
+struct bGPDstroke;
 struct ModifierData;
 struct GPENCIL_StorageList;
 struct Object;
diff --git a/source/blender/editors/gpencil/gpencil_add_monkey.c b/source/blender/editors/gpencil/gpencil_add_monkey.c
index 6d3967805e4..72ef2b32711 100644
--- a/source/blender/editors/gpencil/gpencil_add_monkey.c
+++ b/source/blender/editors/gpencil/gpencil_add_monkey.c
@@ -47,7 +47,7 @@
 
 /* Definition of the most important info from a color */
 typedef struct PaletteColorTemplate {
-	char *name;
+	const char *name;
 	float line[4];
 	float fill[4];
 } PaletteColorTemplate;
diff --git a/source/blender/editors/gpencil/gpencil_colorpick.c b/source/blender/editors/gpencil/gpencil_colorpick.c
index a97dc66a444..94e4c0ed366 100644
--- a/source/blender/editors/gpencil/gpencil_colorpick.c
+++ b/source/blender/editors/gpencil/gpencil_colorpick.c
@@ -132,10 +132,10 @@ static void gp_draw_color_name(tGPDpick *tgpk, tGPDpickColor *col, const uiFontS
 
 	unsigned char text_col[4];
 	if (focus) {
-		copy_v4_v4_char(text_col, menuBack.text_sel);
+		copy_v4_v4_char((char *)text_col, menuBack.text_sel);
 	}
 	else {
-		copy_v4_v4_char(text_col, menuBack.text);
+		copy_v4_v4_char((char *)text_col, menuBack.text);
 	}
 
 	/* color name */
@@ -190,9 +190,9 @@ static void gpencil_draw_color_table(const bContext *C, tGPDpick *tgpk)
 	uiWidgetColors menuBack = btheme->tui.wcol_menu_back;
 	uiWidgetColors menuItem = btheme->tui.wcol_menu_item;
 
-	rgba_uchar_to_float(line, menuBack.outline);
-	rgba_uchar_to_float(background, menuBack.inner);
-	rgba_uchar_to_float(selcolor, menuItem.inner_sel);
+	rgba_uchar_to_float(line, (const uchar *)menuBack.outline);
+	rgba_uchar_to_float(background, (const uchar *)menuBack.inner);
+	rgba_uchar_to_float(selcolor, (const uchar *)menuItem.inner_sel);
 
 	/* draw panel background */
 	/* TODO: Draw soft drop shadow behind this (like standard menus)? */
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 903aca5e149..4a66ebebb30 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -175,11 +175,11 @@ static void gp_draw_basic_stroke(bGPDstroke *gps, const float diff_mat[4][4],
 /* loop all layers */
 static void gp_draw_datablock(tGPDfill *tgpf, float ink[4])
 {
-	/* duplicated */
-	typedef enum etempFlags {
+	/* duplicated: etempFlags */
+	enum {
 		GP_DRAWFILLS_NOSTATUS = (1 << 0),   /* don't draw status info */
 		GP_DRAWFILLS_ONLY3D = (1 << 1),   /* only draw 3d-strokes */
-	} etempFlags;
+	};
 
 	Scene *scene = tgpf->scene;
 	Object *ob = tgpf->ob;
@@ -356,7 +356,7 @@ static void set_pixel(ImBuf *ibuf, int idx, const float col[4])
 {
 	if (ibuf->rect) {
 		unsigned int *rrect = &ibuf->rect[idx];
-		char ccol[4];
+		uchar ccol[4];
 
 		rgba_float_to_uchar(ccol, col);
 		*rrect = *((unsigned int *)ccol);
@@ -512,7 +512,7 @@ static void gpencil_boundaryfill_area(tGPDfill *tgpf)
 
 		get_pixel(ibuf, v, rgba);
 
-		if (rgba) {
+		if (true) { /* Was: 'rgba' */
 			/* check if no border(red) or already filled color(green) */
 			if ((rgba[0] != 1.0f) && (rgba[1] != 1.0f))
 			{
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index ae2701247d7..ad7ef527b37 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1000,7 +1000,6 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 		/* reproject to plane (only in 3d space) */
 		gp_reproject_toplane(p, gps);
 		pt = gps->points;
-		int i;
 		for (i = 0; i < gps->totpoints; i++, pt++) {
 			/* if parented change position relative to parent object */
 			gp_apply_parent_point(obact, gpd, gpl, pt);
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index cb22c61f5b4..d9203c842e3 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -438,7 +438,7 @@ static eOLDrawState tree_element_active_defgroup(
 }
 
 static eOLDrawState tree_element_active_gplayer(
-        bContext *C, Scene *UNUSED(scene), ViewLayer *view_layer, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set)
+        bContext *C, Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *tselem, const eOLSetState set)
 {
 	bGPdata *gpd = (bGPdata *)tselem->id;
 	bGPDlayer *gpl = te->directdata;
@@ -449,7 +449,7 @@ static eOLDrawState tree_element_active_gplayer(
 	if (set != OL_SETSEL_NONE) {
 		if (gpl) {
 			BKE_gpencil_layer_setactive(gpd, gpl);
-			WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, gpd);		
+			WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, gpd);
 		}
 	}
 	else {
@@ -908,7 +908,7 @@ eOLDrawState tree_element_type_active(
 		case TSE_KEYMAP_ITEM:
 			return tree_element_active_keymap_item(C, scene, view_layer, te, tselem, set);
 		case TSE_GP_LAYER:
-			return tree_element_active_gplayer(C, scene, view_layer, te, tselem, set);
+			return tree_element_active_gplayer(C, scene, te, tselem, set);
 		case TSE_SCENE_COLLECTION:
 		case TSE_LAYER_COLLECTION:
 			return tree_element_active_collection(C, te, tselem, set);
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 9b170178327..ca3b9e43880 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -124,6 +124,7 @@ const EnumPropertyItem rna_enum_brush_image_tool_items[] = {
 	{0, NULL, 0, NULL, NULL}
 };
 
+#ifndef RNA_RUNTIME
 static EnumPropertyItem rna_enum_gpencil_brush_types_items[] = {
 	{ GP_BRUSH_TYPE_DRAW, "DRAW", ICON_GREASEPENCIL_STROKE_PAINT, "Draw", "The brush is of type used for drawing strokes" },
 	{ GP_BRUSH_TYPE_FILL, "FILL", ICON_COLOR, "Fill", "The brush is of type used for filling areas" },
@@ -145,7 +146,6 @@ static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[] = {
 	{ 0, NULL, 0, NULL, NULL }
 };
 
-#if 0
 static EnumPropertyItem rna_enum_gpencil_brush_icons_items[] = {
 	{ GPBRUSH_PENCIL, "PENCIL", ICON_GPBRUSH_PENCIL, "Pencil", "" },
 	{ GPBRUSH_PEN, "PEN", ICON_GPBRUSH_PEN, "Pen", "" },
@@ -161,6 +161,7 @@ static EnumPropertyItem rna_enum_gpencil_brush_icons_items[] = {
 };
 #endif
 
+
 #ifdef RNA_RUNTIME
 
 #include "MEM_guardedalloc.h"
diff --git a/source/blender/modifiers/intern/MOD_gpencilbuild.c b/source/blender/modifiers/intern/MOD_gpencilbuild.c
index d6f97d2b316..65b95a50b63 100644
--- a/source/blender/modifiers/intern/MOD_gpencilbuild.c
+++ b/source/blender/modifiers/intern/MOD_gpencilbuild.c
@@ -161,7 +161,7 @@ static void reduce_stroke_points(bGPDstroke *gps, const int num_points, const eG
 		}
 		
 		default:
-			printf("ERROR: Unknown transition %d in %s()\n", transition, __func__);
+			printf("ERROR: Unknown transition %d in %s()\n", (int)transition, __func__);
 			break;
 	}



More information about the Bf-blender-cvs mailing list