fix some powerpc64 build issues.
This commit is contained in:
parent
a394b5afe8
commit
8ffc8574e6
4
dist/pdisk/file_media.c
vendored
4
dist/pdisk/file_media.c
vendored
@ -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;
|
||||
|
8
dist/pdisk/layout_dump.c
vendored
8
dist/pdisk/layout_dump.c
vendored
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user