[Git][NTPsec/ntpsec][master] 3 commits: libparse: make implicit cast into explicit one.

Gary E. Miller gitlab at mg.gitlab.com
Tue May 23 03:07:25 UTC 2017


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


Commits:
d55122a6 by Gary E. Miller at 2017-05-22T19:56:12-07:00
libparse: make implicit cast into explicit one.

fixes a clang warning.

- - - - -
4daba0e0 by Gary E. Miller at 2017-05-22T19:59:03-07:00
libparse: make 2 implicit conversions explcit.

Found by clang.

- - - - -
55d764c8 by Gary E. Miller at 2017-05-22T20:03:09-07:00
libntp: maike implicit conversion explicit.

- - - - -


3 changed files:

- libntp/authreadkeys.c
- libparse/binio.c
- libparse/ieee754io.c


Changes:

=====================================
libntp/authreadkeys.c
=====================================
--- a/libntp/authreadkeys.c
+++ b/libntp/authreadkeys.c
@@ -193,7 +193,7 @@ msyslog(LOG_ERR, "authreadkeys: reading %s", file);
 				if (j & 1)
 					keystr[j / 2] |= temp;
 				else
-					keystr[j / 2] = temp << 4;
+					keystr[j / 2] = (uint8_t)(temp << 4);
 			}
 			if (j < jlim) {
 			    msyslog(LOG_ERR,


=====================================
libparse/binio.c
=====================================
--- a/libparse/binio.c
+++ b/libparse/binio.c
@@ -60,7 +60,7 @@ getmsb_short(
 	 unsigned char *p
 	 )
 {
-	return get_msb_short(&p);
+	return (short) get_msb_short(&p);
 }
 
 long


=====================================
libparse/ieee754io.c
=====================================
--- a/libparse/ieee754io.c
+++ b/libparse/ieee754io.c
@@ -135,13 +135,13 @@ fetch_ieee754(
     *lfpp = 0;          /* return zero for all errors: NAN, +INF, -INF, etc. */
 
     /* fetch sign byte & first part of characteristic */
-    val = get_byte(bufp, offsets, &fieldindex);
+    val = (unsigned char)get_byte(bufp, offsets, &fieldindex);
 
     sign = (val & 0x80) != 0;
     characteristic = (val & 0x7F);
 
     /* fetch rest of characteristic and start of mantissa */
-    val = get_byte(bufp, offsets, &fieldindex);
+    val = (unsigned char)get_byte(bufp, offsets, &fieldindex);
 
     switch (size) {
     case IEEE_DOUBLE:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/ebef11ae38d4b67cab5f9f04cc299ae3623f63b4...55d764c84728f64a60ea8e867c58016f3d3f213d

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/ebef11ae38d4b67cab5f9f04cc299ae3623f63b4...55d764c84728f64a60ea8e867c58016f3d3f213d
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/20170523/08158de3/attachment.html>


More information about the vc mailing list