[Git][NTPsec/ntpsec][master] 2 commits: refclock_generic: fix overagressive cast.

Gary E. Miller gitlab at mg.gitlab.com
Tue May 16 21:45:25 UTC 2017


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


Commits:
a1c8fd1a by Gary E. Miller at 2017-05-16T14:36:59-07:00
refclock_generic: fix overagressive cast.

Fixs a warnng on 32-bit RasPi.

- - - - -
3c2bb5b5 by Gary E. Miller at 2017-05-16T14:44:19-07:00
refclock_generic: make some implicit casts explicit.

Fixes some warnings on 32-bit RasPi.

- - - - -


1 changed file:

- ntpd/refclock_generic.c


Changes:

=====================================
ntpd/refclock_generic.c
=====================================
--- a/ntpd/refclock_generic.c
+++ b/ntpd/refclock_generic.c
@@ -1832,7 +1832,8 @@ local_input(
 							else
 							  pts = pps_info.assert_timestamp;
 
-							setlfpuint(parse->parseio.parse_dtime.parse_ptime, (uint32_t) (pts.tv_sec + JAN_1970));
+							setlfpuint(parse->parseio.parse_dtime.parse_ptime,
+                                                                   (uint64_t)pts.tv_sec + JAN_1970);
 
 							dtemp = (double) pts.tv_nsec * S_PER_NS;
 							if (dtemp < 0.) {
@@ -4106,7 +4107,9 @@ gps16x_message(
 					if (utc.valid)
 					{
 						p = ap(buffer, sizeof(buffer), p, "gps_utc_correction=\"");
-						mk_utcinfo(p, utc.t0t.wn, utc.WNlsf, utc.DNt, utc.delta_tls, utc.delta_tlsf, BUFFER_SIZE(buffer, p));
+						mk_utcinfo(p, utc.t0t.wn, utc.WNlsf, utc.DNt,
+                                                           utc.delta_tls, utc.delta_tlsf,
+                                                           (int)BUFFER_SIZE(buffer, p));
 						p += strlen(p);
 						ap(buffer, sizeof(buffer), p, "\"");
 					}
@@ -5070,7 +5073,8 @@ trimbletsip_message(
 		break;
 
 		case CMD_RMESSAGE:
-			mkreadable(t, (int)BUFFER_SIZE(pbuffer, t), (char *)&mb(0), (unsigned)(size - 2 - (&mb(0) - buffer)), 0);
+			mkreadable(t, (int)BUFFER_SIZE(pbuffer, t), (char *)&mb(0),
+                                   (unsigned)(size - 2u - (&mb(0) - buffer)), 0);
 			break;
 
 		case CMD_RMACHSTAT:
@@ -5119,7 +5123,8 @@ trimbletsip_message(
 
 			if ((int)t0t != 0)
 			{
-				mk_utcinfo(t, wnt, wnlsf, dn, dtls, dtlsf, BUFFER_SIZE(pbuffer, t));
+				mk_utcinfo(t, wnt, wnlsf, dn, dtls, dtlsf,
+                                           (int)BUFFER_SIZE(pbuffer, t));
 			}
 			else
 			{



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/7c904c055c3044e2847b89c2b687283bfb67cfda...3c2bb5b5eaeb5c7d50f2729daf022700405484d8

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/7c904c055c3044e2847b89c2b687283bfb67cfda...3c2bb5b5eaeb5c7d50f2729daf022700405484d8
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/d457d813/attachment.html>


More information about the vc mailing list