From 07a87aa599a8fc32e938d9987bd2b59eebcfcb76 Mon Sep 17 00:00:00 2001 From: Kevin Cernekee Date: Mon, 26 Jul 2010 11:37:19 -0700 Subject: mtd-utils: clean up compile warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc 4.4.3 on x86_64: libcrc32.c:42: warning: ‘static’ is not at beginning of declaration libfec.c:120: warning: initialization discards qualifiers from pointer target type libfec.c:121: warning: initialization discards qualifiers from pointer target type libfec.c:417: warning: passing argument 2 of ‘my_malloc’ discards qualifiers from pointer target type recv_image.c:164: warning: comparison of unsigned expression < 0 is always false recv_image.c:170: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’ recv_image.c:170: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’ And many more along the same lines. Signed-off-by: Kevin Cernekee Signed-off-by: Artem Bityutskiy --- recv_image.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'recv_image.c') diff --git a/recv_image.c b/recv_image.c index 2be511a..35059b3 100644 --- a/recv_image.c +++ b/recv_image.c @@ -39,24 +39,24 @@ int main(int argc, char **argv) struct addrinfo *runp; int ret; int sock; - size_t len; + ssize_t len; int flfd; struct mtd_info_user meminfo; unsigned char *eb_buf, *decode_buf, **src_pkts; int nr_blocks = 0; int pkts_per_block; int block_nr = -1; - uint32_t image_crc; + uint32_t image_crc = 0; int total_pkts = 0; int ignored_pkts = 0; loff_t mtdoffset = 0; int badcrcs = 0; int duplicates = 0; int file_mode = 0; - struct fec_parms *fec; + struct fec_parms *fec = NULL; int i; struct eraseblock *eraseblocks = NULL; - uint32_t start_seq; + uint32_t start_seq = 0; struct timeval start, now; unsigned long fec_time = 0, flash_time = 0, crc_time = 0, rflash_time = 0, erase_time = 0, net_time = 0; @@ -166,7 +166,7 @@ int main(int argc, char **argv) break; } if (len < sizeof(thispkt)) { - fprintf(stderr, "Wrong length %d bytes (expected %d)\n", + fprintf(stderr, "Wrong length %zd bytes (expected %lu)\n", len, sizeof(thispkt)); continue; } -- cgit v1.2.3