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:
parent
e2a78468d0
commit
6c78b35b8f
10
ChangeLog
10
ChangeLog
|
@ -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>
|
||||
|
||||
Submitted by Travis Griggs:
|
||||
|
|
3
avr.c
3
avr.c
|
@ -47,10 +47,9 @@ int avr_tpi_poll_nvmbsy(PROGRAMMER *pgm)
|
|||
{
|
||||
unsigned char cmd;
|
||||
unsigned char res;
|
||||
int rc = 0;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
4
fileio.c
4
fileio.c
|
@ -1033,8 +1033,8 @@ static int elf2b(char * infile, FILE * inf,
|
|||
while ((d = elf_getdata(s, d)) != NULL) {
|
||||
if (verbose >= 2) {
|
||||
fprintf(stderr,
|
||||
" Data block: d_buf 0x%x, d_off 0x%x, d_size %d\n",
|
||||
(unsigned int)d->d_buf, (unsigned int)d->d_off, d->d_size);
|
||||
" Data block: d_buf %p, d_off 0x%x, d_size %d\n",
|
||||
d->d_buf, (unsigned int)d->d_off, d->d_size);
|
||||
}
|
||||
if (mem->size == 1) {
|
||||
if (d->d_off != 0) {
|
||||
|
|
|
@ -2890,7 +2890,6 @@ static int jtagmkII_reset32(PROGRAMMER * pgm, unsigned short flags)
|
|||
int status, j, lineno;
|
||||
unsigned char *resp, buf[3];
|
||||
unsigned long val=0;
|
||||
unsigned long config0, config1;
|
||||
|
||||
if(verbose) fprintf(stderr,
|
||||
"%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);
|
||||
if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;}
|
||||
config0 = val; // 0x0204098b
|
||||
|
||||
status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000);
|
||||
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;}
|
||||
val = jtagmkII_read_SABaddr(pgm, AVR32_DCCPU, 0x01);
|
||||
if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;}
|
||||
config1 = val; // 0x00800000
|
||||
|
||||
status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000);
|
||||
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);
|
||||
if(val == ERROR_SAB) {lineno = __LINE__; goto eRR;}
|
||||
config0 = val; // 0x0204098b
|
||||
|
||||
status = jtagmkII_write_SABaddr(pgm, AVR32_DCEMU, 0x01, 0x00000000);
|
||||
if(status < 0) {lineno = __LINE__; goto eRR;}
|
||||
|
|
|
@ -314,7 +314,6 @@ static void ser_close(union filedescriptor *fd)
|
|||
|
||||
static int ser_send(union filedescriptor *fd, unsigned char * buf, size_t buflen)
|
||||
{
|
||||
struct timeval timeout, to2;
|
||||
int rc;
|
||||
unsigned char * p = buf;
|
||||
size_t len = buflen;
|
||||
|
@ -343,10 +342,6 @@ static int ser_send(union filedescriptor *fd, unsigned char * buf, size_t buflen
|
|||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 500000;
|
||||
to2 = timeout;
|
||||
|
||||
while (len) {
|
||||
rc = write(fd->ifd, p, (len > 1024) ? 1024 : len);
|
||||
if (rc < 0) {
|
||||
|
|
3
stk500.c
3
stk500.c
|
@ -751,15 +751,12 @@ static int stk500_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
|||
int tries;
|
||||
unsigned int n;
|
||||
unsigned int i;
|
||||
int flash;
|
||||
|
||||
if (strcmp(m->desc, "flash") == 0) {
|
||||
memtype = 'F';
|
||||
flash = 1;
|
||||
}
|
||||
else if (strcmp(m->desc, "eeprom") == 0) {
|
||||
memtype = 'E';
|
||||
flash = 0;
|
||||
}
|
||||
else {
|
||||
return -2;
|
||||
|
|
|
@ -2258,7 +2258,7 @@ static int stk500v2_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
|||
unsigned int page_size,
|
||||
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 char commandbuf[10];
|
||||
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);
|
||||
|
||||
if (page_size == 0) page_size = 256;
|
||||
hiaddr = UINT_MAX;
|
||||
addrshift = 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,
|
||||
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 char commandbuf[5], buf[266];
|
||||
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",
|
||||
m->desc, page_size, addr, n_bytes);
|
||||
|
||||
hiaddr = UINT_MAX;
|
||||
addrshift = 0;
|
||||
use_ext_addr = 0;
|
||||
|
||||
|
|
3
term.c
3
term.c
|
@ -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)
|
||||
{
|
||||
int addr;
|
||||
int i, n;
|
||||
int n;
|
||||
unsigned char * p;
|
||||
char dst1[80];
|
||||
char dst2[80];
|
||||
|
||||
addr = startaddr;
|
||||
i = 0;
|
||||
p = (unsigned char *)buf;
|
||||
while (len) {
|
||||
n = 16;
|
||||
|
|
Loading…
Reference in New Issue