[Bf-blender-cvs] [59472df] master: Image: color grid - correct abs() use with ints

Campbell Barton noreply at git.blender.org
Mon Feb 24 12:27:03 CET 2014


Commit: 59472df8d695eaa8c7062d3006078c08fab8f3cc
Author: Campbell Barton
Date:   Mon Feb 24 22:25:06 2014 +1100
https://developer.blender.org/rB59472df8d695eaa8c7062d3006078c08fab8f3cc

Image: color grid - correct abs() use with ints

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

M	source/blender/blenkernel/intern/image_gen.c

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

diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c
index 71b4f99..4f9ed5f 100644
--- a/source/blender/blenkernel/intern/image_gen.c
+++ b/source/blender/blenkernel/intern/image_gen.c
@@ -126,13 +126,13 @@ void BKE_image_buf_fill_checker(unsigned char *rect, float *rect_float, int widt
 		for (x = 0; x < width; x++) {
 			h = 0.125f * floorf(x / checkerwidth);
 			
-			if ((fabs((x % checkerwidth) - (checkerwidth / 2)) < 4) &&
-			    (fabs((y % checkerwidth) - (checkerwidth / 2)) < 4))
+			if ((abs((x % checkerwidth) - (checkerwidth / 2)) < 4) &&
+			    (abs((y % checkerwidth) - (checkerwidth / 2)) < 4))
 			{
-				if ((fabs((x % checkerwidth) - (checkerwidth / 2)) < 1) ||
-				    (fabs((y % checkerwidth) - (checkerwidth / 2)) < 1))
+				if ((abs((x % checkerwidth) - (checkerwidth / 2)) < 1) ||
+				    (abs((y % checkerwidth) - (checkerwidth / 2)) < 1))
 				{
-					hsv[0] = fmodf(fabs(h - hoffs), 1.0f);
+					hsv[0] = fmodf(fabsf(h - hoffs), 1.0f);
 					hsv_to_rgb_v(hsv, rgb);
 					
 					if (rect) {




More information about the Bf-blender-cvs mailing list