Author: hauke Date: 2015-10-11 21:00:41 +0200 (Sun, 11 Oct 2015) New Revision: 47181
Modified: trunk/tools/firmware-utils/src/airlink.c trunk/tools/firmware-utils/src/asustrx.c trunk/tools/firmware-utils/src/imagetag.c trunk/tools/firmware-utils/src/mkbrnimg.c trunk/tools/firmware-utils/src/mkcasfw.c trunk/tools/firmware-utils/src/mkcsysimg.c trunk/tools/firmware-utils/src/mkdniimg.c trunk/tools/firmware-utils/src/mkplanexfw.c trunk/tools/firmware-utils/src/mktplinkfw.c trunk/tools/firmware-utils/src/mktplinkfw2.c trunk/tools/firmware-utils/src/mkzcfw.c trunk/tools/firmware-utils/src/mkzynfw.c trunk/tools/firmware-utils/src/osbridge-crc.c trunk/tools/firmware-utils/src/pc1crypt.c trunk/tools/firmware-utils/src/seama.c Log: tools: firmware-utils: fix compiler warnings This just fixes a lot of compiler warnings. Signed-off-by: Hauke Mehrtens <[email protected]> Modified: trunk/tools/firmware-utils/src/airlink.c =================================================================== --- trunk/tools/firmware-utils/src/airlink.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/airlink.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -293,7 +293,7 @@ *((uint32_t *) & b[0x18]) = 0x0L; sum = crc32(b, 0x400); - printf("CRC32 sum0 - (%x, %x, %x)\n", sum, sum0, 0x400); + printf("CRC32 sum0 - (%x, %lx, %x)\n", sum, sum0, 0x400); if (EHDR) lseek(fd, 0x20, SEEK_SET); else @@ -305,7 +305,7 @@ write(fd, &buf[0x18], 0x4); sum = crc32(buf, l0); - printf("CRC32 sum1 - (%x, %x, %x)\n", sum, sum1, l0); + printf("CRC32 sum1 - (%x, %lx, %x)\n", sum, sum1, l0); if (EHDR) lseek(fd, 0xC, SEEK_SET); else @@ -319,7 +319,7 @@ unsigned long sum2 = buf[-0x8] | ((uint32_t)buf[-0x7] << 8) | ((uint32_t)buf[-0x6] << 16) | ((uint32_t)buf[-0x5] << 24); *((uint32_t *) & buf[-0x8]) = 0L; sum = crc32(buf - 0x4, len - 0x4); - printf("CRC32 sum2 - (%x, %x, %x)\n", sum, sum2, + printf("CRC32 sum2 - (%x, %lx, %lx)\n", sum, sum2, len - 0x4); lseek(fd, 0, SEEK_SET); *((uint32_t *) & buf[-0x8]) = htonl(sum); Modified: trunk/tools/firmware-utils/src/asustrx.c =================================================================== --- trunk/tools/firmware-utils/src/asustrx.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/asustrx.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -197,7 +197,7 @@ } for (i = 0; i < bytes; i++) { if (buf[i]) { - fprintf(stderr, "Input TRX doesn't have last 64 B empty %s\n"); + fprintf(stderr, "Input TRX doesn't have last 64 B empty %s\n", out_path); err = -ENOSPC; goto err; } @@ -217,7 +217,7 @@ bytes = sizeof(tail); fseek(out, -bytes, SEEK_CUR); if (fwrite(&tail, 1, bytes, out) != bytes) { - fprintf(stderr, "Couldn't write %zu B to %s\n", bytes); + fprintf(stderr, "Couldn't write %zu B to %s\n", bytes, out_path); err = -EIO; goto err; } @@ -242,7 +242,7 @@ hdr.crc32 = cpu_to_le32(crc32); rewind(out); if (fwrite(&hdr, 1, bytes, out) != bytes) { - fprintf(stderr, "Couldn't write %zu B to %s\n", bytes); + fprintf(stderr, "Couldn't write %zu B to %s\n", bytes, out_path); err = -EIO; goto err; } Modified: trunk/tools/firmware-utils/src/imagetag.c =================================================================== --- trunk/tools/firmware-utils/src/imagetag.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/imagetag.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -15,6 +15,7 @@ #include <unistd.h> #include <sys/stat.h> #include <netinet/in.h> +#include <inttypes.h> #include "bcm_tag.h" #include "imagetag_cmdline.h" @@ -304,7 +305,7 @@ sprintf(tag.totalLength, "%lu", imagelen); if (args->cfe_given) { - sprintf(tag.cfeAddress, "%lu", flash_start); + sprintf(tag.cfeAddress, "%" PRIu32, flash_start); sprintf(tag.cfeLength, "%lu", cfelen); } else { /* We don't include CFE */ @@ -345,7 +346,7 @@ } if (args->altinfo_given) { - strncpy(&tag.information1[0], args->altinfo_arg, ALTTAGINFO_LEN); + strncpy(tag.information1, args->altinfo_arg, TAGINFO1_LEN); } if (args->second_image_flag_given) { Modified: trunk/tools/firmware-utils/src/mkbrnimg.c =================================================================== --- trunk/tools/firmware-utils/src/mkbrnimg.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/mkbrnimg.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -142,7 +142,7 @@ // write padding padded_len = ((len + sizeof(footer) + sizeof(padding) - 1) & ~(sizeof(padding) - 1)) - sizeof(footer); - fprintf(stderr, "len=%08x padded_len=%08x\n", len, padded_len); + fprintf(stderr, "len=%08zx padded_len=%08zx\n", len, padded_len); write(outfd, padding, padded_len - len); // write footer Modified: trunk/tools/firmware-utils/src/mkcasfw.c =================================================================== --- trunk/tools/firmware-utils/src/mkcasfw.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/mkcasfw.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -258,7 +258,7 @@ #define ERRS(fmt, ...) do { \ int save = errno; \ fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ progname, ## __VA_ARGS__, strerror(save)); \ } while (0) @@ -708,7 +708,7 @@ /* write padding data if neccesary */ padlen = desc->out_size - desc->file_size; - DBG(1,"padding desc, length=%d", padlen); + DBG(1,"padding desc, length=%zu", padlen); res = write_out_padding(outfile, padlen, desc->padc, &css); desc->csum = csum_get(&css); @@ -985,11 +985,11 @@ res = ERR_FATAL; if (keep_invalid_images == 0) { - WARN("generation of invalid images disabled", ofname); + WARN("generation of invalid images \"%s\" disabled", ofname); goto out; } - WARN("generating invalid image", ofname); + WARN("generating invalid image: \"%s\"", ofname); } outfile = fopen(ofname, "w"); Modified: trunk/tools/firmware-utils/src/mkcsysimg.c =================================================================== --- trunk/tools/firmware-utils/src/mkcsysimg.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/mkcsysimg.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -199,7 +199,7 @@ #define ERRS(fmt, ...) do { \ int save = errno; \ fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", progname, ## __VA_ARGS__ \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", progname, ## __VA_ARGS__ \ , strerror(save)); \ } while (0) @@ -647,7 +647,7 @@ /* write padding data if neccesary */ padlen = block->size_avail - block->file_size; - DBG(1,"padding block, length=%d", padlen); + DBG(1,"padding block, length=%zu", padlen); res = write_out_padding(outfile, padlen, block->padc, block->css); return res; @@ -1122,11 +1122,11 @@ res = ERR_FATAL; if (keep_invalid_images == 0) { - WARN("generation of invalid images disabled", ofname); + WARN("generation of invalid images \"%s\" disabled", ofname); goto out; } - WARN("generating invalid image", ofname); + WARN("generating invalid image: \"%s\"", ofname); } outfile = fopen(ofname, "w"); Modified: trunk/tools/firmware-utils/src/mkdniimg.c =================================================================== --- trunk/tools/firmware-utils/src/mkdniimg.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/mkdniimg.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -43,7 +43,7 @@ #define ERRS(fmt, ...) do { \ int save = errno; \ fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ progname, ## __VA_ARGS__, strerror(save)); \ } while (0) Modified: trunk/tools/firmware-utils/src/mkplanexfw.c =================================================================== --- trunk/tools/firmware-utils/src/mkplanexfw.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/mkplanexfw.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -82,7 +82,7 @@ #define ERRS(fmt, ...) do { \ int save = errno; \ fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ progname, ## __VA_ARGS__, strerror(save)); \ } while (0) Modified: trunk/tools/firmware-utils/src/mktplinkfw.c =================================================================== --- trunk/tools/firmware-utils/src/mktplinkfw.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/mktplinkfw.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -450,7 +450,7 @@ #define ERRS(fmt, ...) do { \ int save = errno; \ fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ progname, ## __VA_ARGS__, strerror(save)); \ } while (0) Modified: trunk/tools/firmware-utils/src/mktplinkfw2.c =================================================================== --- trunk/tools/firmware-utils/src/mktplinkfw2.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/mktplinkfw2.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -189,7 +189,7 @@ #define ERRS(fmt, ...) do { \ int save = errno; \ fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ progname, ## __VA_ARGS__, strerror(save)); \ } while (0) Modified: trunk/tools/firmware-utils/src/mkzcfw.c =================================================================== --- trunk/tools/firmware-utils/src/mkzcfw.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/mkzcfw.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -100,7 +100,7 @@ #define ERRS(fmt, ...) do { \ int save = errno; \ fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ progname, ## __VA_ARGS__, strerror(save)); \ } while (0) Modified: trunk/tools/firmware-utils/src/mkzynfw.c =================================================================== --- trunk/tools/firmware-utils/src/mkzynfw.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/mkzynfw.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -27,6 +27,7 @@ #if defined(__CYGWIN__) # include <byteswap.h> #endif +#include <inttypes.h> #include "zynos.h" @@ -687,7 +688,7 @@ FILE *f; int res; - DBG(2, "writing out file, name=%s, len=%d", + DBG(2, "writing out file, name=%s, len=%zu", name, len); errno = 0; @@ -988,7 +989,7 @@ uint32_t avail; int i, res; - DBG(1,"calculating block offsets, starting with %lu", + DBG(1,"calculating block offsets, starting with %" PRIu32, *offset); res = 0; Modified: trunk/tools/firmware-utils/src/osbridge-crc.c =================================================================== --- trunk/tools/firmware-utils/src/osbridge-crc.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/osbridge-crc.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -51,7 +51,7 @@ #define ERRS(fmt, ...) do { \ int save = errno; \ fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ progname, ## __VA_ARGS__, strerror(save)); \ } while (0) Modified: trunk/tools/firmware-utils/src/pc1crypt.c =================================================================== --- trunk/tools/firmware-utils/src/pc1crypt.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/pc1crypt.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -208,7 +208,7 @@ #define ERRS(fmt, ...) do { \ int save = errno; \ fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ progname, ## __VA_ARGS__, strerror(save)); \ } while (0) Modified: trunk/tools/firmware-utils/src/seama.c =================================================================== --- trunk/tools/firmware-utils/src/seama.c 2015-10-11 16:24:43 UTC (rev 47180) +++ trunk/tools/firmware-utils/src/seama.c 2015-10-11 19:00:41 UTC (rev 47181) @@ -235,10 +235,10 @@ { printf("SEAMA ==========================================\n"); printf(" magic : %08x\n", ntohl(shdr.magic)); - printf(" meta size : %d bytes\n", msize); + printf(" meta size : %zu bytes\n", msize); for (i=0; i<msize; i+=(strlen((const char *)&buf[i])+1)) printf(" meta data : %s\n", &buf[i]); - printf(" image size : %d bytes\n", isize); + printf(" image size : %zu bytes\n", isize); } /* verify checksum */ @@ -473,7 +473,7 @@ fread(buf, sizeof(char), msize, ifh); if (match_meta((const char *)buf, msize)) { - printf("SEAMA: found image @ '%s', image size: %d\n", o_images[i], isize); + printf("SEAMA: found image @ '%s', image size: %zu\n", o_images[i], isize); /* open output file */ ofh = fopen(output, "w"); if (!ofh) printf("SEAMA: unable to open '%s' for writting.\n",output); _______________________________________________ openwrt-commits mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits
