Make the code compile warning-free:

- declare a dummy "struct timezone" for some Win32 systems (MinGW)
- fix a few printf() argument types
- get rid off the prevailing "all filedescriptors are of type int"
  attitude

The last item required a large sweep across the code, in order to
replace all "int fd"s by "struct filedescriptor *fd"s, and pass
pointers (as we cannot pass a union directly).  In return, the
code is now supposed to be fully 64-bit safe, rather than relying
on a 64-bit pointer being converted to a (32-bit) int and back
to a pointer as we did previously.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@694 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch
2006-12-11 12:47:35 +00:00
parent 84b633e41d
commit 7e20e7571f
19 changed files with 253 additions and 214 deletions

View File

@@ -57,7 +57,7 @@ static int stk500_is_page_empty(unsigned int address, int page_size,
static int stk500_send(PROGRAMMER * pgm, unsigned char * buf, size_t len)
{
return serial_send(pgm->fd, buf, len);
return serial_send(&pgm->fd, buf, len);
}
@@ -65,7 +65,7 @@ static int stk500_recv(PROGRAMMER * pgm, unsigned char * buf, size_t len)
{
int rv;
rv = serial_recv(pgm->fd, buf, len);
rv = serial_recv(&pgm->fd, buf, len);
if (rv < 0) {
fprintf(stderr,
"%s: stk500_recv(): programmer is not responding\n",
@@ -78,7 +78,7 @@ static int stk500_recv(PROGRAMMER * pgm, unsigned char * buf, size_t len)
static int stk500_drain(PROGRAMMER * pgm, int display)
{
return serial_drain(pgm->fd, display);
return serial_drain(&pgm->fd, display);
}
@@ -585,10 +585,7 @@ static void stk500_enable(PROGRAMMER * pgm)
static int stk500_open(PROGRAMMER * pgm, char * port)
{
strcpy(pgm->port, port);
if (pgm->baudrate)
pgm->fd = serial_open(port, pgm->baudrate);
else
pgm->fd = serial_open(port, 115200);
serial_open(port, pgm->baudrate? pgm->baudrate: 115200, &pgm->fd);
/*
* drain any extraneous input
@@ -604,8 +601,8 @@ static int stk500_open(PROGRAMMER * pgm, char * port)
static void stk500_close(PROGRAMMER * pgm)
{
serial_close(pgm->fd);
pgm->fd = -1;
serial_close(&pgm->fd);
pgm->fd.ifd = -1;
}