fix a bunch of gcc4 warnings realted to pointer signedness

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2005-08-05 16:29:30 +00:00
parent c2b31d45df
commit 52594b6b12
5 changed files with 15 additions and 15 deletions

View File

@@ -543,7 +543,7 @@ int callerid_generate(unsigned char *buf, char *number, char *name, int flags, i
float cr = 1.0; float cr = 1.0;
float ci = 0.0; float ci = 0.0;
float scont = 0.0; float scont = 0.0;
unsigned char msg[256]; char msg[256];
len = callerid_genmsg(msg, sizeof(msg), number, name, flags); len = callerid_genmsg(msg, sizeof(msg), number, name, flags);
if (!callwaiting) { if (!callwaiting) {
/* Wait a half a second */ /* Wait a half a second */

View File

@@ -316,7 +316,7 @@ static struct ast_frame *i4l_handle_escape(struct ast_modem_pvt *p, char esc)
static struct ast_frame *i4l_read(struct ast_modem_pvt *p) static struct ast_frame *i4l_read(struct ast_modem_pvt *p)
{ {
unsigned char result[256]; char result[256];
short *b; short *b;
struct ast_frame *f=NULL; struct ast_frame *f=NULL;
int res; int res;
@@ -426,7 +426,7 @@ static struct ast_frame *i4l_read(struct ast_modem_pvt *p)
if (!f) if (!f)
return NULL; return NULL;
} else { } else {
*(b++) = AST_MULAW(result[x]); *(b++) = AST_MULAW((int)result[x]);
p->obuflen += 2; p->obuflen += 2;
} }
} }

View File

@@ -49,7 +49,7 @@ AST_MUTEX_DEFINE_STATIC(reloadlock);
static struct module *module_list=NULL; static struct module *module_list=NULL;
static int modlistver = 0; static int modlistver = 0;
static char expected_key[] = static unsigned char expected_key[] =
{ 0x8e, 0x93, 0x22, 0x83, 0xf5, 0xc3, 0xc0, 0x75, { 0x8e, 0x93, 0x22, 0x83, 0xf5, 0xc3, 0xc0, 0x75,
0xff, 0x8b, 0xa9, 0xbe, 0x7c, 0x43, 0x74, 0x63 }; 0xff, 0x8b, 0xa9, 0xbe, 0x7c, 0x43, 0x74, 0x63 };
@@ -85,7 +85,7 @@ static int printdigest(unsigned char *d)
return 0; return 0;
} }
static int key_matches(char *key1, char *key2) static int key_matches(unsigned char *key1, unsigned char *key2)
{ {
int match = 1; int match = 1;
int x; int x;
@@ -95,12 +95,12 @@ static int key_matches(char *key1, char *key2)
return match; return match;
} }
static int verify_key(char *key) static int verify_key(unsigned char *key)
{ {
struct MD5Context c; struct MD5Context c;
char digest[16]; unsigned char digest[16];
MD5Init(&c); MD5Init(&c);
MD5Update(&c, key, strlen(key)); MD5Update(&c, key, strlen((char *)key));
MD5Final(digest, &c); MD5Final(digest, &c);
if (key_matches(expected_key, digest)) if (key_matches(expected_key, digest))
return 0; return 0;
@@ -266,7 +266,7 @@ static int __load_resource(const char *resource_name, const struct ast_config *c
#ifdef RTLD_GLOBAL #ifdef RTLD_GLOBAL
char *val; char *val;
#endif #endif
char *key; unsigned char *key;
char tmp[80]; char tmp[80];
if (strncasecmp(resource_name, "res_", 4)) { if (strncasecmp(resource_name, "res_", 4)) {
@@ -356,7 +356,7 @@ static int __load_resource(const char *resource_name, const struct ast_config *c
if (m->reload == NULL) if (m->reload == NULL)
m->reload = dlsym(m->lib, "_reload"); 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); ast_log(LOG_WARNING, "Key routine returned NULL in module %s\n", fn);
key = NULL; key = NULL;
errors++; errors++;

View File

@@ -483,8 +483,8 @@ static int authenticate(struct mansession *s, struct message *m)
struct MD5Context md5; struct MD5Context md5;
unsigned char digest[16]; unsigned char digest[16];
MD5Init(&md5); MD5Init(&md5);
MD5Update(&md5, s->challenge, strlen(s->challenge)); MD5Update(&md5, (unsigned char *) s->challenge, strlen(s->challenge));
MD5Update(&md5, password, strlen(password)); MD5Update(&md5, (unsigned char *) password, strlen(password));
MD5Final(digest, &md5); MD5Final(digest, &md5);
for (x=0;x<16;x++) for (x=0;x<16;x++)
len += sprintf(md5key + len, "%2.2x", digest[x]); len += sprintf(md5key + len, "%2.2x", digest[x]);

View File

@@ -138,7 +138,7 @@ static struct ast_key *try_load_key (char *dir, char *fname, int ifd, int ofd, i
int ktype = 0; int ktype = 0;
char *c = NULL; char *c = NULL;
char ffname[256]; char ffname[256];
char digest[16]; unsigned char digest[16];
FILE *f; FILE *f;
struct MD5Context md5; struct MD5Context md5;
struct ast_key *key; struct ast_key *key;
@@ -180,7 +180,7 @@ static struct ast_key *try_load_key (char *dir, char *fname, int ifd, int ofd, i
memset(buf, 0, 256); memset(buf, 0, 256);
fgets(buf, sizeof(buf), f); fgets(buf, sizeof(buf), f);
if (!feof(f)) { if (!feof(f)) {
MD5Update(&md5, buf, strlen(buf)); MD5Update(&md5, (unsigned char *) buf, strlen(buf));
} }
} }
MD5Final(digest, &md5); MD5Final(digest, &md5);
@@ -306,7 +306,7 @@ static char *binary(int y, int len)
int ast_sign_bin(struct ast_key *key, char *msg, int msglen, unsigned char *dsig) int ast_sign_bin(struct ast_key *key, char *msg, int msglen, unsigned char *dsig)
{ {
unsigned char digest[20]; unsigned char digest[20];
int siglen = 128; unsigned int siglen = 128;
int res; int res;
if (key->ktype != AST_KEY_PRIVATE) { if (key->ktype != AST_KEY_PRIVATE) {