Module Name: src
Committed By: christos
Date: Mon Oct 18 14:16:50 UTC 2021
Modified Files:
src/usr.sbin/timed/timed: networkdelta.c
Log Message:
Explicitly cast the long->float conversion since it is value-changing and
produces clang warnings.
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/timed/timed/networkdelta.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/timed/timed/networkdelta.c
diff -u src/usr.sbin/timed/timed/networkdelta.c:1.12 src/usr.sbin/timed/timed/networkdelta.c:1.13
--- src/usr.sbin/timed/timed/networkdelta.c:1.12 Thu Aug 7 07:25:46 2003
+++ src/usr.sbin/timed/timed/networkdelta.c Mon Oct 18 10:16:49 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: networkdelta.c,v 1.12 2003/08/07 11:25:46 agc Exp $ */
+/* $NetBSD: networkdelta.c,v 1.13 2021/10/18 14:16:49 christos Exp $ */
/*-
* Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)networkdelta.c 8.3 (Berkeley) 4/27/95";
#else
-__RCSID("$NetBSD: networkdelta.c,v 1.12 2003/08/07 11:25:46 agc Exp $");
+__RCSID("$NetBSD: networkdelta.c,v 1.13 2021/10/18 14:16:49 christos Exp $");
#endif
#endif /* not lint */
@@ -157,8 +157,8 @@ median(float a, /* initial guess for
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 */
@@ -180,8 +180,8 @@ median(float a, /* initial guess for
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;