[Bf-blender-cvs] [2026179bb20] master: Collada: Use floating point version of abs()

Sergey Sharybin noreply at git.blender.org
Tue Feb 27 11:16:32 CET 2018


Commit: 2026179bb20e2220459129dfced535bee0983cbf
Author: Sergey Sharybin
Date:   Tue Feb 27 11:14:17 2018 +0100
Branches: master
https://developer.blender.org/rB2026179bb20e2220459129dfced535bee0983cbf

Collada: Use floating point version of abs()

Avoids implicit cast of float to int.

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

M	source/blender/collada/collada_utils.h

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

diff --git a/source/blender/collada/collada_utils.h b/source/blender/collada/collada_utils.h
index bbe36f2999c..0069b4d4871 100644
--- a/source/blender/collada/collada_utils.h
+++ b/source/blender/collada/collada_utils.h
@@ -105,7 +105,7 @@ extern int bc_set_layer(int bitfield, int layer, bool enable);
 extern int bc_set_layer(int bitfield, int layer);
 
 inline bool bc_in_range(float a, float b, float range) {
-	return abs(a - b) < range;
+	return fabsf(a - b) < range;
 }
 void bc_copy_m4_farray(float r[4][4], float *a);
 void bc_copy_farray_m4(float *r, float a[4][4]);



More information about the Bf-blender-cvs mailing list