[Freeswitch-svn] [commit] r2487 - in freeswitch/trunk/src: include mod/codecs/mod_g726

Freeswitch SVN anthm at freeswitch.org
Sun Sep 3 10:15:02 EDT 2006


Author: anthm
Date: Sun Sep  3 10:15:02 2006
New Revision: 2487

Modified:
   freeswitch/trunk/src/include/switch_bitpack.h
   freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c

Log:
compiler warning cleanup

Modified: freeswitch/trunk/src/include/switch_bitpack.h
==============================================================================
--- freeswitch/trunk/src/include/switch_bitpack.h	(original)
+++ freeswitch/trunk/src/include/switch_bitpack.h	Sun Sep  3 10:15:02 2006
@@ -75,7 +75,7 @@
   \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 @@
 {
 	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 @@
 {
 	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) {

Modified: freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c	Sun Sep  3 10:15:02 2006
@@ -193,7 +193,7 @@
 			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);



More information about the Freeswitch-svn mailing list