file_systems/reiserfs: Fix -Wformat=

Change-Id: Ic011a5407ff5ecb832606541d258005217dcd6be
Reviewed-on: https://review.haiku-os.org/c/1529
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Murai Takashi 2019-06-08 10:05:17 +09:00 committed by Jérôme Duval
parent bc71f97ed7
commit 44c006d567
9 changed files with 55 additions and 41 deletions

View File

@ -284,9 +284,10 @@ Node::Check() const
{
// check the minimal size of the node against its declared free space
if (GetFreeSpace() + sizeof(block_head) > GetBlockSize()) {
FATAL(("WARNING: bad node %Ld: it declares more free space than "
"possibly being available (%u vs %lu)!\n", GetNumber(),
GetFreeSpace(), GetBlockSize() - sizeof(block_head)));
FATAL(("WARNING: bad node %" B_PRIu64
": it declares more free space than "
"possibly being available (%u vs %lu)!\n", GetNumber(),
GetFreeSpace(), GetBlockSize() - sizeof(block_head)));
return B_BAD_DATA;
}
return B_OK;
@ -351,10 +352,12 @@ InternalNode::Check() const
uint32 size = (const uint8*)(GetChilds() + (CountItems() + 1))
- (const uint8*)GetData();
if (size + GetFreeSpace() > GetBlockSize()) {
FATAL(("WARNING: bad internal node %Ld: it declares more free space "
"than possibly being available (size: %lu, block size: %lu, "
"free space: %u)!\n", GetNumber(), size, GetBlockSize(),
GetFreeSpace()));
FATAL(("WARNING: bad internal node %" B_PRIu64
": it declares more free space "
"than possibly being available (size: %" B_PRIu32 ", "
"block size: %" B_PRIu32 ", "
"free space: %u)!\n", GetNumber(), size, GetBlockSize(),
GetFreeSpace()));
return B_BAD_DATA;
}
return B_OK;
@ -422,10 +425,12 @@ LeafNode::Check() const
// don't need to invoke it.
uint32 size = GetItemSpaceOffset();
if (size + GetFreeSpace() > GetBlockSize()) {
FATAL(("WARNING: bad leaf node %Ld: it declares more free space "
"than possibly being available (min size: %lu, block size: "
"%lu, free space: %u)!\n", GetNumber(), size, GetBlockSize(),
GetFreeSpace()));
FATAL(("WARNING: bad leaf node %" B_PRIu64
": it declares more free space "
"than possibly being available "
"(min size: %" B_PRIu32 ", block size: "
"%" B_PRIu32 ", free space: %u)!\n",
GetNumber(), size, GetBlockSize(), GetFreeSpace()));
return B_BAD_DATA;
}
return B_OK;

View File

@ -68,8 +68,8 @@ BlockCache::~BlockCache()
fLock.Lock();
for (int32 i = 0; Block *block = fBlocks.ItemAt(i); i++) {
if (block->_GetRefCount() > 0) {
INFORM(("WARNING: block not put: %p (ref count: %ld)\n", block,
block->_GetRefCount()));
INFORM(("WARNING: block not put: %p (ref count: %" B_PRId32 ")\n",
block, block->_GetRefCount()));
}
delete block;
}

View File

@ -96,11 +96,13 @@ public:
uint32 location = entry->GetLocation();
if (location < GetEntryNameSpaceOffset() || location > GetLen()) {
// bad location
FATAL(("WARNING: bad dir entry %ld in item %ld on node %Ld: "
"the entry's name location is %lu, which is outside the"
"entry name space (%lu - %u)!\n", index, GetIndex(),
fNode->GetNumber(), location, GetEntryNameSpaceOffset(),
GetLen()));
FATAL(("WARNING: bad dir entry %" B_PRId32 " "
"in item %" B_PRId32 " on node %" B_PRIu64 ": "
"the entry's name location is %" B_PRIu32 ", "
"which is outside the entry name space "
"(%" B_PRIu32 " - %u)!\n",
index, GetIndex(), fNode->GetNumber(), location,
GetEntryNameSpaceOffset(), GetLen()));
} else {
// get the name
name = (char*)((uint8*)GetData() + location);
@ -159,10 +161,11 @@ public:
// check whether the entry headers can possibly fit into the item
if (error == B_OK) {
if (GetEntryNameSpaceOffset() > GetLen()) {
FATAL(("WARNING: bad dir item %ld on node %Ld: the item has "
"len %u and can thus impossibly contain %u entry "
"headers!\n", GetIndex(), fNode->GetNumber(), GetLen(),
GetEntryCount()));
FATAL(("WARNING: bad dir item %" B_PRId32 " "
"on node %" B_PRIu64 ": the item has "
"len %u and can thus impossibly contain %u entry "
"headers!\n", GetIndex(), fNode->GetNumber(), GetLen(),
GetEntryCount()));
return B_BAD_DATA;
}
}

View File

@ -206,11 +206,13 @@ Item::Check() const
uint32 location = fHeader->GetLocation();
if (location < itemSpaceOffset
|| location + fHeader->GetLen() > blockSize) {
FATAL(("WARNING: bad item %ld on node %Ld: it can not be located "
"where it claims to be: (location: %lu, len: %u, "
"item space offset: %lu, block size: %lu)!\n", GetIndex(),
fNode->GetNumber(), location, fHeader->GetLen(),
itemSpaceOffset, blockSize));
FATAL(("WARNING: bad item %" B_PRId32
" on node %" B_PRIu64 ": it can not be located "
"where it claims to be: (location: %" B_PRIu32 ", len: %u, "
"item space offset: %" B_PRIu32 ", "
"block size: %" B_PRIu32 ")!\n", GetIndex(),
fNode->GetNumber(), location, fHeader->GetLen(),
itemSpaceOffset, blockSize));
return B_BAD_DATA;
}
return B_OK;

View File

@ -1527,7 +1527,8 @@ StreamReader::_ReadIndirectItem(off_t offset, void *buffer, size_t bufferSize)
bufferSize -= toRead;
buffer = (uint8*)buffer + toRead;
} else {
FATAL(("failed to get block %Lu\n", indirect.BlockNumberAt(i)));
FATAL(("failed to get block %" B_PRIu64 "\n",
indirect.BlockNumberAt(i)));
error = B_IO_ERROR;
}
}

View File

@ -260,8 +260,8 @@ public:
void Dump() const
{
TPRINT(("key: {%lu, %lu, %Lu, %hu}\n", GetDirID(), GetObjectID(),
GetOffset(), GetType()));
TPRINT(("key: {%" B_PRIu32 ", %" B_PRIu32 ", %" B_PRIu64 ", %hu}\n",
GetDirID(), GetObjectID(), GetOffset(), GetType()));
}
private:

View File

@ -237,9 +237,10 @@ public:
stat_data_v1 *data = (stat_data_v1*)GetData();
statData->SetTo(data, clone);
} else {
FATAL(("WARNING: bad stat item %ld on node %Ld: the item len "
"(%u) does not match the len of any stat data format!\n",
GetIndex(), fNode->GetNumber(), GetLen()));
FATAL(("WARNING: bad stat item %" B_PRId32 " "
"on node %" B_PRIu64 ": the item len "
"(%u) does not match the len of any stat data format!\n",
GetIndex(), fNode->GetNumber(), GetLen()));
error = B_BAD_DATA;
}
return error;

View File

@ -68,8 +68,8 @@ Tree::Init(Volume *volume, Node *rootNode, uint32 treeHeight)
if (error == B_OK) {
if (treeHeight > kMaxTreeHeight) {
// we don't need to fail, as we can deal with that gracefully
INFORM(("WARNING: tree height greater maximal height: %lu\n",
treeHeight));
INFORM(("WARNING: tree height greater maximal height: %" B_PRIu32
"\n", treeHeight));
}
fVolume = volume;
fBlockCache = fVolume->GetBlockCache();

View File

@ -346,8 +346,9 @@ Volume::FindVNode(uint32 dirID, uint32 objectID, VNode *node)
if (error == B_OK) {
error = fTree->FindStatItem(dirID, objectID, &item);
if (error != B_OK) {
FATAL(("Couldn't find stat item for node (%lu, %lu)\n",
dirID, objectID));
FATAL(("Couldn't find stat item for node "
"(%" B_PRIu32 ", %" B_PRIu32 ")\n",
dirID, objectID));
}
}
// get the stat data
@ -363,8 +364,9 @@ Volume::FindVNode(uint32 dirID, uint32 objectID, VNode *node)
node->SetParentID(entry->GetDirID(), entry->GetObjectID());
}
else {
FATAL(("failed to find `..' entry for dir node (%lu, %ld)\n",
dirID, objectID));
FATAL(("failed to find `..' entry for dir node "
"(%" B_PRIu32 ", %" B_PRIu32 ")\n",
dirID, objectID));
}
}
return error;
@ -584,8 +586,8 @@ Volume::_InitHashFunction()
// verify it
if (fHashFunction) {
if (_VerifyHashFunction(fHashFunction)) {
INFORM(("Directory hash function successfully detected: %lu\n",
code));
INFORM(("Directory hash function successfully detected: "
"%" B_PRIu32 "\n", code));
} else {
fHashFunction = NULL;
INFORM(("Detected directory hash function is not the right "