1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
Simple port to C99
#bug https://bugs.gentoo.org/919876
--- a/timed/lib/measure.c
+++ b/timed/lib/measure.c
@@ -75,7 +75,7 @@ measure(u_long maxmsec, /* wait this many msec at most */
struct sockaddr_in *xaddr,
int doprint) /* print complaints on stderr */
{
- size_t length;
+ socklen_t length;
int measure_status;
int rcvcount, trials = 0;
int cc, count;
--- a/timed/timed/correct.c
+++ b/timed/timed/correct.c
@@ -165,7 +165,7 @@ adjclock(struct timeval *corr)
}
} else {
syslog(LOG_WARNING,
- "clock correction %d sec too large to adjust",
+ "clock correction %ld sec too large to adjust",
adj.tv_sec);
(void) gettimeofday(&now, 0);
timevaladd(&now, corr);
--- a/timed/timed/networkdelta.c
+++ b/timed/timed/networkdelta.c
@@ -40,7 +40,7 @@ char nd_rcsid[] =
#ifdef sgi
#ident "$Revision: 1.4 $"
#endif
-
+#include <math.h>
#include "globals.h"
static long median(float, float*, long*, long*, unsigned int);
@@ -238,7 +238,7 @@ median(float a, /* initial guess for the median */
(long)a, pass, npts);
return a;
}
- eps = AFAC*abs(aa - a);
+ eps = AFAC*fabsf(aa - a);
*eps_ptr = eps;
a = aa;
}
|