[Asterisk-cvs] asterisk callerid.c, 1.34, 1.35 loader.c, 1.49, 1.50 manager.c, 1.107, 1.108

russell russell
Fri Aug 5 12:25:31 CDT 2005


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

Modified Files:
	callerid.c loader.c manager.c 
Log Message:
fix a bunch of gcc4 warnings realted to pointer signedness


Index: callerid.c
===================================================================
RCS file: /usr/cvsroot/asterisk/callerid.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- callerid.c	10 Jul 2005 22:56:21 -0000	1.34
+++ callerid.c	5 Aug 2005 16:29:30 -0000	1.35
@@ -543,7 +543,7 @@
 	float cr = 1.0;
 	float ci = 0.0;
 	float scont = 0.0;
-	unsigned char msg[256];
+	char msg[256];
 	len = callerid_genmsg(msg, sizeof(msg), number, name, flags);
 	if (!callwaiting) {
 		/* Wait a half a second */

Index: loader.c
===================================================================
RCS file: /usr/cvsroot/asterisk/loader.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- loader.c	25 Jul 2005 15:32:06 -0000	1.49
+++ loader.c	5 Aug 2005 16:29:30 -0000	1.50
@@ -49,7 +49,7 @@
 static struct module *module_list=NULL;
 static int modlistver = 0;
 
-static char expected_key[] =
+static unsigned char expected_key[] =
 { 0x8e, 0x93, 0x22, 0x83, 0xf5, 0xc3, 0xc0, 0x75,
   0xff, 0x8b, 0xa9, 0xbe, 0x7c, 0x43, 0x74, 0x63 };
 
@@ -85,7 +85,7 @@
 	return 0;
 }
 
-static int key_matches(char *key1, char *key2)
+static int key_matches(unsigned char *key1, unsigned char *key2)
 {
 	int match = 1;
 	int x;
@@ -95,12 +95,12 @@
 	return match;
 }
 
-static int verify_key(char *key)
+static int verify_key(unsigned char *key)
 {
 	struct MD5Context c;
-	char digest[16];
+	unsigned char digest[16];
 	MD5Init(&c);
-	MD5Update(&c, key, strlen(key));
+	MD5Update(&c, key, strlen((char *)key));
 	MD5Final(digest, &c);
 	if (key_matches(expected_key, digest))
 		return 0;
@@ -266,7 +266,7 @@
 #ifdef RTLD_GLOBAL
 	char *val;
 #endif
-	char *key;
+	unsigned char *key;
 	char tmp[80];
 
 	if (strncasecmp(resource_name, "res_", 4)) {
@@ -356,7 +356,7 @@
 	if (m->reload == NULL)
 		m->reload = dlsym(m->lib, "_reload");
 
-	if (!m->key || !(key = m->key())) {
+	if (!m->key || !(key = (unsigned char *) m->key())) {
 		ast_log(LOG_WARNING, "Key routine returned NULL in module %s\n", fn);
 		key = NULL;
 		errors++;

Index: manager.c
===================================================================
RCS file: /usr/cvsroot/asterisk/manager.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- manager.c	5 Aug 2005 15:19:51 -0000	1.107
+++ manager.c	5 Aug 2005 16:29:30 -0000	1.108
@@ -483,8 +483,8 @@
 						struct MD5Context md5;
 						unsigned char digest[16];
 						MD5Init(&md5);
-						MD5Update(&md5, s->challenge, strlen(s->challenge));
-						MD5Update(&md5, password, strlen(password));
+						MD5Update(&md5, (unsigned char *) s->challenge, strlen(s->challenge));
+						MD5Update(&md5, (unsigned char *) password, strlen(password));
 						MD5Final(digest, &md5);
 						for (x=0;x<16;x++)
 							len += sprintf(md5key + len, "%2.2x", digest[x]);




More information about the svn-commits mailing list