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

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


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


Commits:
ab3f5a15 by Gary E. Miller at 2017-05-15T20:07:53-07:00
sht: change implicit cast to explicit.

Fixes a warning on 32-bit RasPi.

- - - - -
de8db0a3 by Gary E. Miller at 2017-05-15T20:15:07-07:00
ntp_proto: Change several implicit casts to explicit.

Plus a bad cast.  Fixes warnings on 32-bit RasPi.

- - - - -


2 changed files:

- attic/sht.c
- ntpd/ntp_proto.c


Changes:

=====================================
attic/sht.c
=====================================
--- a/attic/sht.c
+++ b/attic/sht.c
@@ -90,7 +90,7 @@ main (
 		exit (0);
 	}
 
-	unit = strtoul(argv[1], &argp, 10);
+	unit = (int)strtoul(argv[1], &argp, 10);
 	if (argp == argv[1])
 		unit = 2;
 	else if (*argp == ':')


=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -2216,7 +2216,8 @@ peer_xmit(
 	peer->org = xmt_tx;
 	xpkt.xmt = htonl_fp(xmt_tx);
 	xkeyid = peer->keyid;
-	authlen = (size_t)authencrypt(xkeyid, (uint32_t *)&xpkt, sendlen);
+	authlen = (size_t)authencrypt(xkeyid, (uint32_t *)&xpkt,
+                                      (size_t)sendlen);
 	if (authlen == 0) {
 		report_event(PEVNT_AUTH, peer, "no key");
 		peer->flash |= BOGON5;		/* auth error */
@@ -2228,9 +2229,8 @@ peer_xmit(
 		msyslog(LOG_ERR, "proto: buffer overflow %zu", sendlen);
 		exit(1);
 	}
-	peer->t21_bytes = sendlen;
-	sendpkt(&peer->srcadr, peer->dstadr, &xpkt,
-	    sendlen);
+	peer->t21_bytes = (int)sendlen;
+	sendpkt(&peer->srcadr, peer->dstadr, &xpkt, (int)sendlen);
 	peer->sent++;
         peer->outcount++;
 	peer->throttle += (1 << peer->minpoll) - 2;
@@ -2379,7 +2379,7 @@ fast_xmit(
 	 */
 	sendlen = LEN_PKT_NOMAC;
 	if (rbufp->recv_length == sendlen) {
-		sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, &xpkt, sendlen);
+		sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, &xpkt, (int)sendlen);
 #ifdef DEBUG
 		if (debug)
 			printf(
@@ -2397,7 +2397,7 @@ fast_xmit(
 	 * cryptosum.
 	 */
 	get_systime(&xmt_tx);
-	sendlen += (size_t)authencrypt(xkeyid, (uint32_t *)&xpkt, sendlen);
+	sendlen += (size_t)authencrypt(xkeyid, (uint32_t *)&xpkt, (int)sendlen);
 	sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, &xpkt, sendlen);
 	get_systime(&xmt_ty);
 	xmt_ty -= xmt_tx;
@@ -2807,7 +2807,7 @@ proto_config(
 #endif /* REFCLOCK */
 
 	case PROTO_KERNEL:	/* kernel discipline (kernel) */
-		select_loop(value);
+		select_loop((int)value);
 		break;
 
 	case PROTO_MONITOR:	/* monitoring (monitor) */



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/15a41a738ca80c2f9224135b98496887b615f345...de8db0a3a67e0587ff48e5eafda542d36e201f78
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/e8b316a6/attachment.html>


More information about the vc mailing list