[Git][NTPsec/ntpsec][master] 3 commits: tests: fix signed/unsigned confusion.

Gary E. Miller gitlab at mg.gitlab.com
Tue May 16 22:29:19 UTC 2017


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


Commits:
e3367741 by Gary E. Miller at 2017-05-16T15:05:09-07:00
tests: fix signed/unsigned confusion.

Fixes several warnings on 32-bit RasPi.

- - - - -
7aaa9fcd by Gary E. Miller at 2017-05-16T15:12:13-07:00
refclock_gpsd: stop some unsigned/signed shuffling.

Fixes a warning on 32-bit RasPi.

- - - - -
e01e5067 by Gary E. Miller at 2017-05-16T15:28:18-07:00
refclock_generic: make an implicit cast explicit.

This fixes a warning on 32-bit RasPi.

- - - - -


3 changed files:

- ntpd/refclock_generic.c
- ntpd/refclock_gpsd.c
- tests/ntpd/leapsec.c


Changes:

=====================================
ntpd/refclock_generic.c
=====================================
--- a/ntpd/refclock_generic.c
+++ b/ntpd/refclock_generic.c
@@ -5073,8 +5073,11 @@ trimbletsip_message(
 		break;
 
 		case CMD_RMESSAGE:
-			mkreadable(t, (int)BUFFER_SIZE(pbuffer, t), (char *)&mb(0),
-                                   (unsigned)(size - 2u - (&mb(0) - buffer)), 0);
+			mkreadable(t, (int)BUFFER_SIZE(pbuffer, t),
+                                   (char *)&mb(0),
+                                   (unsigned)(size - 2u -
+                                              (unsigned)(&mb(0) - buffer)),
+                                   0);
 			break;
 
 		case CMD_RMACHSTAT:


=====================================
ntpd/refclock_gpsd.c
=====================================
--- a/ntpd/refclock_gpsd.c
+++ b/ntpd/refclock_gpsd.c
@@ -2050,7 +2050,7 @@ convert_ascii_time(
 	char           *ep;
 	struct tm       gd;
 	struct timespec ts;
-	uint32_t        dw;
+	long   dw;
 
 	/* Use 'strptime' to take the brunt of the work, then parse
 	 * the fractional part manually, starting with a digit weight of


=====================================
tests/ntpd/leapsec.c
=====================================
--- a/tests/ntpd/leapsec.c
+++ b/tests/ntpd/leapsec.c
@@ -83,7 +83,7 @@ static const char leap2 [] =
     "2950473600	28	# 1 Jul 1993\n"
     "#\n";
 
-// Faked table with a leap second removal at 2009 
+// Faked table with a leap second removal at 2009
 static const char leap3 [] =
     "#\n"
     "#@ 	3610569600\n"
@@ -592,11 +592,14 @@ TEST(leapsec, addDynamic) {
 	TEST_ASSERT_TRUE(rc);
 
 	for (idx=1; insns[idx]; ++idx) {
-	    rc = leapsec_add_dyn(true, insns[idx]-JAN_1970 - 20*SECSPERDAY - 100);
+	    rc = leapsec_add_dyn(true,
+                                 insns[idx] - (time_t)JAN_1970 -
+                                 20*SECSPERDAY - 100);
 	    TEST_ASSERT_TRUE(rc);
 	}
 	// try to slip in a previous entry
-	rc = leapsec_add_dyn(true, insns[0]-JAN_1970 - 20*SECSPERDAY - 100);
+	rc = leapsec_add_dyn(true, insns[0] - (time_t)JAN_1970 -
+                             20*SECSPERDAY - 100);
 	TEST_ASSERT_FALSE(rc);
 	//leapsec_dump(pt, (leapsec_dumper)fprintf, stdout);
 	pt = leapsec_get_table(0);



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

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


More information about the vc mailing list