[Bf-blender-cvs] [d273f3ff712] blender2.8: Cleanup: fix compiler warnings.

Brecht Van Lommel noreply at git.blender.org
Tue Jul 31 11:48:54 CEST 2018


Commit: d273f3ff7125ce5fe6366b7b55461951f7ce57e7
Author: Brecht Van Lommel
Date:   Tue Jul 31 11:30:24 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd273f3ff7125ce5fe6366b7b55461951f7ce57e7

Cleanup: fix compiler warnings.

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

M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_fill.c

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

diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 4a603e97615..93cf2f18233 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -2454,7 +2454,6 @@ static void gpencil_stroke_copy_point(bGPDstroke *gps, bGPDspoint *point, int id
                                       float pressure, float strength, float deltatime)
 {
 	bGPDspoint *newpoint;
-	MDeformVert *dvert, *newdvert;
 
 	gps->points = MEM_reallocN(gps->points, sizeof(bGPDspoint) * (gps->totpoints + 1));
 	if (gps->dvert != NULL) {
@@ -2463,11 +2462,6 @@ static void gpencil_stroke_copy_point(bGPDstroke *gps, bGPDspoint *point, int id
 	gps->totpoints++;
 	newpoint = &gps->points[gps->totpoints - 1];
 
-	if (gps->dvert != NULL) {
-		dvert = &gps->dvert[idx];
-		newdvert = &gps->dvert[gps->totpoints - 1];
-	}
-
 	newpoint->x = point->x * delta[0];
 	newpoint->y = point->y * delta[1];
 	newpoint->z = point->z * delta[2];
@@ -2476,8 +2470,13 @@ static void gpencil_stroke_copy_point(bGPDstroke *gps, bGPDspoint *point, int id
 	newpoint->strength = strength;
 	newpoint->time = point->time + deltatime;
 
-	newdvert->totweight = dvert->totweight;
-	newdvert->dw = MEM_dupallocN(dvert->dw);
+	if (gps->dvert != NULL) {
+		MDeformVert *dvert = &gps->dvert[idx];
+		MDeformVert *newdvert = &gps->dvert[gps->totpoints - 1];
+
+		newdvert->totweight = dvert->totweight;
+		newdvert->dw = MEM_dupallocN(dvert->dw);
+	}
 }
 
 /* Helper: join two strokes using the shortest distance (reorder stroke if necessary ) */
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index b768ac2c44f..a0626dd69b1 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -911,9 +911,7 @@ 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(bContext *C, tGPDfill *UNUSED(tgpf))
 {
-	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"));
+	const char *status_str = IFACE_("Fill: ESC/RMB cancel, LMB Fill, Shift Draw on Back");
 	ED_workspace_status_text(C, status_str);
 }



More information about the Bf-blender-cvs mailing list