From 1792c7acbc8ccaf9f97aa1f3c1b02bcdc8fffd51 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Tue, 10 Feb 2009 10:27:37 +0000 Subject: =?UTF-8?q?2009-02-10=09Ralf=20Cors=C3=A9pius=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bin2boot.c: Use stdint/inttypes to workaround build warnings on 64bit hosts. --- c/src/lib/libbsp/i386/pc386/tools/ChangeLog | 5 +++++ c/src/lib/libbsp/i386/pc386/tools/bin2boot.c | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'c/src/lib/libbsp/i386/pc386/tools') diff --git a/c/src/lib/libbsp/i386/pc386/tools/ChangeLog b/c/src/lib/libbsp/i386/pc386/tools/ChangeLog index 88e44a848e..92d9af6514 100644 --- a/c/src/lib/libbsp/i386/pc386/tools/ChangeLog +++ b/c/src/lib/libbsp/i386/pc386/tools/ChangeLog @@ -1,3 +1,8 @@ +2009-02-10 Ralf Corsépius + + * bin2boot.c: Use stdint/inttypes to workaround build warnings on + 64bit hosts. + 2008-08-19 Joel Sherrill * bin2boot.c: Fix uninitialized variable warning. diff --git a/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c b/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c index 6c443b5881..eb9263ec6b 100644 --- a/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c +++ b/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c @@ -5,6 +5,8 @@ #include #include +#include +#include #include #include @@ -37,7 +39,7 @@ int main(int argc, char* argv[]) int c, verbose; extern int optind; FILE *ofp, *ifp; - unsigned long headerAddr, addr1, addr2; + uintptr_t headerAddr, addr1, addr2; int size1, size2, len1, len2, len, imageCnt, cnt; char *ofile, *ifile, *end; @@ -183,7 +185,7 @@ int main(int argc, char* argv[]) { /* Areas overlapped */ printf("area overlapping: \n"); - printf("header address 0x%08lx, its memory size 0x%08x\n", + printf("header address 0x%08lx, its memory size 0x%08zx\n", headerAddr, sizeof(buf)); printf("first image address 0x%08lx, its memory size 0x%08x\n", addr1, size1); @@ -292,11 +294,11 @@ int main(int argc, char* argv[]) { /* Areas overlapped */ printf("area overlapping: \n"); - printf("header address 0x%08lx, its memory size 0x%08x\n", + printf("header address 0x%08" PRIxPTR ", its memory size 0x%08zx\n", headerAddr, sizeof(buf)); - printf("first image address 0x%08lx, its memory size 0x%08x\n", + printf("first image address 0x%08" PRIxPTR ", its memory size 0x%08x\n", addr1, size1); - printf("second image address 0x%08lx, its memory size 0x%08x\n", + printf("second image address 0x%08" PRIxPTR ", its memory size 0x%08x\n", addr2, size2); fclose(ofp); @@ -390,11 +392,11 @@ writeHeader: if(verbose) { - printf("header address 0x%08lx, its memory size 0x%08x\n", + printf("header address 0x%08" PRIxPTR ", its memory size 0x%08zx\n", headerAddr, sizeof(buf)); - printf("first image address 0x%08lx, its memory size 0x%08x\n", + printf("first image address 0x%08" PRIxPTR ", its memory size 0x%08x\n", addr1, size1); - printf("second image address 0x%08lx, its memory size 0x%08x\n", + printf("second image address 0x%08" PRIxPTR ", its memory size 0x%08x\n", addr2, size2); } -- cgit v1.2.3