]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Eliminate some clang warnings
authorSteve Underwood <steveu@coppice.org>
Wed, 30 Apr 2014 14:18:46 +0000 (22:18 +0800)
committerSteve Underwood <steveu@coppice.org>
Wed, 30 Apr 2014 14:18:46 +0000 (22:18 +0800)
libs/spandsp/src/spandsp/private/sig_tone.h
libs/spandsp/src/t35.c
libs/spandsp/src/t42.c
libs/spandsp/src/t43.c
libs/spandsp/src/t4_t6_decode.c
libs/spandsp/src/v18.c
libs/spandsp/src/v22bis_rx.c

index 3ec02d9bf9328cb49a8d28e22e0aec74937b57ca..1353d32ee1c0fe86df6853cdfbc834a0bfc7db93 100644 (file)
@@ -111,12 +111,21 @@ typedef struct
     /*! \brief The coefficients for the single bi-quad flat mode filter. */
     const sig_tone_flat_coeffs_t *flat;
 
+#if defined(SPANDSP_USE_FIXED_POINT)
     /*! \brief Minimum signalling tone to total power ratio, in dB */
     int16_t detection_ratio;
     /*! \brief Minimum total power for detection in sharp mode, in dB */
     int16_t sharp_detection_threshold;
     /*! \brief Minimum total power for detection in flat mode, in dB */
     int16_t flat_detection_threshold;
+#else
+    /*! \brief Minimum signalling tone to total power ratio, in dB */
+    float detection_ratio;
+    /*! \brief Minimum total power for detection in sharp mode, in dB */
+    float sharp_detection_threshold;
+    /*! \brief Minimum total power for detection in flat mode, in dB */
+    float flat_detection_threshold;
+#endif
 } sig_tone_descriptor_t;
 
 /*!
index ce04a6ce230916e06361fcda38dc8a26d30f7731..f44f872fb391c93da757c1929fd9ea6d67808be7 100644 (file)
@@ -368,6 +368,13 @@ static const nsf_data_t vendor_20[] =
     {NULL, 0, NULL, false, NULL}
 };
 
+static const nsf_data_t vendor_61[] =
+{
+    /* Korea */
+    {"\x00\x7A", 2, "Xerox", false, NULL},
+    {NULL, 0, NULL, false, NULL}
+};
+
 static const nsf_data_t vendor_64[] =
 {
     /* China (not Lebanon) */
@@ -378,13 +385,6 @@ static const nsf_data_t vendor_64[] =
     {NULL, 0, NULL, false, NULL}
 };
 
-static const nsf_data_t vendor_61[] =
-{
-    /* Korea */
-    {"\x00\x7A", 2, "Xerox", false, NULL},
-    {NULL, 0, NULL, false, NULL}
-};
-
 static const nsf_data_t vendor_86[] =
 {
     /* Korea (not Papua New Guinea) */
@@ -423,18 +423,11 @@ static const nsf_data_t vendor_86[] =
     {NULL, 0, NULL, false, NULL}
 };
 
-static const nsf_data_t vendor_bc[] =
-{
-    /* France */
-    {"\x53\x01", 2, "Minolta", false, NULL},
-    {NULL, 0, NULL, false, NULL}
-};
-
 static const nsf_data_t vendor_ad[] =
 {
     /* United States (not Tunisia) */
     {"\x00\x00", 2, "Pitney Bowes", false, PitneyBowes},
-    {"\x00\x0C", 2, "Dialogic", false, NULL},
+    {"\x00\x0C", 2, "Dialogic", false, Dialogic},
     {"\x00\x15", 2, "Lexmark", false, Lexmark},
     {"\x00\x16", 2, "JetFax", false, JetFax},
     {"\x00\x24", 2, "Octel", false, NULL},
@@ -475,7 +468,7 @@ static const nsf_data_t vendor_b5[] =
     {"\x00\x2A", 2, "STF Tech", false, NULL},
     {"\x00\x2C", 2, "HKB", false, NULL},
     {"\x00\x2E", 2, "Delrina", false, NULL},
-    {"\x00\x30", 2, "Dialogic", false, NULL},
+    {"\x00\x30", 2, "Dialogic", false, Dialogic},
     {"\x00\x32", 2, "Applied Synergy", false, NULL},
     {"\x00\x34", 2, "Syncro Development", false, NULL},
     {"\x00\x36", 2, "Genoa", false, NULL},
@@ -534,6 +527,13 @@ static const nsf_data_t vendor_b5[] =
     {NULL, 0, NULL, false, NULL}
 };
 
+static const nsf_data_t vendor_bc[] =
+{
+    /* France (not Vietnam) */
+    {"\x53\x01", 2, "Minolta", false, NULL},
+    {NULL, 0, NULL, false, NULL}
+};
+
 static const country_code_t t35_country_codes[255] =
 {
     {"Japan", vendor_00},                                   /* 0x00 */
@@ -724,7 +724,7 @@ static const country_code_t t35_country_codes[255] =
     {"Vanuatu", NULL},
     {"Vatican City State", NULL},
     {"Venezuela", NULL},
-    {"Viet Nam", NULL},
+    {"Viet Nam", vendor_bc},
     {"Wallis and Futuna", NULL},
     {"Western Samoa", NULL},
     {"Yemen (Republic of)", NULL},
index 37c98e1d95ddbdadbfadd3ef2094f4c09a482a1d..748fc7180cae48b0090ead863cd7218d56391935 100644 (file)
@@ -213,6 +213,7 @@ static __inline__ uint16_t pack_16(const uint8_t *s)
 }
 /*- End of function --------------------------------------------------------*/
 
+#if 0
 static __inline__ uint32_t pack_32(const uint8_t *s)
 {
     uint32_t value;
@@ -221,6 +222,7 @@ static __inline__ uint32_t pack_32(const uint8_t *s)
     return value;
 }
 /*- End of function --------------------------------------------------------*/
+#endif
 
 static __inline__ int unpack_16(uint8_t *s, uint16_t value)
 {
index b4d8b2b86b4adbda34c38573b443f69ae0f676b8..a22b8cf50f948a3941b04b51415c611428bd88fa 100644 (file)
@@ -118,6 +118,7 @@ static __inline__ int unpack_16(uint8_t *s, uint16_t value)
 }
 /*- End of function --------------------------------------------------------*/
 
+#if 0
 static __inline__ int unpack_32(uint8_t *s, uint32_t value)
 {
     s[0] = (value >> 24) & 0xFF;
@@ -247,6 +248,7 @@ static int t43_create_header(t43_encode_state_t *s, uint8_t data[], size_t len)
     return pos;
 }
 /*- End of function --------------------------------------------------------*/
+#endif
 
 SPAN_DECLARE(void) t43_encode_set_options(t43_encode_state_t *s,
                                           uint32_t l0,
index b163277e221c9a7527586db688146c6d773942d7..6b2d8c34a9a64786f38dc01d57b9552fa617600c 100644 (file)
@@ -158,40 +158,6 @@ static int free_buffers(t4_t6_decode_state_t *s)
 }
 /*- End of function --------------------------------------------------------*/
 
-#if defined(__i386__)  ||  defined(__x86_64__)  ||  defined(__ppc__)  ||   defined(__powerpc__)
-static __inline__ int run_length(unsigned int bits)
-{
-    return 7 - top_bit(bits);
-}
-/*- End of function --------------------------------------------------------*/
-#else
-static __inline__ int run_length(unsigned int bits)
-{
-    static const uint8_t run_len[256] =
-    {
-        8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x00 - 0x0F */
-        3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x10 - 0x1F */
-        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x20 - 0x2F */
-        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x30 - 0x3F */
-        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40 - 0x4F */
-        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x50 - 0x5F */
-        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60 - 0x6F */
-        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x70 - 0x7F */
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0x8F */
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 - 0x9F */
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 - 0xAF */
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 - 0xBF */
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 - 0xCF */
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 - 0xDF */
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 - 0xEF */
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xF0 - 0xFF */
-    };
-
-    return run_len[bits];
-}
-/*- End of function --------------------------------------------------------*/
-#endif
-
 static __inline__ void add_run_to_row(t4_t6_decode_state_t *s)
 {
     if (s->run_length >= 0)
index c1a0e89c4fc3d6823bf795523bd9fe394b57d804..9ab17783711300c73c2c7e9942fd7f45e9b8b14b 100644 (file)
@@ -366,6 +366,7 @@ static const char *ascii_to_dtmf[128] =
     "*0"        /* DEL >> BACK SPACE */
 };
 
+#if 0
 static const uint8_t txp[] = "1111111111000101011100001101110000010101";
 
 /* XCI is:
@@ -546,6 +547,7 @@ static const int automoding_sequences[][6] =
         V18_MODE_BELL103
     }
 };
+#endif
 
 static uint16_t encode_baudot(v18_state_t *s, uint8_t ch)
 {
index 64d21480134e54018c7ee7bb052ebd7d74952959..27af3a81e7812b23f6467d73b15e848dad74dbb8 100644 (file)
@@ -136,14 +136,6 @@ static const uint8_t phase_steps[4] =
     1, 0, 2, 3
 };
 
-static const uint8_t ones[] =
-{
-    0, 1, 1, 2,
-    1, 2, 2, 3,
-    1, 2, 2, 3,
-    2, 3, 3, 4
-};
-
 SPAN_DECLARE(float) v22bis_rx_carrier_frequency(v22bis_state_t *s)
 {
     return dds_frequencyf(s->rx.carrier_phase_rate);