aboutsummaryrefslogtreecommitdiff
path: root/contrib/ntp/libparse
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/libparse')
-rw-r--r--contrib/ntp/libparse/Makefile.in4
-rw-r--r--contrib/ntp/libparse/clk_trimtsip.c14
-rw-r--r--contrib/ntp/libparse/gpstolfp.c5
3 files changed, 7 insertions, 16 deletions
diff --git a/contrib/ntp/libparse/Makefile.in b/contrib/ntp/libparse/Makefile.in
index 4ff96bbb19c0..b95eb1cc6c0f 100644
--- a/contrib/ntp/libparse/Makefile.in
+++ b/contrib/ntp/libparse/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/contrib/ntp/libparse/clk_trimtsip.c b/contrib/ntp/libparse/clk_trimtsip.c
index 64359efa0b32..8cf5660657cc 100644
--- a/contrib/ntp/libparse/clk_trimtsip.c
+++ b/contrib/ntp/libparse/clk_trimtsip.c
@@ -265,9 +265,7 @@ cvt_trimtsip(
clock_time->flags = PARSEB_POWERUP;
return CVT_OK;
}
- if (week < GPSWRAP) {
- week += GPSWEEKS;
- }
+ week = basedate_expand_gpsweek(week);
/* time OK */
@@ -351,14 +349,12 @@ cvt_trimtsip(
int tls = t->t_gpsutc = (u_short) getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */
int tlsf = t->t_gpsutcleap = (u_short) getshort((unsigned char *)&mb(24)); /* new leap correction */
- t->t_weekleap = (u_short) getshort((unsigned char *)&mb(20)); /* week no of leap correction */
- if (t->t_weekleap < GPSWRAP)
- t->t_weekleap = (u_short)(t->t_weekleap + GPSWEEKS);
+ t->t_weekleap = basedate_expand_gpsweek(
+ (u_short) getshort((unsigned char *)&mb(20))); /* week no of leap correction */
t->t_dayleap = (u_short) getshort((unsigned char *)&mb(22)); /* day in week of leap correction */
- t->t_week = (u_short) getshort((unsigned char *)&mb(18)); /* current week no */
- if (t->t_week < GPSWRAP)
- t->t_week = (u_short)(t->t_weekleap + GPSWEEKS);
+ t->t_week = basedate_expand_gpsweek(
+ (u_short) getshort((unsigned char *)&mb(18))); /* current week no */
lbp = (unsigned char *)&mb(14); /* last update time */
if (fetch_ieee754(&lbp, IEEE_SINGLE, &t0t, trim_offsets) != IEEE_OK)
diff --git a/contrib/ntp/libparse/gpstolfp.c b/contrib/ntp/libparse/gpstolfp.c
index 8a3607514985..6a99e8851fd7 100644
--- a/contrib/ntp/libparse/gpstolfp.c
+++ b/contrib/ntp/libparse/gpstolfp.c
@@ -45,11 +45,6 @@ gpstolfp(
l_fp * lfp
)
{
- if (weeks < GPSWRAP)
- {
- weeks += GPSWEEKS;
- }
-
lfp->l_ui = (uint32_t)(weeks * SECSPERWEEK + days * SECSPERDAY + seconds + GPSORIGIN); /* convert to NTP time */
lfp->l_uf = 0;
}