]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Fix Clang static analyzer warnings about never read values
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 7 Oct 2013 14:10:25 +0000 (16:10 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 7 Oct 2013 15:50:27 +0000 (17:50 +0200)
cmdmon.c
ntp_core.c
sourcestats.c

index a917f03af3d735bf9952c036d7d43a5de40dc369..fe63cbd28a6b5cfb791734b029aeb4f6293302a6 100644 (file)
--- a/cmdmon.c
+++ b/cmdmon.c
@@ -1937,8 +1937,6 @@ read_from_cmd_socket(void *anything)
     /* This should be already handled */
     assert(0);
   } else {
-    allowed = 0;
-
     /* Check level of authority required to issue the command */
     switch(permissions[rx_command]) {
       case PERMIT_AUTH:
@@ -1960,6 +1958,7 @@ read_from_cmd_socket(void *anything)
         break;
       default:
         assert(0);
+        allowed = 0;
     }
 
     if (allowed) {
index 31f69efb9d96d34e98f26633ca2c87646b951e07..0db12fd95a7535079149e394b5c96c9c2a093e5d 100644 (file)
@@ -1548,6 +1548,8 @@ NCR_SlewTimes(NCR_Instance inst, struct timeval *when, double dfreq, double doff
 #ifdef TRACEON
   LOG(LOGS_INFO, LOGF_NtpCore, "rx prev=[%s] new=[%s]",
       UTI_TimevalToString(&prev), UTI_TimevalToString(&inst->local_rx));
+#else
+  (void)prev;
 #endif
   prev = inst->local_tx;
   if (inst->local_tx.tv_sec || inst->local_tx.tv_usec)
index 8df77400caa10348899c932fe86bf3d1406a5472..bde12619f1651c3b5e05cc47f2a5ee5710029d62 100644 (file)
@@ -631,7 +631,7 @@ SST_SlewSamples(SST_Stats inst, struct timeval *when, double dfreq, double doffs
         i, UTI_TimevalToString(&prev), UTI_TimevalToString(sample),
         prev_offset, inst->offsets[i]);
 #else
-    (void)prev_offset;
+    (void)prev; (void)prev_offset;
 #endif
   }
 
@@ -650,7 +650,7 @@ SST_SlewSamples(SST_Stats inst, struct timeval *when, double dfreq, double doffs
       prev_offset, inst->estimated_offset,
       1.0e6*prev_freq, 1.0e6*inst->estimated_frequency);
 #else
-  (void)prev; (void)prev_freq;
+  (void)prev; (void)prev_offset; (void)prev_freq;
 #endif
 }