]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Cleared some simple Coverity issues
authorSteve Underwood <steveu@coppice.org>
Wed, 30 Apr 2014 04:42:46 +0000 (12:42 +0800)
committerSteve Underwood <steveu@coppice.org>
Wed, 30 Apr 2014 04:42:46 +0000 (12:42 +0800)
libs/spandsp/src/at_interpreter.c
libs/spandsp/src/bert.c
libs/spandsp/src/fax.c
libs/spandsp/src/spandsp/g711.h
libs/spandsp/src/t30.c
libs/spandsp/src/t4_tx.c

index 73cdf879a0fe5ff2e76008aeee114262599f3b14..dbe490badde0a0055d1807b9899ff87da9f8b68e 100644 (file)
@@ -771,8 +771,8 @@ static int parse_string_out(at_state_t *s, const char **t, char **target, const
     default:
         return false;
     }
-    while (*t)
-        t++;
+    while (**t)
+        (*t)++;
     return true;
 }
 /*- End of function --------------------------------------------------------*/
index 728476d65edf7db25057248e73c5b61cb4a8640c..7a4f9511bb261714a33a5aba6f6df9d61a18359a 100644 (file)
@@ -149,7 +149,7 @@ static void assess_error_rate(bert_state_t *s)
        (i.e. we look for >=10 errors in 1000 bits). We make an assessment every 100 bits, using a sliding
        window over the last 1000 bits. We assess the 1 in 1000 rate over 10000 bits in a similar way, and
        so on for the lower error rates. */
-    test = false;
+    test = true;
     for (i = 2;  i <= 7;  i++)
     {
         if (++s->decade_ptr[i] < 10)
index 196c9ab0d38056fa2853c83b229cb6c86fef58eb..c43abd02435fc339e0226edfa59513a471bf928f 100644 (file)
@@ -274,6 +274,7 @@ static void fax_set_rx_type(void *user_data, int type, int bit_rate, int short_t
         break;
     case T30_MODEM_DONE:
         span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n");
+        /* Fall through */
     default:
         fax_modems_set_rx_handler(t, (span_rx_handler_t) &span_dummy_rx, s, (span_rx_fillin_handler_t) &span_dummy_rx_fillin, s);
         break;
index 1e2a7f652cf2dda2614a10e02cde7382a338a578..438861651e0c4f47f73a105aa12accaea10d802d 100644 (file)
@@ -226,7 +226,7 @@ static __inline__ uint8_t linear_to_alaw(int linear)
             return (uint8_t) (0x7F ^ mask);
         }
         /* We must be just a tiny step below zero */
-        return (uint8_t) (0x00 ^ mask);
+        return (uint8_t) mask;
     }
     /* Combine the sign, segment, and quantization bits. */
     return (uint8_t) (((seg << 4) | ((linear >> ((seg)  ?  (seg + 3)  :  4)) & 0x0F)) ^ mask);
index de71d910673abe00d80ec976f6f94f9a29ef2a35..ed1a6f4e0e895b66edeb8eb67b5d752fca8026de 100644 (file)
@@ -964,7 +964,7 @@ static int send_nsf_frame(t30_state_t *s)
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending user supplied NSF - %d octets\n", s->tx_info.nsf_len);
         s->tx_info.nsf[0] = ADDRESS_FIELD;
         s->tx_info.nsf[1] = CONTROL_FIELD_NON_FINAL_FRAME;
-        s->tx_info.nsf[2] = (uint8_t) (T30_NSF | s->dis_received);
+        s->tx_info.nsf[2] = T30_NSF;
         send_frame(s, s->tx_info.nsf, s->tx_info.nsf_len + 3);
         return true;
     }
@@ -996,7 +996,7 @@ static int send_nsc_frame(t30_state_t *s)
         span_log(&s->logging, SPAN_LOG_FLOW, "Sending user supplied NSC - %d octets\n", s->tx_info.nsc_len);
         s->tx_info.nsc[0] = ADDRESS_FIELD;
         s->tx_info.nsc[1] = CONTROL_FIELD_NON_FINAL_FRAME;
-        s->tx_info.nsc[2] = (uint8_t) (T30_NSC | s->dis_received);
+        s->tx_info.nsc[2] = T30_NSC;
         send_frame(s, s->tx_info.nsc, s->tx_info.nsc_len + 3);
         return true;
     }
index 49bcd90915d490c1e1d2a50fe6761d62d4b1f8bb..ccad8db9d832e5502ac9db7c5c47a83fba13122b 100644 (file)
@@ -325,7 +325,7 @@ static int best_colour_resolution(float actual, int allowed_resolutions)
         return -1;
 
     best_ratio = 0.0f;
-    best_entry = -1;
+    best_entry = 0;
     for (i = 0;  x_res_table[i].resolution > 0.0f;  i++)
     {
         if (!(allowed_resolutions & x_res_table[i].resolution_code))