From 8ffc8574e6a585c9165caa3a72bcf12a0296c9e0 Mon Sep 17 00:00:00 2001 From: mrg Date: Mon, 22 Mar 2010 05:08:54 +0000 Subject: [PATCH] fix some powerpc64 build issues. --- dist/pdisk/file_media.c | 4 ++-- dist/pdisk/layout_dump.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/pdisk/file_media.c b/dist/pdisk/file_media.c index 4317126576d2..542124a37954 100644 --- a/dist/pdisk/file_media.c +++ b/dist/pdisk/file_media.c @@ -270,7 +270,7 @@ read_file_media(MEDIA m, long long offset, unsigned long count, void *address) } else if (offset < 0 || offset % a->m.grain != 0) { /* can't handle offset */ fprintf(stderr,"bad offset\n"); - } else if (offset + count > a->m.size_in_bytes && a->m.size_in_bytes != (long long) 0) { + } else if (offset + (long long) count > a->m.size_in_bytes && a->m.size_in_bytes != (long long) 0) { /* check for offset (and offset+count) too large */ fprintf(stderr,"offset+count too large\n"); } else if (offset + count > (long long) LOFF_MAX) { @@ -318,7 +318,7 @@ write_file_media(MEDIA m, long long offset, unsigned long count, void *address) off = offset; if ((off = llseek(a->fd, off, 0)) >= 0) { if ((t = write(a->fd, address, count)) == (ssize_t)count) { - if (off + count > a->m.size_in_bytes) { + if (off + (long long) count > a->m.size_in_bytes) { a->m.size_in_bytes = off + count; } rtn_value = 1; diff --git a/dist/pdisk/layout_dump.c b/dist/pdisk/layout_dump.c index 210be3b2f5de..23519f754521 100644 --- a/dist/pdisk/layout_dump.c +++ b/dist/pdisk/layout_dump.c @@ -90,7 +90,7 @@ dump_using_layout(void *buffer, layout *desc) byte_length = entry->bit_length / 8; if (entry->bit_offset != 0 || (entry->bit_length % 8) != 0) { - printf("entry %d, can't handle bitfields yet.\n", entry - desc); + printf("entry %d, can't handle bitfields yet.\n", (int)(entry - desc)); continue; } @@ -102,11 +102,11 @@ dump_using_layout(void *buffer, layout *desc) } } else { if (entry->bit_offset < 0 || entry->bit_offset > 8) { - printf("entry %d, bad bit offset (%d).\n", entry - desc, entry->bit_offset); + printf("entry %d, bad bit offset (%d).\n", (int)(entry - desc), entry->bit_offset); continue; } else if (entry->bit_length <= 0 || entry->bit_length > (entry->bit_offset + 1)) { - printf("entry %d, bad bit length (%d,%d).\n", entry - desc, + printf("entry %d, bad bit length (%d,%d).\n", (int)(entry - desc), entry->bit_offset, entry->bit_length); continue; } @@ -141,7 +141,7 @@ dump_using_layout(void *buffer, layout *desc) } break; default: - printf("entry %d, unknown format (%d).\n", entry - desc, entry->format); + printf("entry %d, unknown format (%d).\n", (int)(entry - desc), entry->format); break; } }