[asterisk-commits] russell: branch group/asterisk-cpp r168397 - /team/group/asterisk-cpp/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 10 18:04:18 CST 2009


Author: russell
Date: Sat Jan 10 18:04:18 2009
New Revision: 168397

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168397
Log:
make enum.c compile

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

Modified: team/group/asterisk-cpp/main/enum.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/enum.c?view=diff&rev=168397&r1=168396&r2=168397
==============================================================================
--- team/group/asterisk-cpp/main/enum.c (original)
+++ team/group/asterisk-cpp/main/enum.c Sat Jan 10 18:04:18 2009
@@ -140,8 +140,8 @@
 /*! \brief Callback for TXT record lookup, /ol version */
 static int txt_callback(void *context, unsigned char *answer, int len, unsigned char *fullanswer)
 {
-	struct txt_context *c = context;
-	unsigned int i;
+	struct txt_context *c = (struct txt_context *) context;
+	int i;
 
 	c->txt[0] = 0;	/* default to empty */
 	c->txtlen = 0;
@@ -166,7 +166,7 @@
 		return 0;
 	}
 
-	if (i >= sizeof(c->txt)) {	/* too long? */
+	if (i >= (int) sizeof(c->txt)) {	/* too long? */
 		ast_log(LOG_WARNING, "txt_callback: TXT record too long.\n");
 		i = sizeof(c->txt) - 1;
 	}
@@ -245,8 +245,8 @@
 /*! \brief Callback for EBL record lookup */
 static int ebl_callback(void *context, unsigned char *answer, int len, unsigned char *fullanswer)
 {
-	struct ebl_context *c = context;
-	unsigned int i;
+	struct ebl_context *c = (struct ebl_context *) context;
+	int i;
 
 	c->pos = 0;	/* default to empty */
 	c->separator[0] = 0;
@@ -408,7 +408,7 @@
 	tech_return[0] = '\0';
 	dst[0] = '\0';
 
-	if (len < sizeof(struct naptr)) {
+	if (len < (int) sizeof(struct naptr)) {
 		ast_log(LOG_WARNING, "NAPTR record length too short\n");
 		return -1;
 	}
@@ -555,7 +555,7 @@
 		if (!strncasecmp(tech, "ALL", techsize)){
 			return 0; /* return or count any RR */
 		}
-		if (!strncasecmp(tech_return, tech, sizeof(tech_return) < techsize ? sizeof(tech_return): techsize)){
+		if (!strncasecmp(tech_return, tech, (int) sizeof(tech_return) < techsize ? sizeof(tech_return): techsize)){
 			ast_copy_string(tech, tech_return, techsize);
 			return 0; /* we got our RR */
 		} else { /* go to the next RR in the DNS answer */
@@ -581,7 +581,7 @@
 /*! \brief Callback from ENUM lookup function */
 static int enum_callback(void *context, unsigned char *answer, int len, unsigned char *fullanswer)
 {
-	struct enum_context *c = context;
+	struct enum_context *c = (struct enum_context *) context;
 	void *p = NULL;
 	int res;
 
@@ -596,7 +596,7 @@
 			snprintf(c->dst, c->dstlen, "%d", c->count);
 		} else  {
 			if ((p = ast_realloc(c->naptr_rrs, sizeof(*c->naptr_rrs) * (c->naptr_rrs_count + 1)))) {
-				c->naptr_rrs = p;
+				c->naptr_rrs = (enum_naptr_rr *) p;
 				memcpy(&c->naptr_rrs[c->naptr_rrs_count].naptr, answer, sizeof(c->naptr_rrs->naptr));
 				c->naptr_rrs[c->naptr_rrs_count].result = ast_strdup(c->dst);
 				c->naptr_rrs[c->naptr_rrs_count].tech = ast_strdup(c->tech);
@@ -655,7 +655,7 @@
 		number++;
 	}
 
-	if (!(context = ast_calloc(1, sizeof(*context))))
+	if (!(context = (struct enum_context *) ast_calloc(1, sizeof(*context))))
 		return -1;
 
 	if((p3 = strchr(naptrinput, '*'))) {
@@ -775,7 +775,7 @@
 			break;
 		}
 
-		if (sdl > strlen(number)) {	/* Number too short for this sdl? */
+		if (sdl > (int) strlen(number)) {	/* Number too short for this sdl? */
 			ast_log(LOG_WARNING, "I-ENUM: subdomain location %d behind number %s\n", sdl, number);
 			return 0;
 		}




More information about the asterisk-commits mailing list