[Bf-blender-cvs] [f4051f05cbb] greasepencil-object: Cleanup style

Antonio Vazquez noreply at git.blender.org
Wed Feb 7 10:31:21 CET 2018


Commit: f4051f05cbbe3f5dc7be74f252e03f1b6de5a00f
Author: Antonio Vazquez
Date:   Wed Feb 7 10:31:12 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBf4051f05cbbe3f5dc7be74f252e03f1b6de5a00f

Cleanup style

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

M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/editors/gpencil/gpencil_interpolate.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

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

diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index e3438527b4b..a4e507025e9 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -256,7 +256,7 @@ static void gp_draw_stroke_buffer(const tGPspoint *points, int totpoints, short
 				if (i != 0) { 
 					gp_set_tpoint_varying_color(pt - 1, ink, color);
 					immVertex2iv(pos, &(pt - 1)->x);
-					++draw_points;
+					draw_points++;
 				}
 
 				oldpressure = pt->pressure; /* reset our threshold */
@@ -265,7 +265,7 @@ static void gp_draw_stroke_buffer(const tGPspoint *points, int totpoints, short
 			/* now the point we want */
 			gp_set_tpoint_varying_color(pt, ink, color);
 			immVertex2iv(pos, &pt->x);
-			++draw_points;
+			draw_points++;
 		}
 		/* need to have 2 points to avoid immEnd assert error */
 		if (draw_points < 2) {
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 56aad87f01d..9425da089ec 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -643,11 +643,11 @@ static void gp_duplicate_points(const bGPDstroke *gps, ListBase *new_strokes, co
 				gpsd->totpoints = len;
 				/* Copy weights */
 				int e = start_idx;
-				for (int j = 0; j < gpsd->totpoints; ++j) {
+				for (int j = 0; j < gpsd->totpoints; j++) {
 					bGPDspoint *pt_src = &gps->points[e];
 					bGPDspoint *pt_dst = &gpsd->points[j];
 					pt_dst->weights = MEM_dupallocN(pt_src->weights);
-					++e;
+					e++;
 				}
 
 				/* add to temp buffer */
@@ -1776,11 +1776,11 @@ void gp_stroke_delete_tagged_points(bGPDframe *gpf, bGPDstroke *gps, bGPDstroke
 			memcpy(new_stroke->points, gps->points + island->start_idx, sizeof(bGPDspoint) * new_stroke->totpoints);
 			/* Copy weights */
 			int e = island->start_idx;
-			for (int i = 0; i < new_stroke->totpoints; ++i) {
+			for (int i = 0; i < new_stroke->totpoints; i++) {
 				bGPDspoint *pt_src = &gps->points[e];
 				bGPDspoint *pt_dst = &new_stroke->points[i];
 				pt_dst->weights = MEM_dupallocN(pt_src->weights);
-				++e;
+				e++;
 			}
 			
 			/* Each island corresponds to a new stroke. We must adjust the 
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index a6e4d0e2fac..bd644ad50a8 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -861,7 +861,7 @@ static void gpencil_stroke_from_buffer(tGPDfill *tgpf)
 	/* smooth stroke */
 	float reduce = 0.0f;
 	float smoothfac = 1.0f;
-	for (int r = 0; r < 1; ++r) {
+	for (int r = 0; r < 1; r++) {
 		for (int i = 0; i < gps->totpoints; i++) {
 			BKE_gp_smooth_stroke(gps, i, smoothfac - reduce, false);
 		}
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index 88347d16fbe..911efb73416 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -995,7 +995,7 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op)
 				/* if destination stroke is smaller, resize new_stroke to size of gps_to stroke */
 				if (gps_from->totpoints > gps_to->totpoints) {
 					/* free weights of removed points */
-					for (int i = gps_to->totpoints; i < gps_from->totpoints; ++i) {
+					for (int i = gps_to->totpoints; i < gps_from->totpoints; i++) {
 						bGPDspoint *pt = &gps_from->points[i];
 						BKE_gpencil_free_point_weights(pt);
 					}
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 74cf8cf51a4..6d9ddce53df 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -990,7 +990,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 		 */
 		if (brush->draw_smoothfac > 0.0f) {
 			float reduce = 0.0f;
-			for (int r = 0; r < brush->draw_smoothlvl; ++r) {
+			for (int r = 0; r < brush->draw_smoothlvl; r++) {
 				for (i = 0; i < gps->totpoints; i++) {
 					BKE_gp_smooth_stroke(gps, i, brush->draw_smoothfac - reduce, false);
 					BKE_gp_smooth_stroke_strength(gps, i, brush->draw_smoothfac);
@@ -1000,7 +1000,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 		}
 		/* smooth thickness */
 		if (brush->thick_smoothfac > 0.0f) {
-			for (int r = 0; r < brush->thick_smoothlvl * 2; ++r) {
+			for (int r = 0; r < brush->thick_smoothlvl * 2; r++) {
 				for (i = 0; i < gps->totpoints; i++) {
 					BKE_gp_smooth_stroke_thickness(gps, i, brush->thick_smoothfac);
 				}
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index 402406fa21d..f03f33ef086 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -295,7 +295,7 @@ static int gpencil_select_alternate_exec(bContext *C, wmOperator *op)
 				else {
 					pt->flag &= ~GP_SPOINT_SELECT;
 				}
-				++row;
+				row++;
 			}
 
 			/* unselect start and end points */
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 7a1ed085046..e570d816ded 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -992,7 +992,7 @@ void gp_randomize_stroke(bGPDstroke *gps, bGPDbrush *brush)
 	normalize_v3(ortho);
 	
 	/* Read all points and apply shift vector (first and last point not modified) */
-	for (int i = 1; i < gps->totpoints - 1; ++i) {
+	for (int i = 1; i < gps->totpoints - 1; i++) {
 		bGPDspoint *pt = &gps->points[i];
 		/* get vector with shift (apply a division because random is too sensitive */
 		const float fac = BLI_frand() * (brush->draw_random_sub / 10.0f);



More information about the Bf-blender-cvs mailing list