Fix all "unused variable" warnings that were encountered.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1200 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2013-09-03 11:05:13 +00:00
parent e2a78468d0
commit 6c78b35b8f
8 changed files with 16 additions and 22 deletions

View File

@ -1,3 +1,13 @@
2013-09-03 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* fileio.c: Fix "unused variable" warnings.
* avr.c: (Dito.)
* stk500v2.c: (Dito.)
* stk500.c: (Dito.)
* jtagmkII.c: (Dito.)
* term.c: (Dito.)
* ser_posix.c: (Dito.)
2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 2013-09-02 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
Submitted by Travis Griggs: Submitted by Travis Griggs:

3
avr.c
View File

@ -47,10 +47,9 @@ int avr_tpi_poll_nvmbsy(PROGRAMMER *pgm)
{ {
unsigned char cmd; unsigned char cmd;
unsigned char res; unsigned char res;
int rc = 0;
cmd = TPI_CMD_SIN | TPI_SIO_ADDR(TPI_IOREG_NVMCSR); cmd = TPI_CMD_SIN | TPI_SIO_ADDR(TPI_IOREG_NVMCSR);
rc = pgm->cmd_tpi(pgm, &cmd, 1, &res, 1); (void)pgm->cmd_tpi(pgm, &cmd, 1, &res, 1);
return (res & TPI_IOREG_NVMCSR_NVMBSY); return (res & TPI_IOREG_NVMCSR_NVMBSY);
} }

View File

@ -1033,8 +1033,8 @@ static int elf2b(char * infile, FILE * inf,
while ((d = elf_getdata(s, d)) != NULL) { while ((d = elf_getdata(s, d)) != NULL) {
if (verbose >= 2) { if (verbose >= 2) {
fprintf(stderr, fprintf(stderr,
" Data block: d_buf 0x%x, d_off 0x%x, d_size %d\n", " Data block: d_buf %p, d_off 0x%x, d_size %d\n",
(unsigned int)d->d_buf, (unsigned int)d->d_off, d->d_size); d->d_buf, (unsigned int)d->d_off, d->d_size);
} }
if (mem->size == 1) { if (mem->size == 1) {
if (d->d_off != 0) { if (d->d_off != 0) {

View File

@ -2890,7 +2890,6 @@ static int jtagmkII_reset32(PROGRAMMER * pgm, unsigned short flags)
int status, j, lineno; int status, j, lineno;
unsigned char *resp, buf[3]; unsigned char *resp, buf[3];
unsigned long val=0; unsigned long val=0;
unsigned long config0, config1;
if(verbose) fprintf(stderr, if(verbose) fprintf(stderr,
"%s: jtagmkII_reset32(%2.2x)\n", "%s: jtagmkII_reset32(%2.2x)\n",
@ -2995,7 +2994,6 @@ static int jtagmkII_reset32(PROGRAMMER * pgm, unsigned short flags)
val = jtagmkII_read_SABaddr(pgm, AVR32_DCCPU, 0x01); val = jtagmkII_read_SABaddr(pgm, AVR32_DCCPU, 0x01);
if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;} if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;}
config0 = val; // 0x0204098b
status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000); status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000);
if(status < 0) {lineno = __LINE__; goto eRR;} if(status < 0) {lineno = __LINE__; goto eRR;}
@ -3025,7 +3023,6 @@ static int jtagmkII_reset32(PROGRAMMER * pgm, unsigned short flags)
if(val != 0x00000001) {lineno = __LINE__; goto eRR;} if(val != 0x00000001) {lineno = __LINE__; goto eRR;}
val = jtagmkII_read_SABaddr(pgm, AVR32_DCCPU, 0x01); val = jtagmkII_read_SABaddr(pgm, AVR32_DCCPU, 0x01);
if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;} if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;}
config1 = val; // 0x00800000
status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000); status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000);
if(status < 0) {lineno = __LINE__; goto eRR;} if(status < 0) {lineno = __LINE__; goto eRR;}
@ -3055,7 +3052,6 @@ static int jtagmkII_reset32(PROGRAMMER * pgm, unsigned short flags)
val = jtagmkII_read_SABaddr(pgm, AVR32_DCCPU, 0x01); val = jtagmkII_read_SABaddr(pgm, AVR32_DCCPU, 0x01);
if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;} if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;}
config0 = val; // 0x0204098b
status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000); status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000);
if(status < 0) {lineno = __LINE__; goto eRR;} if(status < 0) {lineno = __LINE__; goto eRR;}

View File

@ -314,7 +314,6 @@ static void ser_close(union filedescriptor *fd)
static int ser_send(union filedescriptor *fd, unsigned char * buf, size_t buflen) static int ser_send(union filedescriptor *fd, unsigned char * buf, size_t buflen)
{ {
struct timeval timeout, to2;
int rc; int rc;
unsigned char * p = buf; unsigned char * p = buf;
size_t len = buflen; size_t len = buflen;
@ -343,10 +342,6 @@ static int ser_send(union filedescriptor *fd, unsigned char * buf, size_t buflen
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }
timeout.tv_sec = 0;
timeout.tv_usec = 500000;
to2 = timeout;
while (len) { while (len) {
rc = write(fd->ifd, p, (len > 1024) ? 1024 : len); rc = write(fd->ifd, p, (len > 1024) ? 1024 : len);
if (rc < 0) { if (rc < 0) {

View File

@ -751,15 +751,12 @@ static int stk500_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
int tries; int tries;
unsigned int n; unsigned int n;
unsigned int i; unsigned int i;
int flash;
if (strcmp(m->desc, "flash") == 0) { if (strcmp(m->desc, "flash") == 0) {
memtype = 'F'; memtype = 'F';
flash = 1;
} }
else if (strcmp(m->desc, "eeprom") == 0) { else if (strcmp(m->desc, "eeprom") == 0) {
memtype = 'E'; memtype = 'E';
flash = 0;
} }
else { else {
return -2; return -2;

View File

@ -2258,7 +2258,7 @@ static int stk500v2_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
unsigned int page_size, unsigned int page_size,
unsigned int addr, unsigned int n_bytes) unsigned int addr, unsigned int n_bytes)
{ {
unsigned int block_size, last_addr, hiaddr, addrshift, use_ext_addr; unsigned int block_size, last_addr, addrshift, use_ext_addr;
unsigned int maxaddr = addr + n_bytes; unsigned int maxaddr = addr + n_bytes;
unsigned char commandbuf[10]; unsigned char commandbuf[10];
unsigned char buf[266]; unsigned char buf[266];
@ -2270,7 +2270,6 @@ static int stk500v2_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
m->desc, page_size, addr, n_bytes); m->desc, page_size, addr, n_bytes);
if (page_size == 0) page_size = 256; if (page_size == 0) page_size = 256;
hiaddr = UINT_MAX;
addrshift = 0; addrshift = 0;
use_ext_addr = 0; use_ext_addr = 0;
@ -2391,7 +2390,7 @@ static int stk500hv_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
unsigned int addr, unsigned int n_bytes, unsigned int addr, unsigned int n_bytes,
enum hvmode mode) enum hvmode mode)
{ {
unsigned int block_size, last_addr, hiaddr, addrshift, use_ext_addr; unsigned int block_size, last_addr, addrshift, use_ext_addr;
unsigned int maxaddr = addr + n_bytes; unsigned int maxaddr = addr + n_bytes;
unsigned char commandbuf[5], buf[266]; unsigned char commandbuf[5], buf[266];
int result; int result;
@ -2399,7 +2398,6 @@ static int stk500hv_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
DEBUG("STK500V2: stk500hv_paged_write(..,%s,%u,%u)\n", DEBUG("STK500V2: stk500hv_paged_write(..,%s,%u,%u)\n",
m->desc, page_size, addr, n_bytes); m->desc, page_size, addr, n_bytes);
hiaddr = UINT_MAX;
addrshift = 0; addrshift = 0;
use_ext_addr = 0; use_ext_addr = 0;

3
term.c
View File

@ -206,13 +206,12 @@ static int chardump_line(char * buffer, unsigned char * p, int n, int pad)
static int hexdump_buf(FILE * f, int startaddr, unsigned char * buf, int len) static int hexdump_buf(FILE * f, int startaddr, unsigned char * buf, int len)
{ {
int addr; int addr;
int i, n; int n;
unsigned char * p; unsigned char * p;
char dst1[80]; char dst1[80];
char dst2[80]; char dst2[80];
addr = startaddr; addr = startaddr;
i = 0;
p = (unsigned char *)buf; p = (unsigned char *)buf;
while (len) { while (len) {
n = 16; n = 16;