[Git][NTPsec/ntpsec][master] Fix a few more warnings.

Hal Murray gitlab at mg.gitlab.com
Fri Apr 14 08:33:29 UTC 2017


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
72346a76 by Hal Murray at 2017-04-14T01:31:57-07:00
Fix a few more warnings.

- - - - -


3 changed files:

- ntpd/ntp_io.c
- tests/libntp/vi64ops.c
- tests/unity/unity.c


Changes:

=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -251,7 +251,7 @@ static void		maintain_activefds(int fd, bool closing);
 /*
  * Routines to read the ntp packets
  */
-static inline int	read_network_packet	(SOCKET, endpt *, l_fp);
+static int	read_network_packet	(SOCKET, endpt *, l_fp);
 static void input_handler (fd_set *, l_fp *);
 #ifdef REFCLOCK
 static int	read_refclock_packet	(SOCKET, struct refclockio *, l_fp);
@@ -2223,7 +2223,7 @@ read_refclock_packet(
  * Return the number of bytes read. That way we know if we should
  * read it again or go on to the next one if no bytes returned
  */
-static inline int
+static int
 read_network_packet(
 	SOCKET			fd,
 	endpt *	itf,


=====================================
tests/libntp/vi64ops.c
=====================================
--- a/tests/libntp/vi64ops.c
+++ b/tests/libntp/vi64ops.c
@@ -11,31 +11,31 @@ TEST_SETUP(vi64ops) {}
 TEST_TEAR_DOWN(vi64ops) {}
 
 TEST(vi64ops, SetVUI64s_pos) {
-	time64_t exp = 0;
+	time64_t expx = 0;
 
-	settime64s(exp, 0x0123456789ABCDEF);
-	TEST_ASSERT_EQUAL(time64s(exp), 81985529216486895);
+	settime64s(expx, 0x0123456789ABCDEF);
+	TEST_ASSERT_EQUAL(time64s(expx), 81985529216486895);
 }
 
 TEST(vi64ops, SetVUI64s_neg) {
-	time64_t exp = 0;
+	time64_t expx = 0;
 
-	settime64s(exp, 0xFEDCBA9876543210);
-	TEST_ASSERT_EQUAL(time64s(exp), -81985529216486896);
+	settime64s(expx, 0xFEDCBA9876543210);
+	TEST_ASSERT_EQUAL(time64s(expx), -81985529216486896);
 }
 
 TEST(vi64ops, SetVUI64u) {
-	time64_t exp = 0;
+	time64_t expx = 0;
 
-	settime64u(exp, 0xFEDCBA9876543210);	/* sign bit is on */
-	TEST_ASSERT_EQUAL(time64s(exp), 18364758544493064720UL);
+	settime64u(expx, 0xFEDCBA9876543210);	/* sign bit is on */
+	TEST_ASSERT_EQUAL(time64s(expx), 18364758544493064720UL);
 }
 
 TEST(vi64ops, NegVUI64) {
-	time64_t exp = 0;
+	time64_t expx = 0;
 
-	settime64s(exp, 71985529216486896);
-	TEST_ASSERT_EQUAL(negtime64(exp), -71985529216486896);
+	settime64s(expx, 71985529216486896);
+	TEST_ASSERT_EQUAL(negtime64(expx), -71985529216486896);
 }
 
 TEST_GROUP_RUNNER(vi64ops) {


=====================================
tests/unity/unity.c
=====================================
--- a/tests/unity/unity.c
+++ b/tests/unity/unity.c
@@ -1025,7 +1025,7 @@ void UnityAssertEqualStringArray(UNITY_INTERNAL_PTR expected,
 {
     UNITY_UINT32 i = 0;
     UNITY_UINT32 j = 0;
-    const char* exp = NULL;
+    const char* expx = NULL;
     const char* act = NULL;
 
     RETURN_IF_FAIL_OR_IGNORE;
@@ -1048,7 +1048,7 @@ void UnityAssertEqualStringArray(UNITY_INTERNAL_PTR expected,
 
     if (flags != UNITY_ARRAY_TO_ARRAY)
     {
-        exp = (const char*)expected;
+        expx = (const char*)expected;
     }
 
     do
@@ -1056,15 +1056,15 @@ void UnityAssertEqualStringArray(UNITY_INTERNAL_PTR expected,
         act = actual[j];
         if (flags == UNITY_ARRAY_TO_ARRAY)
         {
-            exp = ((const char* const*)expected)[j];
+            expx = ((const char* const*)expected)[j];
         }
 
         /* if both pointers not null compare the strings */
-        if (exp && act)
+        if (expx && act)
         {
-            for (i = 0; exp[i] || act[i]; i++)
+            for (i = 0; expx[i] || act[i]; i++)
             {
-                if (exp[i] != act[i])
+                if (expx[i] != act[i])
                 {
                     Unity.CurrentTestFailed = 1;
                     break;
@@ -1073,7 +1073,7 @@ void UnityAssertEqualStringArray(UNITY_INTERNAL_PTR expected,
         }
         else
         { /* handle case of one pointers being null (if both null, test should pass) */
-            if (exp != act)
+            if (expx != act)
             {
                 Unity.CurrentTestFailed = 1;
             }
@@ -1087,7 +1087,7 @@ void UnityAssertEqualStringArray(UNITY_INTERNAL_PTR expected,
                 UnityPrint(UnityStrElement);
                 UnityPrintNumberUnsigned(j);
             }
-            UnityPrintExpectedAndActualStrings(exp, act);
+            UnityPrintExpectedAndActualStrings(expx, act);
             UnityAddMsgIfSpecified(msg);
             UNITY_FAIL_AND_BAIL;
         }



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/72346a76562f2c6e5c86beadcd82b03e4b3f06ad

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/72346a76562f2c6e5c86beadcd82b03e4b3f06ad
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/20170414/e5a98717/attachment.html>


More information about the vc mailing list