[Git][NTPsec/ntpsec][master] 3 commits: ntp_proto: Change two implicit acsts to explcit.

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


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


Commits:
10af54c6 by Gary E. Miller at 2017-05-15T20:27:54-07:00
ntp_proto: Change two implicit acsts to explcit.

Fixes 2 32-bit warnings on RasPi.

- - - - -
af4639c9 by Gary E. Miller at 2017-05-15T20:32:01-07:00
tests: fix type of free_recvbuffs()

Fixes a 32-bit RasPi warning.

- - - - -
34b6bb3a by Gary E. Miller at 2017-05-15T20:36:07-07:00
tests: change some implicit casts to explicit.

Fixes several warnings on 32-bit RasPi.

- - - - -


3 changed files:

- ntpd/ntp_proto.c
- tests/libntp/recvbuff.c
- tests/libntp/timespecops.c


Changes:

=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -2216,8 +2216,7 @@ peer_xmit(
 	peer->org = xmt_tx;
 	xpkt.xmt = htonl_fp(xmt_tx);
 	xkeyid = peer->keyid;
-	authlen = (size_t)authencrypt(xkeyid, (uint32_t *)&xpkt,
-                                      (size_t)sendlen);
+	authlen = (size_t)authencrypt(xkeyid, (uint32_t *)&xpkt, (int)sendlen);
 	if (authlen == 0) {
 		report_event(PEVNT_AUTH, peer, "no key");
 		peer->flash |= BOGON5;		/* auth error */
@@ -2398,7 +2397,7 @@ fast_xmit(
 	 */
 	get_systime(&xmt_tx);
 	sendlen += (size_t)authencrypt(xkeyid, (uint32_t *)&xpkt, (int)sendlen);
-	sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, &xpkt, sendlen);
+	sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, &xpkt, (int)sendlen);
 	get_systime(&xmt_ty);
 	xmt_ty -= xmt_tx;
 	sys_authdelay = xmt_ty;


=====================================
tests/libntp/recvbuff.c
=====================================
--- a/tests/libntp/recvbuff.c
+++ b/tests/libntp/recvbuff.c
@@ -23,7 +23,7 @@ TEST(recvbuff, Initialization) {
 }
 
 TEST(recvbuff, GetAndFree) {
-	int initial = free_recvbuffs();
+	u_long initial = free_recvbuffs();
 	recvbuf_t* buf = get_free_recv_buffer();
 
 	TEST_ASSERT_EQUAL(initial-1, free_recvbuffs());


=====================================
tests/libntp/timespecops.c
=====================================
--- a/tests/libntp/timespecops.c
+++ b/tests/libntp/timespecops.c
@@ -491,7 +491,7 @@ TEST(timespecops, test_ToLFPbittest) {
 	uint32_t i;
 
 	for (i = 0; i < 1000000000; i+=1000) {
-		struct timespec a = timespec_init(1, i);
+		struct timespec a = timespec_init(1, (long)i);
 		l_fp E= lfpinit(1, my_tick_to_tsf(i));
 		l_fp r;
 
@@ -562,7 +562,7 @@ TEST(timespecops, test_FromLFPbittest) {
 	// every 1000 fractional units.
 	uint32_t tsf;
 	for (tsf = 0; tsf < ~((uint32_t)(1000)); tsf += 1000) {
-		struct timespec E = timespec_init(1, my_tsf_to_tick(tsf));
+		struct timespec E = timespec_init(1, (long)my_tsf_to_tick(tsf));
 		l_fp a = lfpinit(1, tsf);
 		struct timespec r;
 
@@ -617,7 +617,7 @@ TEST(timespecops, test_LFProundtrip) {
 
 	for (t = -1; t < 2; ++t)
 		for (i = 4999; i < 1000000000; i += 10007) {
-			struct timespec E = timespec_init(t, i);
+			struct timespec E = timespec_init(t, (long)i);
 			l_fp a;
 			struct timespec r;
 



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/ef5ec630fec798e8cd256d14d526a64f6d1f9610...34b6bb3a67d91f0dfa561430ee3d73ffcd95273f
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/99e7a50f/attachment.html>


More information about the vc mailing list