From bd53788ad91e3f8b5070f0e7c85b0cbf5f26e1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Wed, 7 Nov 2007 22:21:33 +0000 Subject: [PATCH] get rid of (most) compiler warnings git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@733 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/src/cmd/debug.c | 3 +-- jtag/src/cmd/eraseflash.c | 2 +- jtag/src/cmd/peekpoke.c | 2 +- jtag/src/cmd/script.c | 10 +++++----- jtag/src/cmd/shell.c | 2 +- jtag/src/cmd/signal.c | 2 +- jtag/src/cmd/test.c | 3 ++- jtag/src/detect.c | 10 +++++----- jtag/src/jtag.c | 2 +- jtag/src/part/signal.c | 2 +- jtag/src/readmem.c | 2 +- jtag/src/svf/svf_bison.y | 4 ++++ jtag/src/svf/svf_flex.l | 2 +- jtag/src/writemem.c | 2 +- 14 files changed, 26 insertions(+), 22 deletions(-) diff --git a/jtag/src/cmd/debug.c b/jtag/src/cmd/debug.c index 3c09d352..ad236005 100644 --- a/jtag/src/cmd/debug.c +++ b/jtag/src/cmd/debug.c @@ -37,8 +37,7 @@ static int cmd_debug_run( char *params[] ) { - int data,i; - signal_t *s; + unsigned int i; if (cmd_params( params ) != 2) return -1; diff --git a/jtag/src/cmd/eraseflash.c b/jtag/src/cmd/eraseflash.c index 4ccf4b45..66a93cf5 100644 --- a/jtag/src/cmd/eraseflash.c +++ b/jtag/src/cmd/eraseflash.c @@ -37,7 +37,7 @@ static int cmd_eraseflash_run( char *params[] ) { uint32_t adr = 0; - int number = 0; + unsigned int number = 0; if (cmd_params( params ) != 3) return -1; diff --git a/jtag/src/cmd/peekpoke.c b/jtag/src/cmd/peekpoke.c index a85fc022..72af28d5 100644 --- a/jtag/src/cmd/peekpoke.c +++ b/jtag/src/cmd/peekpoke.c @@ -35,7 +35,7 @@ static int cmd_peek_run( char *params[] ) { uint32_t adr, val; - int pars, j = 1, bw; + int pars, j = 1; bus_area_t area; /* bus_t * bus = part_get_active_bus(chain); */ diff --git a/jtag/src/cmd/script.c b/jtag/src/cmd/script.c index 1d871cff..c81d8f09 100644 --- a/jtag/src/cmd/script.c +++ b/jtag/src/cmd/script.c @@ -33,9 +33,8 @@ static int cmd_script_run( char *params[] ) { -int i,j; - - int go; + int i, j; + int go = 0; i = 0; j = 1; if (cmd_params( params ) == 3) { sscanf(params[2],"%d",&j); /* loop n times option */ @@ -43,11 +42,12 @@ int i,j; else if (cmd_params( params ) != 2) return -1; - for(i=0;i -//#include +#include #include //#include "part.h" //#include "bssignal.h" diff --git a/jtag/src/cmd/signal.c b/jtag/src/cmd/signal.c index e0e15ccd..c041f0cf 100644 --- a/jtag/src/cmd/signal.c +++ b/jtag/src/cmd/signal.c @@ -59,7 +59,7 @@ cmd_signal_run( char *params[] ) part = chain->parts->parts[chain->active_part]; if ((s = part_find_signal( part, params[1] )) != NULL) { if(i == 3) { - printf("Defining pin for signal %s\m",s->name); + printf("Defining pin for signal %s\n",s->name); if(s->pin)free(s->pin); /* erase old */ diff --git a/jtag/src/cmd/test.c b/jtag/src/cmd/test.c index 35b06d64..cde92e2f 100644 --- a/jtag/src/cmd/test.c +++ b/jtag/src/cmd/test.c @@ -37,7 +37,8 @@ static int cmd_test_run( char *params[] ) { - int data,i; + int data; + unsigned int i; signal_t *s; if (cmd_params( params ) != 4) diff --git a/jtag/src/detect.c b/jtag/src/detect.c index 42f76f1e..e57506e1 100644 --- a/jtag/src/detect.c +++ b/jtag/src/detect.c @@ -160,15 +160,15 @@ find_record( char *filename, tap_register *key, struct id_record *idr ) return r; } -unsigned long bits_to_long(tap_register *t) { -int i; -unsigned long l,b; +uint64_t bits_to_uint64(tap_register *t) +{ + int i; + uint64_t l,b; l = 0; b=1; for(i=0;i < t->len ;i++) { if(t->data[i] & 1)l |= b; b <<= 1; -// printf("%01d",t->data[i]); } return l; } @@ -260,7 +260,7 @@ detect_parts( chain_t *chain, char *db_path ) did = id; } - printf( _("Device Id: %s (0x%08X)\n"), register_get_string( did ), bits_to_long(did) ); + printf( _("Device Id: %s (0x%016lX)\n"), register_get_string( did ), bits_to_uint64(did) ); part = part_alloc( did ); if (part == NULL) { printf( _("Out of memory\n") ); diff --git a/jtag/src/jtag.c b/jtag/src/jtag.c index acd0dd90..82c16b1b 100644 --- a/jtag/src/jtag.c +++ b/jtag/src/jtag.c @@ -230,7 +230,7 @@ jtag_parse_stream( FILE *f ) { int go = 1; char *line = NULL; - int n = 0; + size_t n = 0; while (go && (getline( &line, &n, f ) != -1)) if ((strlen(line) > 0) && (line[0] != '#')) diff --git a/jtag/src/part/signal.c b/jtag/src/part/signal.c index c1285e48..6c134784 100644 --- a/jtag/src/part/signal.c +++ b/jtag/src/part/signal.c @@ -69,7 +69,7 @@ salias_alloc( const char *name, const signal_t *signal ) return NULL; } sa->next = NULL; - sa->signal = signal; + sa->signal = (signal_t *)signal; return sa; } diff --git a/jtag/src/readmem.c b/jtag/src/readmem.c index b121da47..89c4f179 100644 --- a/jtag/src/readmem.c +++ b/jtag/src/readmem.c @@ -44,7 +44,7 @@ void readmem( bus_t *bus, FILE *f, uint32_t addr, uint32_t len ) { uint32_t step; - uint64_t a; + uint32_t a; int bc = 0; #define BSIZE 4096 uint8_t b[BSIZE]; diff --git a/jtag/src/svf/svf_bison.y b/jtag/src/svf/svf_bison.y index b1dec535..77e778b8 100644 --- a/jtag/src/svf/svf_bison.y +++ b/jtag/src/svf/svf_bison.y @@ -33,6 +33,10 @@ #include "svf.h" +/* interface to flex */ +#include "svf_bison.h" +int yylex (YYSTYPE *, YYLTYPE *); + #define YYERROR_VERBOSE struct svf_parser_params { diff --git a/jtag/src/svf/svf_flex.l b/jtag/src/svf/svf_flex.l index 26c7ee48..b15ec1e2 100644 --- a/jtag/src/svf/svf_flex.l +++ b/jtag/src/svf/svf_flex.l @@ -87,7 +87,7 @@ COMMENT (!.*)|("//".*)[^\n] "("{WSPACE}*[\n\rHhLlZzUuDdXx \t\r]+{WSPACE}*")" { - /* There is a overlap of VECTOR_STRING and HEXA_NUM when the string + /* There is an overlap of VECTOR_STRING and HEXA_NUM when the string contains only 'd' or 'D'. To prevent complicated parsing rules, the lexer is instructed to detect VECTOR_STRING only when a PIO command has been scanned previously. diff --git a/jtag/src/writemem.c b/jtag/src/writemem.c index 8cda632a..84149d25 100644 --- a/jtag/src/writemem.c +++ b/jtag/src/writemem.c @@ -37,7 +37,7 @@ void writemem( bus_t *bus, FILE *f, uint32_t addr, uint32_t len ) { uint32_t step; - uint64_t a; + uint32_t a; int bc = 0; int bidx = 0; #define BSIZE 4096