[Asterisk-cvs] asterisk dns.c,1.15,1.16 enum.c,1.28,1.29

russell russell
Sun Aug 7 02:30:38 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv18780

Modified Files:
	dns.c enum.c 
Log Message:
more fixes for gcc4 warnings


Index: dns.c
===================================================================
RCS file: /usr/cvsroot/asterisk/dns.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- dns.c	6 Jun 2005 22:12:18 -0000	1.15
+++ dns.c	7 Aug 2005 06:34:26 -0000	1.16
@@ -71,7 +71,7 @@
 	unsigned short size;
 } __attribute__ ((__packed__));
 
-static int skip_name(u_char *s, int len)
+static int skip_name(char *s, int len)
 {
 	int x = 0;
 
@@ -96,10 +96,10 @@
 
 /*--- dns_parse_answer: Parse DNS lookup result, call callback */
 static int dns_parse_answer(void *context,
-	int class, int type, u_char *answer, int len,
-	int (*callback)(void *context, u_char *answer, int len, u_char *fullanswer))
+	int class, int type, char *answer, int len,
+	int (*callback)(void *context, char *answer, int len, char *fullanswer))
 {
-	u_char *fullanswer = answer;
+	char *fullanswer = answer;
 	struct dn_answer *ans;
 	dns_HEADER *h;
 	int res;
@@ -169,7 +169,7 @@
 /*--- ast_search_dns: Lookup record in DNS */
 int ast_search_dns(void *context,
 	   const char *dname, int class, int type,
-	   int (*callback)(void *context, u_char *answer, int len, u_char *fullanswer))
+	   int (*callback)(void *context, char *answer, int len, char *fullanswer))
 {
 #ifdef HAS_RES_NINIT
 	struct __res_state dnsstate;
@@ -179,7 +179,7 @@
 
 #ifdef HAS_RES_NINIT
 	res_ninit(&dnsstate);
-	res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
+	res = res_nsearch(&dnsstate, dname, class, type, (unsigned char *)answer, sizeof(answer));
 #else
 	ast_mutex_lock(&res_lock);
 	res_init();

Index: enum.c
===================================================================
RCS file: /usr/cvsroot/asterisk/enum.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- enum.c	10 Jul 2005 22:56:21 -0000	1.28
+++ enum.c	7 Aug 2005 06:34:26 -0000	1.29
@@ -67,7 +67,7 @@
 } __attribute__ ((__packed__));
 
 /*--- parse_ie: Parse NAPTR record information elements */
-static int parse_ie(unsigned char *data, int maxdatalen, unsigned char *src, int srclen)
+static int parse_ie(char *data, int maxdatalen, char *src, int srclen)
 {
 	int len, olen;
 
@@ -85,17 +85,17 @@
 }
 
 /*--- parse_naptr: Parse DNS NAPTR record used in ENUM ---*/
-static int parse_naptr(unsigned char *dst, int dstsize, char *tech, int techsize, unsigned char *answer, int len, char *naptrinput)
+static int parse_naptr(char *dst, int dstsize, char *tech, int techsize, char *answer, int len, char *naptrinput)
 {
-	unsigned char *oanswer = answer;
-	unsigned char flags[80] = "";
-	unsigned char services[80] = "";
-	unsigned char regexp[80] = "";
-	unsigned char repl[80] = "";
-	unsigned char temp[80] = "";
-	unsigned char delim;
-	unsigned char *delim2;
-	unsigned char *pattern, *subst, *d;
+	char *oanswer = answer;
+	char flags[80] = "";
+	char services[80] = "";
+	char regexp[80] = "";
+	char repl[80] = "";
+	char temp[80] = "";
+	char delim;
+	char *delim2;
+	char *pattern, *subst, *d;
 	int res;
 	int regexp_len, size, backref;
 	int d_len = sizeof(temp) - 1;
@@ -132,7 +132,7 @@
 		answer += res; 
 		len -= res; 
 	}
-	if ((res = dn_expand(oanswer,answer + len,answer, repl, sizeof(repl) - 1)) < 0) {
+	if ((res = dn_expand((unsigned char *)oanswer, (unsigned char *)answer + len, (unsigned char *)answer, repl, sizeof(repl) - 1)) < 0) {
 		ast_log(LOG_WARNING, "Failed to expand hostname\n");
 		return -1;
 	} 
@@ -260,7 +260,7 @@
 };
 
 /*--- txt_callback: Callback for TXT record lookup */
-static int txt_callback(void *context, u_char *answer, int len, u_char *fullanswer)
+static int txt_callback(void *context, char *answer, int len, char *fullanswer)
 {
 	struct enum_context *c = (struct enum_context *)context;
 #if 0
@@ -295,7 +295,7 @@
 }
 
 /*--- enum_callback: Callback from ENUM lookup function */
-static int enum_callback(void *context, u_char *answer, int len, u_char *fullanswer)
+static int enum_callback(void *context, char *answer, int len, char *fullanswer)
 {
 	struct enum_context *c = (struct enum_context *)context;
 




More information about the svn-commits mailing list