DFU: img util: Fixed warnings when compiling with newlib

Fixed format error when compiling with gcc and newlib.
Used standard formats (%u) instead of inttypes formats (PRIxxx)
since Zephyr redefines the standard formats, that way it should always
be in line with the Zephyr types.

Compiled with and without newlib using gcc.

Signed-off-by: Dennis Wildmark <dennis.wildmark@assaabloy.com>
This commit is contained in:
Dennis Wildmark 2019-05-06 10:25:22 +02:00 committed by Anas Nashif
commit af98cd7b9c

View file

@ -38,13 +38,13 @@ static bool flash_verify(const struct flash_area *fa, off_t offset,
size = (len >= sizeof(temp)) ? sizeof(temp) : len; size = (len >= sizeof(temp)) ? sizeof(temp) : len;
rc = flash_area_read(fa, offset, &temp, size); rc = flash_area_read(fa, offset, &temp, size);
if (rc) { if (rc) {
LOG_ERR("flash_read error %d offset=0x%08"PRIx32, LOG_ERR("flash_read error %d offset=0x%08x",
rc, (u32_t)offset); rc, (u32_t)offset);
break; break;
} }
if (memcmp(data, &temp, size)) { if (memcmp(data, &temp, size)) {
LOG_ERR("offset=0x%08"PRIx32" VERIFY FAIL. " LOG_ERR("offset=0x%08x VERIFY FAIL. "
"expected: 0x%08x, actual: 0x%08x", "expected: 0x%08x, actual: 0x%08x",
(u32_t)offset, temp, UNALIGNED_GET(data)); (u32_t)offset, temp, UNALIGNED_GET(data));
break; break;
@ -131,7 +131,7 @@ static int flash_sync(struct flash_img_context *ctx)
rc = flash_area_write(ctx->flash_area, ctx->bytes_written, ctx->buf, rc = flash_area_write(ctx->flash_area, ctx->bytes_written, ctx->buf,
CONFIG_IMG_BLOCK_BUF_SIZE); CONFIG_IMG_BLOCK_BUF_SIZE);
if (rc) { if (rc) {
LOG_ERR("flash_write error %d offset=0x%08" PRIx32, rc, LOG_ERR("flash_write error %d offset=0x%08x", rc,
(u32_t)ctx->bytes_written); (u32_t)ctx->bytes_written);
return rc; return rc;
} }