X-Git-Url: https://git.saurik.com/apple/boot.git/blobdiff_plain/47b0a8bde7689760b67e872ba41bf4187ed315e5..4f6e3300a83b013a40730e9d4939713f82466b78:/i386/util/machOconv.c diff --git a/i386/util/machOconv.c b/i386/util/machOconv.c index 78aac62..66e8bd4 100644 --- a/i386/util/machOconv.c +++ b/i386/util/machOconv.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include int infile, outfile; @@ -42,7 +42,7 @@ static unsigned long swap( ) { if (swap_ends) - return NXSwapLong(x); + return OSSwapInt32(x); else return x; } @@ -80,7 +80,7 @@ usage: perror("read mach header"); exit(1); } - if (nc < sizeof (mh)) { + if (nc < (int)sizeof (mh)) { fprintf(stderr, "read mach header: premature EOF %d\n", nc); exit(1); } @@ -89,7 +89,7 @@ usage: else if (mh.magic == MH_CIGAM) swap_ends = TRUE; else { - fprintf(stderr, "bad magic number %lx\n", mh.magic); + fprintf(stderr, "bad magic number %lx\n", (unsigned long)mh.magic); exit(1); } @@ -103,7 +103,7 @@ usage: perror("read load commands"); exit(1); } - if (nc < swap(mh.sizeofcmds)) { + if (nc < (int)swap(mh.sizeofcmds)) { fprintf(stderr, "read load commands: premature EOF %d\n", nc); exit(1); } @@ -135,13 +135,13 @@ usage: perror("read segment data"); exit(1); } - if (nc < swap(scp->filesize)) { + if (nc < (int)swap(scp->filesize)) { fprintf(stderr, "read segment data: premature EOF %d\n", nc); exit(1); } nc = write(outfile, (void *)data, vmsize); - if (nc < vmsize) { + if (nc < (int)vmsize) { perror("write segment data"); exit(1); }