[asterisk-commits] seanbright: branch group/asterisk-cpp r168459 - /team/group/asterisk-cpp/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jan 11 19:01:38 CST 2009


Author: seanbright
Date: Sun Jan 11 19:01:38 2009
New Revision: 168459

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168459
Log:
This gets us closer to rtp.c compiling but we still have to deal with the C99 array initializer stuff.

Modified:
    team/group/asterisk-cpp/main/rtp.c

Modified: team/group/asterisk-cpp/main/rtp.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/rtp.c?view=diff&rev=168459&r1=168458&r2=168459
==============================================================================
--- team/group/asterisk-cpp/main/rtp.c (original)
+++ team/group/asterisk-cpp/main/rtp.c Sun Jan 11 19:01:38 2009
@@ -516,7 +516,7 @@
 	struct stun_attr *attr;
 	struct stun_state st;
 	int ret = STUN_IGNORE;	
-	int x;
+	size_t x;
 
 	/* On entry, 'len' is the length of the udp payload. After the
 	 * initial checks it becomes the size of unprocessed options,
@@ -1115,7 +1115,7 @@
 
 static int rtpread(int *id, int fd, short events, void *cbdata)
 {
-	struct ast_rtp *rtp = cbdata;
+	struct ast_rtp *rtp = (struct ast_rtp *) cbdata;
 	struct ast_frame *f;
 	f = ast_rtp_read(rtp);
 	if (f) {
@@ -1128,7 +1128,7 @@
 struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp)
 {
 	socklen_t len;
-	int position, i, packetwords;
+	unsigned int position, i, packetwords;
 	int res;
 	struct sockaddr_in sock_in;
 	unsigned int rtcpdata[8192 + AST_FRIENDLY_OFFSET];
@@ -1756,9 +1756,9 @@
 	rtp->f.seqno = seqno;
 
 	if (rtp->f.subclass == AST_FORMAT_T140 && (int)seqno - (prev_seqno+1) > 0 && (int)seqno - (prev_seqno+1) < 10) {
-		  unsigned char *data = rtp->f.data.ptr;
+          unsigned char *data = (unsigned char *) rtp->f.data.ptr;
 		  
-		  memmove(rtp->f.data.ptr+3, rtp->f.data.ptr, rtp->f.datalen);
+		  memmove(((unsigned char *) rtp->f.data.ptr) + 3, rtp->f.data.ptr, rtp->f.datalen);
 		  rtp->f.datalen +=3;
 		  *data++ = 0xEF;
 		  *data++ = 0xBF;
@@ -1766,7 +1766,7 @@
 	}
  
 	if (rtp->f.subclass == AST_FORMAT_T140RED) {
-		unsigned char *data = rtp->f.data.ptr;
+		unsigned char *data = (unsigned char *) rtp->f.data.ptr;
 		unsigned char *header_end;
 		int num_generations;
 		int header_length;
@@ -1775,7 +1775,7 @@
 		int x;
 
 		rtp->f.subclass = AST_FORMAT_T140;
-		header_end = memchr(data, ((*data) & 0x7f), rtp->f.datalen);
+		header_end = (unsigned char *) memchr(data, ((*data) & 0x7f), rtp->f.datalen);
 		header_end++;
 		
 		header_length = header_end - data;
@@ -1789,22 +1789,23 @@
 			if (!(rtp->f.datalen - length))
 				return &ast_null_frame;
 			
-			rtp->f.data.ptr += length;
+			rtp->f.data.ptr = ((unsigned char *) rtp->f.data.ptr) + length;
 			rtp->f.datalen -= length;
 		} else if (diff > num_generations && diff < 10) {
 			length -= 3;
-			rtp->f.data.ptr += length;
+
+            rtp->f.data.ptr = ((unsigned char *) rtp->f.data.ptr) + length;
 			rtp->f.datalen -= length;
 			
-			data = rtp->f.data.ptr;
+			data = (unsigned char *) rtp->f.data.ptr;
 			*data++ = 0xEF;
 			*data++ = 0xBF;
 			*data = 0xBD;
 		} else 	{
 			for ( x = 0; x < num_generations - diff; x++) 
 				length += data[x * 4 + 3];
-			
-			rtp->f.data.ptr += length;
+
+            rtp->f.data.ptr = ((unsigned char *) rtp->f.data.ptr) + length;
 			rtp->f.datalen -= length;
 		}
 	}
@@ -1850,8 +1851,8 @@
    of our codecs, or RTP-specific data type. */
 static struct {
 	struct rtpPayloadType payloadType;
-	char* type;
-	char* subtype;
+	const char* type;
+	const char* subtype;
 } mimeTypes[] = {
 	{{1, AST_FORMAT_G723_1}, "audio", "G723"},
 	{{1, AST_FORMAT_GSM}, "audio", "GSM"},




More information about the asterisk-commits mailing list