This just fixes a lot of compiler warnings.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
SVN-Revision: 47181
*((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
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
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);
}
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;
}
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;
}
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;
}
#include <unistd.h>
#include <sys/stat.h>
#include <netinet/in.h>
+#include <inttypes.h>
#include "bcm_tag.h"
#include "imagetag_cmdline.h"
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 */
}
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) {
// 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
#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)
/* 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);
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");
#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)
/* 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;
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");
#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)
#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)
#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)
#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)
#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)
#if defined(__CYGWIN__)
# include <byteswap.h>
#endif
+#include <inttypes.h>
#include "zynos.h"
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;
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;
#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)
#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)
{
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 */
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);