]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
compiler warning cleanup
authorAnthony Minessale <anthony.minessale@gmail.com>
Sun, 3 Sep 2006 14:15:02 +0000 (14:15 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sun, 3 Sep 2006 14:15:02 +0000 (14:15 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2487 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_bitpack.h
src/mod/codecs/mod_g726/mod_g726.c

index 76a8b901474320831c95d4f428863ef2b92435a8..a518b4eb39ee5442681619c9b66dd785f409eac6 100644 (file)
@@ -75,7 +75,7 @@ static const int8_t SWITCH_REVERSE_BITPACKED_MASKS[] = {255, 254, 252, 248, 240,
   \param mode RFC3551 or AAL2 mode (curse you backwards folks) 
 */
 DoxyDefine(void switch_bitpack_init(switch_bitpack_t *pack, int32_t bitlen, switch_byte_t *buf, uint32_t buflen, switch_bitpack_mode_t mode))
-static inline void switch_bitpack_init(switch_bitpack_t *pack, int32_t bitlen, switch_byte_t *buf, uint32_t buflen, switch_bitpack_mode_t mode)
+static inline void switch_bitpack_init(switch_bitpack_t *pack, switch_byte_t bitlen, switch_byte_t *buf, uint32_t buflen, switch_bitpack_mode_t mode)
 {
        memset(pack, 0, sizeof(*pack));
        memset(buf, 0, buflen);
@@ -147,7 +147,7 @@ static inline int8_t switch_bitpack_out(switch_bitpack_t *unpack, switch_byte_t
 {
        switch_byte_t this_byte;
 
-       if (unpack->cur - unpack->buf > unpack->buflen) {
+       if ((uint32_t)(unpack->cur - unpack->buf) > unpack->buflen) {
                return -1;
        }
 
@@ -218,14 +218,14 @@ static inline int8_t switch_bitpack_in(switch_bitpack_t *pack, switch_byte_t in)
 {
        int next = pack->bits_cur + pack->frame_bits;
 
-       if (pack->cur - pack->buf > pack->buflen) {
+       if ((uint32_t)(pack->cur - pack->buf) > pack->buflen) {
                return -1;
        } 
 
        pack->bits_tot += pack->frame_bits;
 
        if (next > SWITCH_BITS_PER_BYTE) {
-               int a = 0, b = 0, rem, nxt;
+               switch_byte_t a = 0, b = 0, rem, nxt;
                rem = SWITCH_BITS_PER_BYTE - pack->bits_cur;
                nxt = pack->frame_bits - rem ;
                if (pack->mode == SWITCH_BITPACK_MODE_RFC3551) {
index 7e7749e4795235465ac5aa8fe448425cde75d85f..0ef166d591b20744ab56813f44d3df5d3425e7f7 100644 (file)
@@ -193,7 +193,7 @@ static switch_status_t switch_g726_decode(switch_codec_t *codec,
                        switch_bitpack_out(&handle->unpack, in[z++]);
                }
                for(y = 0; y < handle->bytes; y++) {
-                       *ddp++ = handle->decoder(handle->buf[y], AUDIO_ENCODING_LINEAR, context);
+                       *ddp++ = (int16_t) handle->decoder(handle->buf[y], AUDIO_ENCODING_LINEAR, context);
             new_len += 2;
                }
                switch_bitpack_done(&handle->unpack);