Eliminate compiler warnings. GCC 4.x elicits many signedness warnings

when passing unsigned char * when char * is in the prototype and vice
versa.  Clean these up along with a few others.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@491 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Brian S. Dean
2005-08-30 01:30:05 +00:00
parent 935548add3
commit e623fea507
9 changed files with 42 additions and 44 deletions

View File

@@ -46,7 +46,7 @@ static char has_auto_incr_addr;
static int avr910_send(PROGRAMMER * pgm, char * buf, size_t len)
{
return serial_send(pgm->fd, buf, len);
return serial_send(pgm->fd, (unsigned char *)buf, len);
}
@@ -54,7 +54,7 @@ static int avr910_recv(PROGRAMMER * pgm, char * buf, size_t len)
{
int rv;
rv = serial_recv(pgm->fd, buf, len);
rv = serial_recv(pgm->fd, (unsigned char *)buf, len);
if (rv < 0) {
fprintf(stderr,
"%s: avr910_recv(): programmer is not responding\n",
@@ -134,7 +134,7 @@ static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p)
char hw[2];
char buf[10];
char type;
unsigned char c;
char c;
int dev_supported = 0;
AVRPART * part;
@@ -232,7 +232,7 @@ static void avr910_enable(PROGRAMMER * pgm)
static int avr910_cmd(PROGRAMMER * pgm, unsigned char cmd[4],
unsigned char res[4])
{
unsigned char buf[5];
char buf[5];
/* FIXME: Insert version check here */
@@ -291,7 +291,7 @@ static void avr910_display(PROGRAMMER * pgm, char * p)
static void avr910_set_addr(PROGRAMMER * pgm, unsigned long addr)
{
unsigned char cmd[3];
char cmd[3];
cmd[0] = 'A';
cmd[1] = (addr >> 8) & 0xff;
@@ -305,7 +305,7 @@ static void avr910_set_addr(PROGRAMMER * pgm, unsigned long addr)
static int avr910_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
unsigned long addr, unsigned char value)
{
unsigned char cmd[2];
char cmd[2];
if (strcmp(m->desc, "flash") == 0) {
if (addr & 0x01) {
@@ -347,7 +347,7 @@ static int avr910_read_byte_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
cached = 0;
}
else {
unsigned char buf[2];
char buf[2];
avr910_set_addr(pgm, addr >> 1);
@@ -376,7 +376,7 @@ static int avr910_read_byte_eeprom(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
{
avr910_set_addr(pgm, addr);
avr910_send(pgm, "d", 1);
avr910_recv(pgm, value, 1);
avr910_recv(pgm, (char *)value, 1);
return 0;
}
@@ -401,7 +401,7 @@ static int avr910_paged_write_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
int page_size, int n_bytes)
{
unsigned char cmd[] = {'c', 'C'};
unsigned char buf[2];
char buf[2];
unsigned int addr = 0;
unsigned int max_addr = n_bytes;
unsigned int page_addr;
@@ -456,7 +456,7 @@ static int avr910_paged_write_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
static int avr910_paged_write_eeprom(PROGRAMMER * pgm, AVRPART * p,
AVRMEM * m, int page_size, int n_bytes)
{
unsigned char cmd[2];
char cmd[2];
unsigned int addr = 0;
unsigned int max_addr = n_bytes;
@@ -500,11 +500,11 @@ static int avr910_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
static int avr910_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
int page_size, int n_bytes)
{
unsigned char cmd;
char cmd;
int rd_size;
unsigned int addr = 0;
unsigned int max_addr;
unsigned char buf[2];
char buf[2];
if (strcmp(m->desc, "flash") == 0) {
cmd = 'R';
@@ -532,7 +532,7 @@ static int avr910_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
m->buf[addr*2+1] = buf[0]; /* MSB */
}
else {
avr910_recv(pgm, &m->buf[addr], 1);
avr910_recv(pgm, (char *)&m->buf[addr], 1);
}
addr++;
@@ -557,7 +557,7 @@ static int avr910_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m)
}
avr910_send(pgm, "s", 1);
avr910_recv(pgm, m->buf, 3);
avr910_recv(pgm, (char *)m->buf, 3);
return 3;
}