[Bf-blender-cvs] [bd769050cdc] greasepencil-object: Cleanup: Silent multiple compiler warnings

Antonio Vazquez noreply at git.blender.org
Thu Mar 1 17:31:37 CET 2018


Commit: bd769050cdcb3ba0184355b6567089bbe2f6fbb5
Author: Antonio Vazquez
Date:   Thu Mar 1 17:30:25 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBbd769050cdcb3ba0184355b6567089bbe2f6fbb5

Cleanup: Silent multiple compiler warnings

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

M	source/blender/draw/engines/gpencil/gpencil_geom.c
M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/gpencil/gpencil_colorpick.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/include/ED_gpencil.h

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_geom.c b/source/blender/draw/engines/gpencil/gpencil_geom.c
index 0415086948e..34be81b080d 100644
--- a/source/blender/draw/engines/gpencil/gpencil_geom.c
+++ b/source/blender/draw/engines/gpencil/gpencil_geom.c
@@ -220,13 +220,13 @@ Gwn_Batch *DRW_gpencil_get_buffer_stroke_geom(bGPdata *gpd, float matrix[4][4],
 	ED_gp_get_drawing_reference(v3d, scene, ob, gpl, ts->gpencil_v3d_align, origin);
 
 	for (int i = 0; i < totpoints; i++, tpt++) {
-		ED_gpencil_tpoint_to_point(scene, ar, v3d, origin, tpt, &pt);
+		ED_gpencil_tpoint_to_point(ar, origin, tpt, &pt);
 		ED_gp_project_point_to_plane(ob, rv3d, origin, ts->gp_sculpt.lock_axis - 1, ts->gpencil_src, &pt);
 
 		/* first point for adjacency (not drawn) */
 		if (i == 0) {
 			if (totpoints > 1) {
-				ED_gpencil_tpoint_to_point(scene, ar, v3d, origin, &points[1], &pt2);
+				ED_gpencil_tpoint_to_point(ar, origin, &points[1], &pt2);
 				gpencil_set_stroke_point(vbo, matrix, &pt2, idx, 
 										 pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->scolor);
 			}
@@ -244,7 +244,7 @@ Gwn_Batch *DRW_gpencil_get_buffer_stroke_geom(bGPdata *gpd, float matrix[4][4],
 
 	/* last adjacency point (not drawn) */
 	if (totpoints > 2) {
-		ED_gpencil_tpoint_to_point(scene, ar, v3d, origin, &points[totpoints - 2], &pt2);
+		ED_gpencil_tpoint_to_point(ar, origin, &points[totpoints - 2], &pt2);
 		gpencil_set_stroke_point(vbo, matrix, &pt2, idx, 
 								 pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->scolor);
 	}
@@ -293,7 +293,7 @@ Gwn_Batch *DRW_gpencil_get_buffer_point_geom(bGPdata *gpd, float matrix[4][4], s
 	ED_gp_get_drawing_reference(v3d, scene, ob, gpl, ts->gpencil_v3d_align, origin);
 
 	for (int i = 0; i < totpoints; i++, tpt++) {
-		ED_gpencil_tpoint_to_point(scene, ar, v3d, origin, tpt, &pt);
+		ED_gpencil_tpoint_to_point(ar, origin, tpt, &pt);
 		ED_gp_project_point_to_plane(ob, rv3d, origin, ts->gp_sculpt.lock_axis - 1, ts->gpencil_src, &pt);
 
 		/* set point */
@@ -367,7 +367,7 @@ Gwn_Batch *DRW_gpencil_get_buffer_fill_geom(bGPdata *gpd)
 		for (int i = 0; i < tot_triangles; i++) {
 			for (int j = 0; j < 3; j++) {
 				tpt = &points[tmp_triangles[i][j]];
-				ED_gpencil_tpoint_to_point(scene, ar, v3d, origin, tpt, &pt);
+				ED_gpencil_tpoint_to_point(ar, origin, tpt, &pt);
 				GWN_vertbuf_attr_set(vbo, pos_id, idx, &pt.x);
 				GWN_vertbuf_attr_set(vbo, color_id, idx, gpd->sfill);
 				idx++;
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 548e27f5fc7..b4086d1f0eb 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -1575,7 +1575,6 @@ static void gp_draw_data_layers(RegionView3D *rv3d,
 		/* calculate parent position */
 		ED_gpencil_parent_location(ob, gpd, gpl, diff_mat);
 
-		bool debug = (gpl->flag & GP_LAYER_DRAWDEBUG);
 		short lthick = brush->thickness + gpl->thickness;
 
 		/* don't draw layer if hidden */
diff --git a/source/blender/editors/gpencil/gpencil_colorpick.c b/source/blender/editors/gpencil/gpencil_colorpick.c
index 2042fa89a96..e4816d00435 100644
--- a/source/blender/editors/gpencil/gpencil_colorpick.c
+++ b/source/blender/editors/gpencil/gpencil_colorpick.c
@@ -275,7 +275,6 @@ static int gpencil_colorpick_poll(bContext *C)
 		CTX_wm_operator_poll_msg_set(C, "Active region not set");
 		return 0;
 	}
-	return 0;
 }
 
 /* Allocate memory and initialize values */
@@ -485,8 +484,6 @@ static int gpencil_colorpick_index_from_mouse(const tGPDpick *tgpk, const wmEven
 /* events handling during interactive part of operator */
 static int gpencil_colorpick_modal(bContext *C, wmOperator *op, const wmEvent *event)
 {
-	Scene *scene = CTX_data_scene(C);
-	Object *ob = CTX_data_active_object(C);
 	tGPDpick *tgpk = op->customdata;
 
 	int estate = OPERATOR_RUNNING_MODAL; 
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 5cd19ed579a..d7450fb2ba1 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -106,10 +106,9 @@ static int gpencil_editmode_toggle_exec(bContext *C, wmOperator *op)
 	const int back = RNA_int_get(op->ptr, "back");
 
 	WorkSpace *workspace = CTX_wm_workspace(C);
-	Scene *scene = CTX_data_scene(C);
 	bGPdata *gpd = ED_gpencil_data_get_active(C);
 	bool is_object = false;
-	int mode;
+	short mode;
 	/* if using a gpencil object, use this datablock */
 	Object *ob = CTX_data_active_object(C);
 	if ((ob) && (ob->type == OB_GPENCIL)) {
@@ -189,10 +188,9 @@ static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op)
 	const int back = RNA_int_get(op->ptr, "back");
 
 	WorkSpace *workspace = CTX_wm_workspace(C);
-	Scene *scene = CTX_data_scene(C);
 	bGPdata *gpd = ED_gpencil_data_get_active(C);
 	bool is_object = false;
-	int mode;
+	short mode;
 	/* if using a gpencil object, use this datablock */
 	Object *ob = CTX_data_active_object(C);
 	if ((ob) && (ob->type == OB_GPENCIL)) {
@@ -267,10 +265,9 @@ static int gpencil_sculptmode_toggle_exec(bContext *C, wmOperator *op)
 	const int back = RNA_int_get(op->ptr, "back");
 
 	WorkSpace *workspace = CTX_wm_workspace(C);
-	Scene *scene = CTX_data_scene(C);
 	bGPdata *gpd = ED_gpencil_data_get_active(C);
 	bool is_object = false;
-	int mode;
+	short mode;
 	/* if using a gpencil object, use this datablock */
 	Object *ob = CTX_data_active_object(C);
 	if ((ob) && (ob->type == OB_GPENCIL)) {
@@ -345,10 +342,9 @@ static int gpencil_weightmode_toggle_exec(bContext *C, wmOperator *op)
 	const int back = RNA_int_get(op->ptr, "back");
 
 	WorkSpace *workspace = CTX_wm_workspace(C);
-	Scene *scene = CTX_data_scene(C);
 	bGPdata *gpd = ED_gpencil_data_get_active(C);
 	bool is_object = false;
-	int mode;
+	short mode;
 	/* if using a gpencil object, use this datablock */
 	Object *ob = CTX_data_active_object(C);
 	if ((ob) && (ob->type == OB_GPENCIL)) {
@@ -1431,7 +1427,8 @@ static int gp_dissolve_selected_points(bContext *C, eGP_DissolveMode mode)
 	bGPdata *gpd = ED_gpencil_data_get_active(C);
 	bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
 	bool changed = false;
-	int first, last;
+	int first = 0;
+	int last = 0;
 
 	CTX_DATA_BEGIN(C, bGPDlayer *, gpl, editable_gpencil_layers)
 	{
@@ -3178,9 +3175,8 @@ void GPENCIL_OT_stroke_separate(wmOperatorType *ot)
 }
 
 /* ***************** Split Strokes ********************** */
-static int gp_stroke_split_exec(bContext *C, wmOperator *op)
+static int gp_stroke_split_exec(bContext *C, wmOperator *UNUSED(op))
 {
-	Scene *scene = CTX_data_scene(C);
 	bGPdata *gpd = ED_gpencil_data_get_active(C);
 	bGPDspoint *pt;
 	int i;
@@ -3240,11 +3236,11 @@ static int gp_stroke_split_exec(bContext *C, wmOperator *op)
 				}
 				/* select again tagged points */
 				for (gps = gpf->strokes.first; gps; gps = gps->next) {
-					bGPDspoint *pt = gps->points;
-					for (int i = 0; i < gps->totpoints; i++, pt++) {
-						if (pt->flag & GP_SPOINT_TAG) {
-							pt->flag |= GP_SPOINT_SELECT;
-							pt->flag &= ~GP_SPOINT_TAG;
+					bGPDspoint *ptn = gps->points;
+					for (int i2 = 0; i2 < gps->totpoints; i2++, ptn++) {
+						if (ptn->flag & GP_SPOINT_TAG) {
+							ptn->flag |= GP_SPOINT_SELECT;
+							ptn->flag &= ~GP_SPOINT_TAG;
 						}
 					}
 				}
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 7310e697e88..e1c0b7d7c45 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -258,7 +258,6 @@ static void gp_draw_datablock(tGPDfill *tgpf, float ink[4])
  /* draw strokes in offscreen buffer */
 static void gp_render_offscreen(tGPDfill *tgpf)
 {
-	const char *viewname = "GP";
 	bool is_ortho = false;
 	float winmat[4][4];
 
@@ -288,8 +287,8 @@ static void gp_render_offscreen(tGPDfill *tgpf)
 	int bwiny = tgpf->ar->winy;
 	rcti brect = tgpf->ar->winrct;
 
-	tgpf->ar->winx = tgpf->sizex;
-	tgpf->ar->winy = tgpf->sizey;
+	tgpf->ar->winx = (short) tgpf->sizex;
+	tgpf->ar->winy = (short) tgpf->sizey;
 	tgpf->ar->winrct.xmin = 0;
 	tgpf->ar->winrct.ymin = 0;
 	tgpf->ar->winrct.xmax = tgpf->sizex;
@@ -314,8 +313,8 @@ static void gp_render_offscreen(tGPDfill *tgpf)
 	gp_draw_datablock(tgpf, ink);
 
 	/* restore size */
-	tgpf->ar->winx = bwinx;
-	tgpf->ar->winy = bwiny;
+	tgpf->ar->winx = (short)bwinx;
+	tgpf->ar->winy = (short)bwiny;
 	tgpf->ar->winrct = brect;
 
 	gpuPopProjectionMatrix();
@@ -771,7 +770,7 @@ static void gpencil_points_from_stack(tGPDfill *tgpf)
 		return;
 	}
 
-	tgpf->sbuffer_size = totpoints;
+	tgpf->sbuffer_size = (short)totpoints;
 	tgpf->sbuffer = MEM_callocN(sizeof(tGPspoint) * totpoints, __func__);
 
 	point2D = tgpf->sbuffer;
@@ -870,7 +869,6 @@ static void gpencil_stroke_from_buffer(tGPDfill *tgpf)
 	/* if axis locked, reproject to plane locked */
 	if ((tgpf->lock_axis > GP_LOCKAXIS_NONE) && ((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_VIEW) == 0)) {
 		float origin[3];
-		bGPDspoint *tpt = gps->points;
 		ED_gp_get_drawing_reference(tgpf->v3d, tgpf->scene, tgpf->ob, tgpf->gpl,
 			ts->gpencil_v3d_align, origin);
 		ED_gp_project_stroke_to_plane(tgpf->ob, tgpf->rv3d, gps, origin, 
@@ -894,7 +892,6 @@ static void gpencil_stroke_from_buffer(tGPDfill *tgpf)
 /* Helper: Draw status message while the user is running the operator */
 static void gpencil_fill_status_indicators(tGPDfill *tgpf)
 {
-	Scene *scene = tgpf->scene;
 	char status_str[UI_MAX_DRAW_STR];
 
 	BLI_snprintf(status_str, sizeof(status_str), IFACE_("Fill: ESC/RMB cancel, LMB Fill, Shift Draw on Back"));
@@ -935,11 +932,10 @@ static int gpencil_fill_poll(bContext *C)
 		CTX_wm_operator_poll_msg_set(C, "Active region not set");
 		return 0;
 	}
-	return 0;
 }
 
 /* Allocate memory and initialize values */
-static tGPDfill *gp_session_init_fill(bContext *C, wmOperator *op)
+static tGPDfill *gp_session_init_fill(bContext *C, wmOperator *UNUSED(op))
 {
 	tGPDfill *tgpf = MEM_callocN(sizeof(tGPDfill), "GPencil Fill Data");
 
@@ -1003,7 +999,6 @@ static void gpencil_fill_exit(bContext *C, wmOperator *op)
 	WM_cursor_modal_restore(CTX_wm_window(C));
 
 	tGPDfill *tgpf = op-

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list