[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56546] trunk/blender/source/blender: use unsigned int, for mask rasterizer.

Campbell Barton ideasman42 at gmail.com
Wed May 8 14:54:47 CEST 2013


Revision: 56546
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56546
Author:   campbellbarton
Date:     2013-05-08 12:54:47 +0000 (Wed, 08 May 2013)
Log Message:
-----------
use unsigned int, for mask rasterizer.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_mask.h
    trunk/blender/source/blender/blenkernel/intern/mask_evaluate.c
    trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c
    trunk/blender/source/blender/editors/mask/mask_draw.c

Modified: trunk/blender/source/blender/blenkernel/BKE_mask.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_mask.h	2013-05-08 12:54:33 UTC (rev 56545)
+++ trunk/blender/source/blender/blenkernel/BKE_mask.h	2013-05-08 12:54:47 UTC (rev 56546)
@@ -184,17 +184,17 @@
 unsigned int BKE_mask_spline_feather_resolution(struct MaskSpline *spline, int width, int height);
 int          BKE_mask_spline_differentiate_calc_total(const struct MaskSpline *spline, const unsigned int resol);
 
-float (*BKE_mask_spline_differentiate(struct MaskSpline *spline, int *tot_diff_point))[2];
-float (*BKE_mask_spline_feather_differentiated_points(struct MaskSpline *spline, int *tot_feather_point))[2];
+float (*BKE_mask_spline_differentiate(struct MaskSpline *spline, unsigned int *tot_diff_point))[2];
+float (*BKE_mask_spline_feather_differentiated_points(struct MaskSpline *spline, unsigned int *tot_feather_point))[2];
 
-float (*BKE_mask_spline_differentiate_with_resolution_ex(struct MaskSpline *spline, int *tot_diff_point,
+float (*BKE_mask_spline_differentiate_with_resolution_ex(struct MaskSpline *spline, unsigned int *tot_diff_point,
                                                          const unsigned int resol))[2];
-void    BKE_mask_spline_feather_collapse_inner_loops(struct MaskSpline *spline, float (*feather_points)[2], const int tot_feather_point);
-float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline, int width, int height, int *tot_diff_point))[2];
-float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(struct MaskSpline *spline, int *tot_feather_point,
+void    BKE_mask_spline_feather_collapse_inner_loops(struct MaskSpline *spline, float (*feather_points)[2], const unsigned int tot_feather_point);
+float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline, int width, int height, unsigned int *tot_diff_point))[2];
+float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(struct MaskSpline *spline, unsigned int *tot_feather_point,
                                                                          const unsigned int resol, const int do_feather_isect))[2];
 float (*BKE_mask_spline_feather_differentiated_points_with_resolution(struct MaskSpline *spline, int width, int height,
-                                                                      int *tot_feather_point, const int do_feather_isect))[2];
+                                                                      unsigned int *tot_feather_point, const int do_feather_isect))[2];
 /* *** mask point functions which involve evaluation *** */
 float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2];
 

Modified: trunk/blender/source/blender/blenkernel/intern/mask_evaluate.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mask_evaluate.c	2013-05-08 12:54:33 UTC (rev 56545)
+++ trunk/blender/source/blender/blenkernel/intern/mask_evaluate.c	2013-05-08 12:54:47 UTC (rev 56546)
@@ -155,7 +155,7 @@
 }
 
 float (*BKE_mask_spline_differentiate_with_resolution_ex(MaskSpline *spline,
-                                                         int *tot_diff_point,
+                                                         unsigned int *tot_diff_point,
                                                          const unsigned int resol
                                                          ))[2]
 {
@@ -214,7 +214,7 @@
 }
 
 float (*BKE_mask_spline_differentiate_with_resolution(MaskSpline *spline, int width, int height,
-                                                      int *tot_diff_point
+                                                      unsigned int *tot_diff_point
                                                       ))[2]
 {
 	int unsigned resol = BKE_mask_spline_resolution(spline, width, height);
@@ -222,7 +222,7 @@
 	return BKE_mask_spline_differentiate_with_resolution_ex(spline, tot_diff_point, resol);
 }
 
-float (*BKE_mask_spline_differentiate(MaskSpline *spline, int *tot_diff_point))[2]
+float (*BKE_mask_spline_differentiate(MaskSpline *spline, unsigned int *tot_diff_point))[2]
 {
 	return BKE_mask_spline_differentiate_with_resolution(spline, 0, 0, tot_diff_point);
 }
@@ -350,7 +350,7 @@
 	*diagonal_bucket_b_r = &buckets[diagonal_bucket_b_index];
 }
 
-void BKE_mask_spline_feather_collapse_inner_loops(MaskSpline *spline, float (*feather_points)[2], const int tot_feather_point)
+void BKE_mask_spline_feather_collapse_inner_loops(MaskSpline *spline, float (*feather_points)[2], const unsigned int tot_feather_point)
 {
 #define BUCKET_INDEX(co) \
 	feather_bucket_index_from_coord(co, min, bucket_scale, buckets_per_side)
@@ -360,7 +360,7 @@
 
 	FeatherEdgesBucket *buckets;
 
-	int i;
+	unsigned int i;
 	float min[2], max[2];
 	float max_delta_x = -1.0f, max_delta_y = -1.0f, max_delta;
 
@@ -376,7 +376,7 @@
 	INIT_MINMAX2(min, max);
 
 	for (i = 0; i < tot_feather_point; i++) {
-		int next = i + 1;
+		unsigned int next = i + 1;
 		float delta;
 
 		minmax_v2v2_v2(min, max, feather_points[i]);
@@ -508,7 +508,7 @@
 
 /** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution_ex() ! */
 static float (*mask_spline_feather_differentiated_points_with_resolution_ex__even(MaskSpline *spline,
-                                                                                  int *tot_feather_point,
+                                                                                  unsigned int *tot_feather_point,
                                                                                   const unsigned int resol,
                                                                                   const int do_feather_isect
                                                                                   ))[2]
@@ -581,7 +581,7 @@
 
 /** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution_ex() ! */
 static float (*mask_spline_feather_differentiated_points_with_resolution_ex__double(MaskSpline *spline,
-                                                                                    int *tot_feather_point,
+                                                                                    unsigned int *tot_feather_point,
                                                                                     const unsigned int resol,
                                                                                     const int do_feather_isect
                                                                                     ))[2]
@@ -718,7 +718,7 @@
  * when \a resol arguments match.
  */
 float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpline *spline,
-                                                                         int *tot_feather_point,
+                                                                         unsigned int *tot_feather_point,
                                                                          const unsigned int resol,
                                                                          const int do_feather_isect
                                                                          ))[2]
@@ -735,14 +735,14 @@
 }
 
 float (*BKE_mask_spline_feather_differentiated_points_with_resolution(MaskSpline *spline, int width, int height,
-                                                                      int *tot_feather_point, const int do_feather_isect))[2]
+                                                                      unsigned int *tot_feather_point, const int do_feather_isect))[2]
 {
 	unsigned int resol = BKE_mask_spline_feather_resolution(spline, width, height);
 
 	return BKE_mask_spline_feather_differentiated_points_with_resolution_ex(spline, tot_feather_point, resol, do_feather_isect);
 }
 
-float (*BKE_mask_spline_feather_differentiated_points(MaskSpline *spline, int *tot_feather_point))[2]
+float (*BKE_mask_spline_feather_differentiated_points(MaskSpline *spline, unsigned int *tot_feather_point))[2]
 {
 	return BKE_mask_spline_feather_differentiated_points_with_resolution(spline, 0, 0, tot_feather_point, TRUE);
 }

Modified: trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c	2013-05-08 12:54:33 UTC (rev 56545)
+++ trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c	2013-05-08 12:54:47 UTC (rev 56546)
@@ -85,6 +85,10 @@
 
 #include "BKE_mask.h"
 
+#ifdef __GNUC__
+#  pragma GCC diagnostic error "-Wsign-conversion"
+#endif
+
 /* this is rather and annoying hack, use define to isolate it.
  * problem is caused by scanfill removing edges on us. */
 #define USE_SCANFILL_EDGE_WORKAROUND
@@ -568,7 +572,7 @@
 	MaskLayer *masklay;
 	unsigned int masklay_index;
 
-	mr_handle->layers_tot = BLI_countlist(&mask->masklayers);
+	mr_handle->layers_tot = (unsigned int)BLI_countlist(&mask->masklayers);
 	mr_handle->layers = MEM_mallocN(sizeof(MaskRasterLayer) * mr_handle->layers_tot, "MaskRasterLayer");
 	BLI_rctf_init_minmax(&mr_handle->bounds);
 
@@ -602,7 +606,7 @@
 			continue;
 		}
 
-		tot_splines = BLI_countlist(&masklay->splines);
+		tot_splines = (unsigned int)BLI_countlist(&masklay->splines);
 		open_spline_ranges = MEM_callocN(sizeof(*open_spline_ranges) * tot_splines, __func__);
 
 		BLI_scanfill_begin(&sf_ctx);
@@ -612,11 +616,11 @@
 			const unsigned int is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0;
 
 			float (*diff_points)[2];
-			int tot_diff_point;
+			unsigned int tot_diff_point;
 
 			float (*diff_feather_points)[2];
 			float (*diff_feather_points_flip)[2];
-			int tot_diff_feather_points;
+			unsigned int tot_diff_feather_points;
 
 			const unsigned int resol_a = BKE_mask_spline_resolution(spline, width, height) / 4;
 			const unsigned int resol_b = BKE_mask_spline_feather_resolution(spline, width, height) / 4;
@@ -676,7 +680,8 @@
 				if (do_mask_aa == TRUE) {
 					if (do_feather == FALSE) {
 						tot_diff_feather_points = tot_diff_point;
-						diff_feather_points = MEM_mallocN(sizeof(*diff_feather_points) * tot_diff_feather_points,
+						diff_feather_points = MEM_mallocN(sizeof(*diff_feather_points) *

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list