/* System error messages */
#define sys_errmsg(fmt, ...) ({ \
- int _err = errno, _i; \
+ int _err = errno; \
+ size_t _i; \
fprintf(stderr, PROGRAM_NAME ": error!: " fmt "\n", ##__VA_ARGS__); \
for (_i = 0; _i < sizeof(PROGRAM_NAME) + 1; _i++) \
fprintf(stderr, " "); \
}
} else {
- if (be32_to_cpu(hdr.vid_hdr_offset) != si->vid_hdr_offs) {
+ if ((int)be32_to_cpu(hdr.vid_hdr_offset) != si->vid_hdr_offs) {
if (pr)
printf("\n");
if (v)
si->ec[eb] = EB_CORRUPTED;
continue;
}
- if (be32_to_cpu(hdr.data_offset) != si->data_offs) {
+ if ((int)be32_to_cpu(hdr.data_offset) != si->data_offs) {
if (pr)
printf("\n");
if (v)
int ubi_get_vol_info1_nm(libubi_t desc, int dev_num, const char *name,
struct ubi_vol_info *info)
{
- int i, err, nlen = strlen(name);
+ int i, err;
+ unsigned int nlen = strlen(name);
struct ubi_dev_info dev_info;
if (nlen == 0) {
return len;
}
-static int open_file(const struct mtd_info *mtd, struct ubi_scan_info *si,
- off_t *sz)
+static int open_file(off_t *sz)
{
int fd;
return 0;
}
-static int flash_image(const struct mtd_info *mtd, const struct ubigen_info *ui,
- struct ubi_scan_info *si)
+static int flash_image(const struct mtd_info *mtd, struct ubi_scan_info *si)
{
int fd, img_ebs, eb, written_ebs = 0, divisor;
off_t st_size;
- fd = open_file(mtd, si, &st_size);
+ fd = open_file(&st_size);
if (fd < 0)
return fd;
errmsg("VID header offset has to be multiple of min. I/O unit size");
goto out_close;
}
- if (args.vid_hdr_offs + UBI_VID_HDR_SIZE > mtd.eb_size) {
+ if (args.vid_hdr_offs + (int)UBI_VID_HDR_SIZE > mtd.eb_size) {
errmsg("bad VID header offset");
goto out_close;
}
}
if (args.image) {
- err = flash_image(&mtd, &ui, si);
+ err = flash_image(&mtd, si);
if (err < 0)
goto out_free;
return errmsg("output file was not specified (use -h for help)");
if (args.vid_hdr_offs) {
- if (args.vid_hdr_offs + UBI_VID_HDR_SIZE >= args.peb_size)
+ if (args.vid_hdr_offs + (int)UBI_VID_HDR_SIZE >= args.peb_size)
return errmsg("bad VID header position");
if (args.vid_hdr_offs % 8)
return errmsg("VID header offset has to be multiple of min. I/O unit size");