msun: Silence new harmless -Wimplicit-int-float-conversion warnings

Clang from trunk recently added a warning for when implicit int-to-float
conversions cause a loss of precision. The code in question is designed
to be able to handle that, so add explicit casts to silence this.

Submitted by:	James Clarke <jrtc27@jrtc27.com>
Reviewed by:	dim
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D21913
This commit is contained in:
Brooks Davis 2019-10-08 21:39:51 +00:00
parent 9e14430d46
commit e593620997
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=353329

View File

@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$");
* that everything is in range. At compile time, INRANGE(x) should reduce to
* two floating-point comparisons in the former case, or TRUE otherwise.
*/
static const type dtype_min = DTYPE_MIN - 0.5;
static const type dtype_max = DTYPE_MAX + 0.5;
#define INRANGE(x) (dtype_max - DTYPE_MAX != 0.5 || \
static const type dtype_min = (type)DTYPE_MIN - 0.5;
static const type dtype_max = (type)DTYPE_MAX + 0.5;
#define INRANGE(x) (dtype_max - (type)DTYPE_MAX != 0.5 || \
((x) > dtype_min && (x) < dtype_max))
dtype