From 6a633ea9f183ca9fe343806fdf62d4dd164b0a7b Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Fri, 25 Jul 2008 21:14:43 +0000 Subject: [PATCH] Fix a bunch of warnings. * avr910.c (avr910_paged_load): possible unitialized use of rd_size * jtagmkI.c (jtagmkI_initialize): pointer signedness mixup * jtagmkII.c (jtagmkII_print_parms1): propagate const'ness of parameter * usbasp.c (usbasp_transmit): poiner signedness mixup git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@775 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 10 ++++++++++ avr910.c | 2 +- jtagmkI.c | 2 +- jtagmkII.c | 4 ++-- usbasp.c | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0c52434..40752c5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-07-25 Joerg Wunsch + + Fix a bunch of warnings. + * avr910.c (avr910_paged_load): possible unitialized use of + rd_size + * jtagmkI.c (jtagmkI_initialize): pointer signedness mixup + * jtagmkII.c (jtagmkII_print_parms1): propagate const'ness + of parameter + * usbasp.c (usbasp_transmit): poiner signedness mixup + 2008-07-25 Joerg Wunsch Contributed by Ville Voipio: diff --git a/avr910.c b/avr910.c index 7be294ac..9314b290 100644 --- a/avr910.c +++ b/avr910.c @@ -666,7 +666,7 @@ static int avr910_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, int page_size, int n_bytes) { char cmd; - int rd_size; + int rd_size = 1; unsigned int addr = 0; unsigned int max_addr; char buf[2]; diff --git a/jtagmkI.c b/jtagmkI.c index 94c84885..2215ee00 100644 --- a/jtagmkI.c +++ b/jtagmkI.c @@ -550,7 +550,7 @@ static unsigned char jtagmkI_get_baud(long baud) static int jtagmkI_initialize(PROGRAMMER * pgm, AVRPART * p) { AVRMEM hfuse; - char cmd[1], resp[5]; + unsigned char cmd[1], resp[5]; unsigned char b; if (!(p->flags & AVRPART_HAS_JTAG)) { diff --git a/jtagmkII.c b/jtagmkII.c index 130b0de0..8a77ab33 100644 --- a/jtagmkII.c +++ b/jtagmkII.c @@ -128,7 +128,7 @@ static int jtagmkII_reset(PROGRAMMER * pgm, unsigned char flags); static int jtagmkII_set_sck_period(PROGRAMMER * pgm, double v); static int jtagmkII_setparm(PROGRAMMER * pgm, unsigned char parm, unsigned char * value); -static void jtagmkII_print_parms1(PROGRAMMER * pgm, char * p); +static void jtagmkII_print_parms1(PROGRAMMER * pgm, const char * p); static void jtagmkII_setup(PROGRAMMER * pgm) { @@ -2166,7 +2166,7 @@ static void jtagmkII_display(PROGRAMMER * pgm, const char * p) } -static void jtagmkII_print_parms1(PROGRAMMER * pgm, char * p) +static void jtagmkII_print_parms1(PROGRAMMER * pgm, const char * p) { unsigned char vtarget[4], jtag_clock[4]; char clkbuf[20]; diff --git a/usbasp.c b/usbasp.c index c4266af5..b01a8762 100644 --- a/usbasp.c +++ b/usbasp.c @@ -82,7 +82,7 @@ static int usbasp_transmit(PROGRAMMER * pgm, functionid, (send[1] << 8) | send[0], (send[3] << 8) | send[2], - buffer, buffersize, + (char *)buffer, buffersize, 5000); if(nbytes < 0){ fprintf(stderr, "%s: error: usbasp_transmit: %s\n", progname, usb_strerror());