diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-04-26 15:50:32 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-04-26 15:50:32 +0000 |
commit | b7132592adbfdd2eae1ce57cd18617de13d7074d (patch) | |
tree | 66aa329d1ac431772bd7eb5674b3dc0662d77a1c | |
parent | dfce0ef7af30ba61f6de1ec1a3f9a612c45ff188 (diff) | |
download | src-test2-b7132592adbfdd2eae1ce57cd18617de13d7074d.tar.gz src-test2-b7132592adbfdd2eae1ce57cd18617de13d7074d.zip |
Add casts to work around harmless -Werror warnings from clang 10.0.0,
such as:
usr.sbin/timed/timed/networkdelta.c:160:13: error: implicit conversion from 'long' to 'float' changes value from 9223372036854775807 to 9223372036854775808
[-Werror,-Wimplicit-int-float-conversion]
float ap = LONG_MAX; /* bounds on the median */
~~ ^~~~~~~~
Direct commit to stable/{10,11,12}, since timed has been removed from
FreeBSD 13.
Notes
Notes:
svn path=/stable/10/; revision=360338
-rw-r--r-- | usr.sbin/timed/Makefile | 1 | ||||
-rw-r--r-- | usr.sbin/timed/timed/networkdelta.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/timed/Makefile b/usr.sbin/timed/Makefile index 2f56510bca1c..fe2d8a4289ef 100644 --- a/usr.sbin/timed/Makefile +++ b/usr.sbin/timed/Makefile @@ -4,3 +4,4 @@ SUBDIR= timed timedc .include <bsd.subdir.mk> +# DO NOT DELETE diff --git a/usr.sbin/timed/timed/networkdelta.c b/usr.sbin/timed/timed/networkdelta.c index bf2a35389d5f..90c68d32b00b 100644 --- a/usr.sbin/timed/timed/networkdelta.c +++ b/usr.sbin/timed/timed/networkdelta.c @@ -155,8 +155,8 @@ median(float a, float *eps_ptr, long *x, long *xlim, unsigned int gnuf) /* unsigned int gnuf; */ /* good enough estimate */ { long *xptr; - float ap = LONG_MAX; /* bounds on the median */ - float am = -LONG_MAX; + float ap = (float)LONG_MAX; /* bounds on the median */ + float am = -(float)LONG_MAX; float aa; int npts; /* # of points above & below guess */ float xp; /* closet point above the guess */ @@ -178,8 +178,8 @@ median(float a, float *eps_ptr, long *x, long *xlim, unsigned int gnuf) sum = 0.0; sumx = 0.0; npts = 0; - xp = LONG_MAX; - xm = -LONG_MAX; + xp = (float)LONG_MAX; + xm = -(float)LONG_MAX; for (xptr = x; xptr != xlim; xptr++) { float xx = *xptr; |