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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 10 17:21:15 CST 2009


Author: seanbright
Date: Sat Jan 10 17:21:15 2009
New Revision: 168389

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168389
Log:
Get callerid.c building

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

Modified: team/group/asterisk-cpp/main/callerid.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/callerid.c?view=diff&rev=168389&r1=168388&r2=168389
==============================================================================
--- team/group/asterisk-cpp/main/callerid.c (original)
+++ team/group/asterisk-cpp/main/callerid.c Sat Jan 10 17:21:15 2009
@@ -51,7 +51,7 @@
 	char number[64];
 	int flags;
 	int sawflag;
-	int len;
+	size_t len;
 
 	int skipflag; 
 	unsigned short crc;
@@ -127,7 +127,7 @@
 {
 	struct callerid_state *cid;
 
-	if ((cid = ast_calloc(1, sizeof(*cid)))) {
+	if ((cid = (struct callerid_state *) ast_calloc(1, sizeof(*cid)))) {
 #ifdef INTEGER_CALLERID
 		cid->fskd.ispb = 7;          	/* 1200 baud */	
 		/* Set up for 1200 / 8000 freq *32 to allow ints */
@@ -197,7 +197,7 @@
 
 void callerid_get_dtmf(char *cidstring, char *number, int *flags)
 {
-	int i;
+    size_t i;
 	int code;
 
 	/* "Clear" the number-buffer. */
@@ -310,7 +310,7 @@
 	int x;
 	short *buf;
 
-	buf = alloca(2 * len + cid->oldlen);
+	buf = (short *) alloca(2 * len + cid->oldlen);
 
 	memcpy(buf, cid->oldstuff, cid->oldlen);
 	mylen += cid->oldlen / 2;
@@ -548,7 +548,7 @@
 	int x;
 	short *buf;
 
-	buf = alloca(2 * len + cid->oldlen);
+	buf = (short *) alloca(2 * len + cid->oldlen);
 
 	memcpy(buf, cid->oldstuff, cid->oldlen);
 	mylen += cid->oldlen/2;
@@ -1127,9 +1127,7 @@
 */
 int ast_parse_caller_presentation(const char *data)
 {
-	int i;
-
-	for (i = 0; i < ARRAY_LEN(pres_types); i++) {
+	for (size_t i = 0; i < ARRAY_LEN(pres_types); i++) {
 		if (!strcasecmp(pres_types[i].name, data))
 			return pres_types[i].val;
 	}
@@ -1143,9 +1141,7 @@
 */
 const char *ast_describe_caller_presentation(int data)
 {
-	int i;
-
-	for (i = 0; i < ARRAY_LEN(pres_types); i++) {
+	for (size_t i = 0; i < ARRAY_LEN(pres_types); i++) {
 		if (pres_types[i].val == data)
 			return pres_types[i].description;
 	}
@@ -1159,9 +1155,7 @@
 */
 const char *ast_named_caller_presentation(int data)
 {
-	int i;
-
-	for (i = 0; i < ARRAY_LEN(pres_types); i++) {
+	for (size_t i = 0; i < ARRAY_LEN(pres_types); i++) {
 		if (pres_types[i].val == data)
 			return pres_types[i].name;
 	}




More information about the asterisk-commits mailing list