bootutil_misc: fix printf types in log macros
Upstream PR #547
The recent changes to these are tripping GCC printf-like macro
attribute warnings on my platform. Just cast all the values to ulong
to make everybody's compilers happy.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
diff --git a/boot/bootutil/src/bootutil_misc.c b/boot/bootutil/src/bootutil_misc.c
index 279190f..711dbe6 100644
--- a/boot/bootutil/src/bootutil_misc.c
+++ b/boot/bootutil/src/bootutil_misc.c
@@ -408,7 +408,8 @@
off = boot_magic_off(fap);
BOOT_LOG_DBG("writing magic; fa_id=%d off=0x%lx (0x%lx)",
- fap->fa_id, off, fap->fa_off + off);
+ fap->fa_id, (unsigned long)off,
+ (unsigned long)(fap->fa_off + off));
rc = flash_area_write(fap, off, boot_img_magic, BOOT_MAGIC_SZ);
if (rc != 0) {
return BOOT_EFLASH;
@@ -465,7 +466,8 @@
off = boot_copy_done_off(fap);
BOOT_LOG_DBG("writing copy_done; fa_id=%d off=0x%lx (0x%lx)",
- fap->fa_id, off, fap->fa_off + off);
+ fap->fa_id, (unsigned long)off,
+ (unsigned long)(fap->fa_off + off));
return boot_write_trailer_flag(fap, off, BOOT_FLAG_SET);
}
@@ -476,7 +478,8 @@
off = boot_image_ok_off(fap);
BOOT_LOG_DBG("writing image_ok; fa_id=%d off=0x%lx (0x%lx)",
- fap->fa_id, off, fap->fa_off + off);
+ fap->fa_id, (unsigned long)off,
+ (unsigned long)(fap->fa_off + off));
return boot_write_trailer_flag(fap, off, BOOT_FLAG_SET);
}
@@ -496,7 +499,8 @@
off = boot_swap_info_off(fap);
BOOT_LOG_DBG("writing swap_info; fa_id=%d off=0x%lx (0x%lx), swap_type=0x%x"
" image_num=0x%x",
- fap->fa_id, off, fap->fa_off + off, swap_type, image_num);
+ fap->fa_id, (unsigned long)off,
+ (unsigned long)(fap->fa_off + off), swap_type, image_num);
return boot_write_trailer(fap, off, (const uint8_t *) &swap_info, 1);
}
@@ -507,7 +511,8 @@
off = boot_swap_size_off(fap);
BOOT_LOG_DBG("writing swap_size; fa_id=%d off=0x%lx (0x%lx)",
- fap->fa_id, off, fap->fa_off + off);
+ fap->fa_id, (unsigned long)off,
+ (unsigned long)fap->fa_off + off);
return boot_write_trailer(fap, off, (const uint8_t *) &swap_size, 4);
}