mirror of https://github.com/hak5/openwrt-owl.git
tools: firmware-utils: fix compiler warnings
This just fixes a lot of compiler warnings. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 47181owl
parent
f457ae99f2
commit
3d1a65adb4
|
@ -293,7 +293,7 @@ int main(int argc, char **argv)
|
|||
*((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 @@ int main(int argc, char **argv)
|
|||
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 @@ int main(int argc, char **argv)
|
|||
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);
|
||||
|
|
|
@ -197,7 +197,7 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
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 @@ int main(int argc, char **argv) {
|
|||
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 @@ int main(int argc, char **argv) {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -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 @@ int tagfile(const char *kernel, const char *rootfs, const char *bin, \
|
|||
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 @@ int tagfile(const char *kernel, const char *rootfs, const char *bin, \
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
|
@ -142,7 +142,7 @@ static void appendfile(int outfd, char *path, int kernel) {
|
|||
|
||||
// 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
|
||||
|
|
|
@ -258,7 +258,7 @@ static struct board_info boards[] = {
|
|||
#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 @@ image_writeout(FILE *outfile, struct image_desc *desc)
|
|||
|
||||
/* 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 @@ main(int argc, char *argv[])
|
|||
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");
|
||||
|
|
|
@ -199,7 +199,7 @@ static struct board_info boards[] = {
|
|||
#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 @@ block_writeout_data(FILE *outfile, struct csys_block *block)
|
|||
|
||||
/* 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 @@ main(int argc, char *argv[])
|
|||
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");
|
||||
|
|
|
@ -43,7 +43,7 @@ static char *board_id;
|
|||
#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)
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ static struct board_info boards[] = {
|
|||
#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)
|
||||
|
||||
|
|
|
@ -450,7 +450,7 @@ static struct board_info boards[] = {
|
|||
#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)
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ static struct board_info boards[] = {
|
|||
#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)
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ static struct board_info boards[] = {
|
|||
#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)
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#if defined(__CYGWIN__)
|
||||
# include <byteswap.h>
|
||||
#endif
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "zynos.h"
|
||||
|
||||
|
@ -687,7 +688,7 @@ write_out_file(FILE *outfile, char *name, size_t len, struct csum_state *css)
|
|||
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 @@ calc_block_offsets(int type, uint32_t *offset)
|
|||
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;
|
||||
|
|
|
@ -51,7 +51,7 @@ static char *ofname;
|
|||
#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)
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ static int decrypt;
|
|||
#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)
|
||||
|
||||
|
|
|
@ -235,10 +235,10 @@ static int verify_seama(const char * fname, int msg)
|
|||
{
|
||||
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 @@ static void extract_file(const char * output)
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue