diff mbox

[U-Boot,2/5] lzmadec: Use the same type as the lzma call

Message ID 1469200969-4643-2-git-send-email-sjg@chromium.org
State Accepted
Commit 1bb718cdabc0f581e2b3ca1134883ee57d3a910d
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass July 22, 2016, 3:22 p.m. UTC
With sandbox on 32-bit the size_t type can be a little inconsistent. Use
the same type as the caller expects to avoid a compiler warning.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 cmd/lzmadec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Tom Rini July 22, 2016, 10:04 p.m. UTC | #1
On Fri, Jul 22, 2016 at 09:22:46AM -0600, Simon Glass wrote:

> With sandbox on 32-bit the size_t type can be a little inconsistent. Use
> the same type as the caller expects to avoid a compiler warning.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini July 26, 2016, 2:32 a.m. UTC | #2
On Fri, Jul 22, 2016 at 09:22:46AM -0600, Simon Glass wrote:

> With sandbox on 32-bit the size_t type can be a little inconsistent. Use
> the same type as the caller expects to avoid a compiler warning.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/cmd/lzmadec.c b/cmd/lzmadec.c
index 1ad9ed6..c78df82 100644
--- a/cmd/lzmadec.c
+++ b/cmd/lzmadec.c
@@ -20,7 +20,7 @@ 
 static int do_lzmadec(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
 	unsigned long src, dst;
-	unsigned long src_len = ~0UL, dst_len = ~0UL;
+	SizeT src_len = ~0UL, dst_len = ~0UL;
 	int ret;
 
 	switch (argc) {
@@ -40,7 +40,8 @@  static int do_lzmadec(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 
 	if (ret != SZ_OK)
 		return 1;
-	printf("Uncompressed size: %ld = 0x%lX\n", src_len, src_len);
+	printf("Uncompressed size: %ld = %#lX\n", (ulong)src_len,
+	       (ulong)src_len);
 	setenv_hex("filesize", src_len);
 
 	return 0;