diff --git a/src/build/libbe/app/Message.cpp b/src/build/libbe/app/Message.cpp index c5de753763..9b0c603c1e 100644 --- a/src/build/libbe/app/Message.cpp +++ b/src/build/libbe/app/Message.cpp @@ -504,7 +504,7 @@ BMessage::_PrintToStream(const char* indent) const if (isprint(*(char *)&value)) printf("'%.4s'", (char *)&value); else - printf("0x%lx", what); + printf("0x%" B_PRIx32, what); printf(") {\n"); if (fHeader == NULL || fFields == NULL || fData == NULL) @@ -523,7 +523,7 @@ BMessage::_PrintToStream(const char* indent) const printf("%s %s = ", indent, (char *)(fData + field->offset)); } else { - printf("%s %s[%ld] = ", indent, + printf("%s %s[%" B_PRIu32 "] = ", indent, (char *)(fData + field->offset), j); } @@ -541,7 +541,7 @@ BMessage::_PrintToStream(const char* indent) const size = *(uint32 *)pointer; pointer += sizeof(uint32); printf("string(\"%s\", %ld bytes)\n", (char *)pointer, - size); + (long)size); break; } @@ -598,8 +598,9 @@ BMessage::_PrintToStream(const char* indent) const entry_ref ref; BPrivate::entry_ref_unflatten(&ref, (char *)pointer, size); - printf("entry_ref(device=%ld, directory=%lld, " - "name=\"%s\", ", ref.device, ref.directory, ref.name); + printf("entry_ref(device=%d, directory=%" B_PRIdINO + ", name=\"%s\", ", (int)ref.device, ref.directory, + ref.name); BPath path(&ref); printf("path=\"%s\")\n", path.Path()); @@ -628,7 +629,7 @@ BMessage::_PrintToStream(const char* indent) const default: { printf("(type = '%.4s')(size = %ld)\n", (char *)&value, - size); + (long)size); break; } } diff --git a/src/build/libbe/app/MessageAdapter.cpp b/src/build/libbe/app/MessageAdapter.cpp index ce69e4ab6d..c3dbc84bbe 100644 --- a/src/build/libbe/app/MessageAdapter.cpp +++ b/src/build/libbe/app/MessageAdapter.cpp @@ -344,7 +344,7 @@ MessageAdapter::_FlattenR5Message(uint32 format, const BMessage *from, r5header->flags = flags; // store the header size - used for the checksum later - ssize_t headerSize = (uint32)pointer - (uint32)buffer; + ssize_t headerSize = (addr_t)pointer - (addr_t)buffer; // collect and add the data BMessage::field_header *field = messagePrivate.GetMessageFields(); @@ -422,7 +422,7 @@ MessageAdapter::_FlattenR5Message(uint32 format, const BMessage *from, pointer++; // calculate the flattened size from the pointers - r5header->flattened_size = (uint32)pointer - (uint32)buffer; + r5header->flattened_size = (addr_t)pointer - (addr_t)buffer; r5header->checksum = CalculateChecksum((uint8 *)(buffer + 8), headerSize - 8); diff --git a/src/build/libbe/app/MessageUtils.cpp b/src/build/libbe/app/MessageUtils.cpp index 771dc4210b..3a3509e6df 100644 --- a/src/build/libbe/app/MessageUtils.cpp +++ b/src/build/libbe/app/MessageUtils.cpp @@ -80,7 +80,7 @@ entry_ref_unflatten(entry_ref *ref, const char *buffer, size_t size) memcpy((void *)&ref->directory, (const void *)buffer, sizeof(ref->directory)); buffer += sizeof(ref->directory); - if (ref->device != -1 && size > sizeof(ref->device) + if (ref->device != ~(dev_t)0 && size > sizeof(ref->device) + sizeof(ref->directory)) { ref->set_name(buffer); if (ref->name == NULL) { diff --git a/src/kits/app/Message.cpp b/src/kits/app/Message.cpp index afafd239f5..9de665437f 100644 --- a/src/kits/app/Message.cpp +++ b/src/kits/app/Message.cpp @@ -552,7 +552,7 @@ BMessage::_PrintToStream(const char* indent) const if (isprint(*(char *)&value)) printf("'%.4s'", (char *)&value); else - printf("0x%lx", what); + printf("0x%" B_PRIx32, what); printf(") {\n"); if (fHeader == NULL || fFields == NULL || fData == NULL) @@ -571,7 +571,7 @@ BMessage::_PrintToStream(const char* indent) const printf("%s %s = ", indent, (char *)(fData + field->offset)); } else { - printf("%s %s[%ld] = ", indent, + printf("%s %s[%" B_PRIu32 "] = ", indent, (char *)(fData + field->offset), j); } @@ -589,7 +589,7 @@ BMessage::_PrintToStream(const char* indent) const size = *(uint32 *)pointer; pointer += sizeof(uint32); printf("string(\"%s\", %ld bytes)\n", (char *)pointer, - size); + (long)size); break; } @@ -646,8 +646,9 @@ BMessage::_PrintToStream(const char* indent) const entry_ref ref; BPrivate::entry_ref_unflatten(&ref, (char *)pointer, size); - printf("entry_ref(device=%ld, directory=%lld, " - "name=\"%s\", ", ref.device, ref.directory, ref.name); + printf("entry_ref(device=%d, directory=%" B_PRIdINO + ", name=\"%s\", ", (int)ref.device, ref.directory, + ref.name); BPath path(&ref); printf("path=\"%s\")\n", path.Path()); @@ -676,7 +677,7 @@ BMessage::_PrintToStream(const char* indent) const default: { printf("(type = '%.4s')(size = %ld)\n", (char *)&value, - size); + (long)size); break; } } diff --git a/src/kits/app/MessageAdapter.cpp b/src/kits/app/MessageAdapter.cpp index 46beaa80e2..8b63314bbe 100644 --- a/src/kits/app/MessageAdapter.cpp +++ b/src/kits/app/MessageAdapter.cpp @@ -411,7 +411,7 @@ MessageAdapter::_FlattenR5Message(uint32 format, const BMessage *from, r5header->flags = flags; // store the header size - used for the checksum later - ssize_t headerSize = (uint32)pointer - (uint32)buffer; + ssize_t headerSize = (addr_t)pointer - (addr_t)buffer; // collect and add the data BMessage::field_header *field = messagePrivate.GetMessageFields(); @@ -489,7 +489,7 @@ MessageAdapter::_FlattenR5Message(uint32 format, const BMessage *from, pointer++; // calculate the flattened size from the pointers - r5header->flattened_size = (uint32)pointer - (uint32)buffer; + r5header->flattened_size = (addr_t)pointer - (addr_t)buffer; r5header->checksum = CalculateChecksum((uint8 *)(buffer + 8), headerSize - 8); diff --git a/src/kits/app/MessageUtils.cpp b/src/kits/app/MessageUtils.cpp index 771dc4210b..3a3509e6df 100644 --- a/src/kits/app/MessageUtils.cpp +++ b/src/kits/app/MessageUtils.cpp @@ -80,7 +80,7 @@ entry_ref_unflatten(entry_ref *ref, const char *buffer, size_t size) memcpy((void *)&ref->directory, (const void *)buffer, sizeof(ref->directory)); buffer += sizeof(ref->directory); - if (ref->device != -1 && size > sizeof(ref->device) + if (ref->device != ~(dev_t)0 && size > sizeof(ref->device) + sizeof(ref->directory)) { ref->set_name(buffer); if (ref->name == NULL) {