mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-08-26 07:16:58 +08:00
Inline the isneg/ispos macros, remove promotion warnings on constants
Originated from commit c6dc96f3 but are rarely used and not in math.h Removes float to double promotion warning and simplifies the code 'gcc -std=gnu99 -Wdouble-promotion' spits out these warnings
This commit is contained in:
@ -187,6 +187,7 @@
|
||||
#endif
|
||||
typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
|
||||
|
||||
/* isinf & isnan macros should be provided by math.h */
|
||||
#ifndef isinf
|
||||
/* The value of Inf - Inf is NaN */
|
||||
#define isinf(n) (isnan((n) - (n)) && !isnan(n))
|
||||
@ -198,14 +199,6 @@ typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
|
||||
#define isnan(n) ((n != n) ? 1 : 0)
|
||||
#endif
|
||||
|
||||
#ifndef isneg
|
||||
#define isneg(n) ((n < 0.0f) ? 1 : 0)
|
||||
#endif
|
||||
|
||||
#ifndef ispos
|
||||
#define ispos(n) ((n > 0.0f) ? 1 : 0)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------
|
||||
@ -243,7 +236,7 @@ typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
|
||||
|
||||
/* Double Floating Point Support */
|
||||
#ifndef UNITY_DOUBLE_PRECISION
|
||||
#define UNITY_DOUBLE_PRECISION (1e-12f)
|
||||
#define UNITY_DOUBLE_PRECISION (1e-12)
|
||||
#endif
|
||||
|
||||
#ifndef UNITY_DOUBLE_TYPE
|
||||
|
Reference in New Issue
Block a user