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

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

index a518b4eb39ee5442681619c9b66dd785f409eac6..006dc2fa158e2a8f6ff7b96dc7123208228d6f75 100644 (file)
@@ -253,7 +253,7 @@ static inline int8_t switch_bitpack_in(switch_bitpack_t *pack, switch_byte_t in)
                if (pack->mode == SWITCH_BITPACK_MODE_RFC3551) {
                        in <<= pack->shiftby;
                        *pack->cur |= in;
-                       pack->shiftby += pack->frame_bits;
+                       pack->shiftby = (switch_byte_t)(pack->shiftby + pack->frame_bits);
                } else {
                        *pack->cur <<= pack->frame_bits;
                        *pack->cur |= in;
index 0ef166d591b20744ab56813f44d3df5d3425e7f7..45acafd013676c9fafd807ff081b37a920c72003 100644 (file)
@@ -41,7 +41,7 @@ typedef int (*decoder_t)(int, int, g726_state *);
 
 typedef struct {
        g726_state context;
-       uint8_t bits_per_frame;
+       switch_byte_t bits_per_frame;
        encoder_t encoder;
        decoder_t decoder;
        switch_bitpack_t pack;
@@ -55,7 +55,7 @@ typedef struct {
 static switch_status_t switch_g726_init(switch_codec_t *codec, switch_codec_flag_t flags,
                                                                          const switch_codec_settings_t *codec_settings) 
 {
-       switch_byte_t encoding, decoding;
+       uint32_t encoding, decoding;
        g726_handle_t *handle;
 
        encoding = (flags & SWITCH_CODEC_FLAG_ENCODE);
@@ -95,7 +95,7 @@ static switch_status_t switch_g726_init(switch_codec_t *codec, switch_codec_flag
 
                g726_init_state(&handle->context);
                codec->private_info = handle;
-               handle->bits_per_frame = codec->implementation->bits_per_second / (codec->implementation->samples_per_second);
+               handle->bits_per_frame = (switch_byte_t) codec->implementation->bits_per_second / (codec->implementation->samples_per_second);
                handle->mode = (flags & SWITCH_CODEC_FLAG_AAL2 || strstr(codec->implementation->iananame, "AAL2")) 
                        ? SWITCH_BITPACK_MODE_AAL2 : SWITCH_BITPACK_MODE_RFC3551;
                return SWITCH_STATUS_SUCCESS;
@@ -137,7 +137,7 @@ static switch_status_t switch_g726_encode(switch_codec_t *codec,
        if (decoded_data_len % len == 0) {
                uint32_t new_len = 0;
                int16_t *ddp = decoded_data;
-               uint8_t *edp = encoded_data;
+               switch_byte_t *edp = encoded_data;
                uint32_t x, loops = decoded_data_len / (sizeof(*ddp));
 
                switch_bitpack_init(&handle->pack, handle->bits_per_frame, edp, *encoded_data_len, handle->mode);