Fixed all warnings that appeared with DEBUG=1 set.

Also fixed missing return codes in BufferPool::ReleaseBuffer() and Journal::WriteLogEntry().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2845 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2003-02-25 15:07:26 +00:00
parent 130798445f
commit 98b972c906
7 changed files with 16 additions and 13 deletions

View File

@ -1613,7 +1613,7 @@ BPlusTree::Find(const uint8 *key, uint16 keyLength, off_t *_value)
*_value = node->Values()[keyIndex];
#ifdef DEBUG
if (levels != fHeader->max_number_of_levels)
if (levels != (int32)fHeader->max_number_of_levels)
DEBUGGER(("levels don't match"));
#endif
return status;

View File

@ -120,7 +120,7 @@ void
AllocationBlock::Allocate(uint16 start, uint16 numBlocks)
{
ASSERT(start < fNumBits);
ASSERT(start + numBlocks <= fNumBits);
ASSERT(uint32(start + numBlocks) <= fNumBits);
if (uint32(start + numBlocks) > fNumBits) {
FATAL(("Allocation::Allocate(): tried to allocate too many blocks: %u (numBlocks = %lu)!\n", numBlocks, fNumBits));
@ -151,7 +151,7 @@ void
AllocationBlock::Free(uint16 start, uint16 numBlocks)
{
ASSERT(start < fNumBits);
ASSERT(start + numBlocks <= fNumBits);
ASSERT(uint32(start + numBlocks) <= fNumBits);
if (uint32(start + numBlocks) > fNumBits) {
FATAL(("Allocation::Free(): tried to free too many blocks: %u (numBlocks = %lu)!\n", numBlocks, fNumBits));
@ -302,6 +302,7 @@ AllocationGroup::Free(Transaction *transaction, uint16 start, int32 length)
start = 0;
block++;
}
return B_OK;
}

View File

@ -115,6 +115,7 @@ BufferPool::ReleaseBuffers()
fFirstFree = buffer;
release_sem(fLock);
return B_OK;
}

View File

@ -56,7 +56,8 @@
#ifdef DEBUG
#define PRINT(x) { __out("bfs: "); __out x; }
#define REPORT_ERROR(status) __out("bfs: %s:%ld: %s\n",__FUNCTION__,__LINE__,strerror(status));
#define REPORT_ERROR(status) \
__out("bfs: %s:%d: %s\n", __FUNCTION__, __LINE__, strerror(status));
#define RETURN_ERROR(err) { status_t _status = err; if (_status < B_OK) REPORT_ERROR(_status); return _status;}
#define FATAL(x) { __out("bfs: "); __out x; }
#define INFORM(x) { __out("bfs: "); __out x; }

View File

@ -49,10 +49,10 @@ Journal::InitCheck()
status_t
Journal::CheckLogEntry(int32 count,off_t *array)
Journal::CheckLogEntry(int32 count, off_t *array)
{
// ToDo: check log entry integrity (block numbers and entry size)
PRINT(("Log entry has %ld entries (%Ld)\n", count));
PRINT(("Log entry has %ld entries (%Ld)\n", count, array[0]));
return B_OK;
}
@ -303,7 +303,7 @@ Journal::WriteLogEntry()
fVolume->SuperBlock().log_end = logPosition;
fVolume->LogEnd() = logPosition;
fVolume->WriteSuperBlock();
return fVolume->WriteSuperBlock();
}

View File

@ -454,8 +454,8 @@ Stream<Cache>::ReadAt(off_t pos, uint8 *buffer, size_t *_length)
int32 bytes = run.length << blockShift;
#ifdef DEBUG
if (bytes > length)
DEBUGGER("bytes greater than length");
if ((uint32)bytes > length)
DEBUGGER(("bytes greater than length"));
#endif
length -= bytes;
bytesRead += bytes;

View File

@ -793,7 +793,7 @@ bfs_write_stat(void *_ns, void *_node, struct stat *stat, long mask)
}
if (mask & WSTAT_MODE) {
PRINT(("original mode = %ld, stat->st_mode = %ld\n", node->mode, stat->st_mode));
PRINT(("original mode = %ld, stat->st_mode = %d\n", node->mode, stat->st_mode));
node->mode = node->mode & ~S_IUMSK | stat->st_mode & S_IUMSK;
}
@ -824,7 +824,7 @@ int
bfs_create(void *_ns, void *_directory, const char *name, int omode, int mode,
vnode_id *vnodeID, void **_cookie)
{
FUNCTION_START(("name = \"%s\", perms = %ld, omode = %ld\n", name, mode, omode));
FUNCTION_START(("name = \"%s\", perms = %d, omode = %d\n", name, mode, omode));
if (_ns == NULL || _directory == NULL || _cookie == NULL
|| name == NULL || *name == '\0')
@ -1419,7 +1419,7 @@ bfs_read_link(void *_ns, void *_node, char *buffer, size_t *bufferSize)
int
bfs_mkdir(void *_ns, void *_directory, const char *name, int mode)
{
FUNCTION_START(("name = \"%s\", perms = %ld\n", name, mode));
FUNCTION_START(("name = \"%s\", perms = %d\n", name, mode));
if (_ns == NULL || _directory == NULL
|| name == NULL || *name == '\0')
@ -1880,7 +1880,7 @@ bfs_read_indexdir(void *_ns, void *_cookie, long *num, struct dirent *dirent, si
int
bfs_create_index(void *_ns, const char *name, int type, int flags)
{
FUNCTION_START(("name = \"%s\", type = %ld, flags = %ld\n", name, type, flags));
FUNCTION_START(("name = \"%s\", type = %d, flags = %d\n", name, type, flags));
if (_ns == NULL || name == NULL || *name == '\0')
return B_BAD_VALUE;