[Git][NTPsec/ntpsec][master] 2 commits: Remove unused macros.
Eric S. Raymond
gitlab at mg.gitlab.com
Thu Jan 5 16:06:29 UTC 2017
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
cd0f92b2 by Eric S. Raymond at 2017-01-05T10:59:29-05:00
Remove unused macros.
- - - - -
0eecfa88 by Eric S. Raymond at 2017-01-05T11:03:04-05:00
More scalarization changes. These errors should have been caught sooner...
...but it appears the build system hiccupped.
- - - - -
4 changed files:
- include/ntp_fp.h
- ntpd/refclock_generic.c
- ntpd/refclock_magnavox.c
- ntptime/ntptime.c
Changes:
=====================================
include/ntp_fp.h
=====================================
--- a/include/ntp_fp.h
+++ b/include/ntp_fp.h
@@ -86,7 +86,6 @@ typedef uint32_t u_fp;
#define HTONS_FP(x) (htonl(x))
#define NTOHS_FP(x) (ntohl(x))
-
typedef struct {
uint32_t l_ui;
uint32_t l_uf;
@@ -107,20 +106,6 @@ static inline l_fp ntohl_fp(l_fp_w lfpw) {
#define HTONL_UF(uf, nts) *nts = lfpint(0, htonl(uf))
/*
- * Conversions between the two fixed point types
- */
-#define MFPTOFP(x_i, x_f) (((x_i) >= 0x00010000) ? 0x7fffffff : \
- (((x_i) <= -0x00010000) ? 0x80000000 : \
- (((x_i)<<16) | (((x_f)>>16)&0xffff))))
-#define LFPTOFP(v) MFPTOFP(lfpsint(*v), lfprac(*v))
-
-#define UFPTOLFP(x, v) (*v = lfpinit((u_fp)(x)>>16, (x)<<16))
-#define FPTOLFP(x, v) (UFPTOLFP((x), (v)), (x) < 0 ? setlfpuint(*v, getlfpuint(*v) - 0x10000) : 0)
-
-#define MAXLFP(v) *v = lfpinit(0x7fffffffu, 0xffffffffu)
-#define MINLFP(v) *v = lfpinit(0x80000000u, 0u)
-
-/*
* Primitive operations on long fixed point values. If these are
* reminiscent of assembler op codes it's only because some may
* be replaced by inline assembler for particular machines someday.
=====================================
ntpd/refclock_generic.c
=====================================
--- a/ntpd/refclock_generic.c
+++ b/ntpd/refclock_generic.c
@@ -3046,7 +3046,7 @@ parse_control(
if (PARSE_PPS(parse->timedata.parse_state))
{
tt = add_var(&out->kv_list, 80, RO|DEF);
- snprintf(tt, 80, "refclock_ppstime=\"%s\"", gmprettydate(&parse->timedata.parse_ptime.fp));
+ snprintf(tt, 80, "refclock_ppstime=\"%s\"", gmprettydate(parse->timedata.parse_ptime.fp));
}
start = tt = add_var(&out->kv_list, 128, RO|DEF);
@@ -3059,7 +3059,7 @@ parse_control(
else
{
ap(start, 128, tt, "%s\"",
- gmprettydate(&parse->timedata.parse_time.fp));
+ gmprettydate(parse->timedata.parse_time.fp));
}
if (!PARSE_GETTIMECODE(parse, &tmpctl))
@@ -3475,8 +3475,8 @@ parse_process(
if (debug > 3)
printf("PARSE receiver #%d: Reftime %s, Recvtime %s - initial offset %s\n",
parse->peer->refclkunit,
- prettydate(&reftime),
- prettydate(&rectime),
+ prettydate(reftime),
+ prettydate(rectime),
lfptoa(off,6));
#endif
}
@@ -3505,7 +3505,7 @@ parse_process(
if (debug > 3)
printf("PARSE receiver #%d: PPStime %s\n",
parse->peer->refclkunit,
- prettydate(&offset));
+ prettydate(offset));
#endif
if (PARSE_TIMECODE(parsetime->parse_state))
{
@@ -3586,8 +3586,8 @@ parse_process(
if (debug > 3)
printf("PARSE receiver #%d: Reftime %s, Recvtime %s - final offset %s\n",
parse->peer->refclkunit,
- prettydate(&reftime),
- prettydate(&rectime),
+ prettydate(reftime),
+ prettydate(rectime),
lfptoa(off,6));
#endif
@@ -3599,8 +3599,8 @@ parse_process(
if (debug > 3)
printf("PARSE receiver #%d: calculated Reftime %s, Recvtime %s\n",
parse->peer->refclkunit,
- prettydate(&reftime),
- prettydate(&rectime));
+ prettydate(reftime),
+ prettydate(rectime));
#endif
if ((parsetime->parse_status & CVT_ADDITIONAL) &&
@@ -3670,8 +3670,8 @@ parse_process(
{
printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n",
parse->peer->refclkunit,
- prettydate(&reftime),
- prettydate(&rectime),
+ prettydate(reftime),
+ prettydate(rectime),
fudge);
}
#endif
=====================================
ntpd/refclock_magnavox.c
=====================================
--- a/ntpd/refclock_magnavox.c
+++ b/ntpd/refclock_magnavox.c
@@ -862,7 +862,7 @@ mx4200_receive(
mx4200_debug(peer, "mx4200_receive: process time: ");
mx4200_debug(peer, "%4d-%03d %02d:%02d:%02d at %s, %.6f\n",
pp->year, pp->day, pp->hour, pp->minute, pp->second,
- prettydate(&pp->lastrec), pp->offset);
+ prettydate(pp->lastrec), pp->offset);
pp->lastref = pp->lastrec;
refclock_receive(peer);
=====================================
ntptime/ntptime.c
=====================================
--- a/ntptime/ntptime.c
+++ b/ntptime/ntptime.c
@@ -334,7 +334,7 @@ main(
setlfpuint(ts, lfpuint(ts) + JAN_1970);
setlfpfrac(ts, lfpfrac(ts) + ts_roundbit);
setlfpfrac(ts, lfpfrac(ts) & ts_mask);
- printf(json ? jfmt2 : ofmt2, json ? rfc3339date(&ts) : prettydate(&ts), fdigits, (int)time_frac);
+ printf(json ? jfmt2 : ofmt2, json ? rfc3339date(&ts) : prettydate(ts), fdigits, (int)time_frac);
printf(json ? jfmt3 : ofmt3, (u_long)ntv.maxerror, (u_long)ntv.esterror);
if (rawtime)
printf(json ? jfmt4 : ofmt4,
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/35d5b333bfc8a78f9c74781b6b289d96feab4553...0eecfa88d0fa1b786903b4246290bf248ef12ca8
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170105/f148e9f5/attachment.html>
More information about the vc
mailing list