From 38338a51c92e3f47601199689c294da8a20bec18 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 20 Aug 2013 09:34:52 +0000 Subject: add is_finite_v# functions, use bool's --- source/blender/blenlib/BLI_math_vector.h | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'source/blender/blenlib/BLI_math_vector.h') diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index e163c06440c..0a819ce062e 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -196,18 +196,24 @@ void flip_v2_v2v2(float v[2], const float v1[2], const float v2[2]); /********************************* Comparison ********************************/ -MINLINE int is_zero_v3(const float a[3]) UNUSED_RESULT_ATTR; -MINLINE int is_zero_v4(const float a[4]) UNUSED_RESULT_ATTR; -MINLINE int is_one_v3(const float a[3]) UNUSED_RESULT_ATTR; - -MINLINE int equals_v2v2(const float v1[2], const float v2[2]) UNUSED_RESULT_ATTR; -MINLINE int equals_v3v3(const float a[3], const float b[3]) UNUSED_RESULT_ATTR; -MINLINE int compare_v2v2(const float a[2], const float b[2], const float limit) UNUSED_RESULT_ATTR; -MINLINE int compare_v3v3(const float a[3], const float b[3], const float limit) UNUSED_RESULT_ATTR; -MINLINE int compare_len_v3v3(const float a[3], const float b[3], const float limit) UNUSED_RESULT_ATTR; - -MINLINE int compare_v4v4(const float a[4], const float b[4], const float limit) UNUSED_RESULT_ATTR; -MINLINE int equals_v4v4(const float a[4], const float b[4]) UNUSED_RESULT_ATTR; +MINLINE bool is_zero_v2(const float a[3]) UNUSED_RESULT_ATTR; +MINLINE bool is_zero_v3(const float a[3]) UNUSED_RESULT_ATTR; +MINLINE bool is_zero_v4(const float a[4]) UNUSED_RESULT_ATTR; + +MINLINE bool is_finite_v2(const float a[3]) UNUSED_RESULT_ATTR; +MINLINE bool is_finite_v3(const float a[3]) UNUSED_RESULT_ATTR; +MINLINE bool is_finite_v4(const float a[4]) UNUSED_RESULT_ATTR; + +MINLINE bool is_one_v3(const float a[3]) UNUSED_RESULT_ATTR; + +MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) UNUSED_RESULT_ATTR; +MINLINE bool equals_v3v3(const float a[3], const float b[3]) UNUSED_RESULT_ATTR; +MINLINE bool compare_v2v2(const float a[2], const float b[2], const float limit) UNUSED_RESULT_ATTR; +MINLINE bool compare_v3v3(const float a[3], const float b[3], const float limit) UNUSED_RESULT_ATTR; +MINLINE bool compare_len_v3v3(const float a[3], const float b[3], const float limit) UNUSED_RESULT_ATTR; + +MINLINE bool compare_v4v4(const float a[4], const float b[4], const float limit) UNUSED_RESULT_ATTR; +MINLINE bool equals_v4v4(const float a[4], const float b[4]) UNUSED_RESULT_ATTR; MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2]) UNUSED_RESULT_ATTR; -- cgit v1.2.3