[Git][NTPsec/ntpsec][master] 7 commits: refclock_trimble: fix bad cast to (ulong).

Gary E. Miller gitlab at mg.gitlab.com
Tue May 16 02:50:53 UTC 2017


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


Commits:
2a6a8fbc by Gary E. Miller at 2017-05-15T19:24:02-07:00
refclock_trimble: fix bad cast to (ulong).

Was creating a warning on 32-bit RasPi.

- - - - -
c2adcbce by Gary E. Miller at 2017-05-15T19:27:04-07:00
ntp_control: change implicit cast to explicit.

Was causing a warning on 32-bit RasPi.

- - - - -
46bc50ea by Gary E. Miller at 2017-05-15T19:30:31-07:00
refclock_oncore: change implicit cast to explicit.

Fixes a warning on 32-bit RasPi.

- - - - -
7c78f1a9 by Gary E. Miller at 2017-05-15T19:32:14-07:00
refclock_generic: change implicit cast to explcit.

Fix a warning on 32-bit RasPi.

- - - - -
5d9bbb31 by Gary E. Miller at 2017-05-15T19:38:47-07:00
refclock_generic: change incorrect cast: sizeof not ulong.

Fixes a warning on 32-bit RasPi.

- - - - -
b21c15f1 by Gary E. Miller at 2017-05-15T19:41:06-07:00
refclock_neoclock: chjange implicit casts to explicit.

Fixes three warnings on 32-bit RasPi.

- - - - -
15a41a73 by Gary E. Miller at 2017-05-15T19:43:13-07:00
refclock_magnavox: change implicit acst top explicit.

Fixes a warning on 32-bit RasPi.

- - - - -


6 changed files:

- ntpd/ntp_control.c
- ntpd/refclock_generic.c
- ntpd/refclock_magnavox.c
- ntpd/refclock_neoclock.c
- ntpd/refclock_oncore.c
- ntpd/refclock_trimble.c


Changes:

=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -2718,7 +2718,7 @@ read_peervars(void)
 	if (gotvar) {
 		for (i = 1; i < COUNTOF(wants); i++)
 			if (wants[i])
-				ctl_putpeer(i, peer);
+				ctl_putpeer((int)i, peer);
 	} else
 		for (cp = def_peer_var; *cp != 0; cp++)
 			ctl_putpeer((int)*cp, peer);


=====================================
ntpd/refclock_generic.c
=====================================
--- a/ntpd/refclock_generic.c
+++ b/ntpd/refclock_generic.c
@@ -1791,7 +1791,7 @@ local_input(
 	/*
 	 * eat all characters, parsing then and feeding complete samples
 	 */
-	count = rbufp->recv_length;
+	count = (int)rbufp->recv_length;
 	s = (unsigned char *)rbufp->recv_buffer;
 	ts = rbufp->recv_time;
 
@@ -4571,7 +4571,7 @@ sendetx(
 	buf->txt[buf->idx++] = DLE;
 	buf->txt[buf->idx++] = ETX;
 
-	if (write(parse->generic->io.fd, buf->txt, (unsigned long)buf->idx) != buf->idx)
+	if (write(parse->generic->io.fd, buf->txt, (size_t)buf->idx) != buf->idx)
 	{
 		ERR(ERR_BADIO)
 			msyslog(LOG_ERR, "PARSE receiver #%d: sendetx: failed to send cmd to clock: %m", parse->peer->refclkunit);


=====================================
ntpd/refclock_magnavox.c
=====================================
--- a/ntpd/refclock_magnavox.c
+++ b/ntpd/refclock_magnavox.c
@@ -1574,7 +1574,7 @@ mx4200_send(struct peer *peer, const char *fmt, ...)
 
 	vsnprintf(buf1, sizeof(buf1) - 1, fmt, ap);
         buf1[sizeof(buf1) - 1 ] = '\0';
-	ck = mx4200_cksum(buf1, strlen(buf1));
+	ck = mx4200_cksum(buf1, (int)strlen(buf1));
         /* buf can never overrun */
 	n = snprintf(buf, sizeof(buf) - 1, "$%1024s*%02X\r\n", buf1, ck);
 


=====================================
ntpd/refclock_neoclock.c
=====================================
--- a/ntpd/refclock_neoclock.c
+++ b/ntpd/refclock_neoclock.c
@@ -799,11 +799,11 @@ neol_localtime(unsigned long utc,
 	       int* min,
 	       int* sec)
 {
-  *sec = utc % 60;
+  *sec = (int)(utc % 60);
   utc /= 60;
-  *min = utc % 60;
+  *min = (int)(utc % 60);
   utc /= 60;
-  *hour = utc % 24;
+  *hour = (int)(utc % 24);
   utc /= 24;
 
   /*             JDN Date 1/1/1970 */


=====================================
ntpd/refclock_oncore.c
=====================================
--- a/ntpd/refclock_oncore.c
+++ b/ntpd/refclock_oncore.c
@@ -1238,7 +1238,7 @@ oncore_read_config(
 			*cpw = '\0';
 
 		/* Remove trailing space */
-		for (i = strlen(line);
+		for (i = (int)strlen(line);
 		     i > 0 && isascii((unsigned char)line[i - 1]) && isspace((unsigned char)line[i - 1]);
 			)
 			line[--i] = '\0';


=====================================
ntpd/refclock_trimble.c
=====================================
--- a/ntpd/refclock_trimble.c
+++ b/ntpd/refclock_trimble.c
@@ -303,7 +303,7 @@ sendetx (
 	
 	*(buffer->data+buffer->size++) = DLE;
 	*(buffer->data+buffer->size++) = ETX;
-	result = write(fd, buffer->data, (unsigned long)buffer->size);
+	result = write(fd, buffer->data, (size_t)buffer->size);
 	
 	if (result != -1)
 		return (result);



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

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


More information about the vc mailing list