Fixed gcc 4 32 and 64 bit warnings in the libbe_build code. This time ported

them back to the Haiku versions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34262 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-11-25 21:52:43 +00:00
parent e48f3e5b7e
commit 41975f20f0
6 changed files with 20 additions and 18 deletions

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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) {

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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) {