[Git][NTPsec/ntpsec][master] 2 commits: ntp_loopfilter: change implicit cast to explicit.

Gary E. Miller gitlab at mg.gitlab.com
Tue May 16 03:22:49 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
ae41390f by Gary E. Miller at 2017-05-15T20:21:32-07:00
ntp_loopfilter: change implicit cast to explicit.

Fixes a warning on 32-bit RasPi.

- - - - -
ef5ec630 by Gary E. Miller at 2017-05-15T20:22:00-07:00
refclock_shm: Change 4 implicit casts to explicit.

Fixes 4 warnings on 32-bit Raspi.

- - - - -


2 changed files:

- ntpd/ntp_loopfilter.c
- ntpd/refclock_shm.c


Changes:

=====================================
ntpd/ntp_loopfilter.c
=====================================
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -845,7 +845,7 @@ local_clock(
 		if (loop_tai != sys_tai) {
 			loop_tai = sys_tai;
 			ntv.modes = MOD_TAI;
-			ntv.constant = sys_tai;
+			ntv.constant = (long)sys_tai;
 			if ((ntp_adj_ret = ntp_adjtime_ns(&ntv)) != 0) {
 			    ntp_adjtime_error_handler(__func__, &ntv, ntp_adj_ret, errno, false, true, __LINE__ - 1);
 			}


=====================================
ntpd/refclock_shm.c
=====================================
--- a/ntpd/refclock_shm.c
+++ b/ntpd/refclock_shm.c
@@ -391,8 +391,8 @@ static enum segstat_t shm_query(volatile struct shmTime *shm_in, struct shm_stat
 	*/
 	if (   ((cns_new - (unsigned)shm_stat->tvt.tv_nsec) < 1000)
 	       && ((rns_new - (unsigned)shm_stat->tvr.tv_nsec) < 1000)) {
-	    shm_stat->tvt.tv_nsec = cns_new;
-	    shm_stat->tvr.tv_nsec = rns_new;
+	    shm_stat->tvt.tv_nsec = (long)cns_new;
+	    shm_stat->tvr.tv_nsec = (long)rns_new;
 	}
 	/* At this point shm_stat->tvr and shm_stat->tvt contain valid ns-level
 	** timestamps, possibly generated by extending the old
@@ -414,8 +414,8 @@ static enum segstat_t shm_query(volatile struct shmTime *shm_in, struct shm_stat
 	*/
 	if (   ((cns_new - (unsigned)shm_stat->tvt.tv_nsec) < 1000)
 	       && ((rns_new - (unsigned)shm_stat->tvr.tv_nsec) < 1000)) {
-	    shm_stat->tvt.tv_nsec = cns_new;
-	    shm_stat->tvr.tv_nsec = rns_new;
+	    shm_stat->tvt.tv_nsec = (long)cns_new;
+	    shm_stat->tvr.tv_nsec = (long)rns_new;
 	}
 	/* At this point shm_stat->tvr and shm_stat->tvt contains valid ns-level
 	** timestamps, possibly generated by extending the old



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/de8db0a3a67e0587ff48e5eafda542d36e201f78...ef5ec630fec798e8cd256d14d526a64f6d1f9610

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/de8db0a3a67e0587ff48e5eafda542d36e201f78...ef5ec630fec798e8cd256d14d526a64f6d1f9610
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170516/a7474b9e/attachment.html>


More information about the vc mailing list