From 394d5e16a8d54efcc22ccd295f50ebffddb93f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 1 Oct 2003 01:55:49 +0000 Subject: [PATCH] Fixed warnings. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4901 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/file_systems/bfs/btree/cache.cpp | 2 +- .../kernel/file_systems/bfs/btree/test.cpp | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/tests/add-ons/kernel/file_systems/bfs/btree/cache.cpp b/src/tests/add-ons/kernel/file_systems/bfs/btree/cache.cpp index 2b9275188a..b826d646b5 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/btree/cache.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/btree/cache.cpp @@ -48,7 +48,7 @@ shutdown_cache(BFile *file,int32 blockSize) static status_t readBlocks(BFile *file,uint32 num,uint32 size) { - for (int32 i = gBlocks.CountItems();i <= num;i++) { + for (uint32 i = gBlocks.CountItems(); i <= num; i++) { void *buffer = malloc(size); if (buffer == NULL) return B_NO_MEMORY; diff --git a/src/tests/add-ons/kernel/file_systems/bfs/btree/test.cpp b/src/tests/add-ons/kernel/file_systems/bfs/btree/test.cpp index e521ffbf2e..ea7ff2a9b9 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/btree/test.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/btree/test.cpp @@ -88,38 +88,38 @@ bailOut() void -bailOutWithKey(void *key,uint16 length) +bailOutWithKey(void *key, uint16 length) { - dumpKey(key,length); + dumpKey(key, length); putchar('\n'); bailOut(); } void -dumpKey(void *key,int32 length) +dumpKey(void *key, int32 length) { switch (gType) { case S_STR_INDEX: - printf("\"%s\" (%ld bytes)",key,length); + printf("\"%s\" (%ld bytes)", (char *)key, length); break; case S_INT_INDEX: - printf("%ld",*(int32 *)key); + printf("%ld", *(int32 *)key); break; case S_UINT_INDEX: - printf("%lu",*(uint32 *)key); + printf("%lu", *(uint32 *)key); break; case S_LONG_LONG_INDEX: - printf("%Ld",*(int64 *)key); + printf("%Ld", *(int64 *)key); break; case S_ULONG_LONG_INDEX: - printf("%Lu",*(uint64 *)key); + printf("%Lu", *(uint64 *)key); break; case S_FLOAT_INDEX: - printf("%g",*(float *)key); + printf("%g", *(float *)key); break; case S_DOUBLE_INDEX: - printf("%g",*(double *)key); + printf("%g", *(double *)key); break; } if ((gType == S_INT_INDEX || gType == S_UINT_INDEX || gType == S_FLOAT_INDEX) @@ -243,11 +243,11 @@ fillBuffer(void *buffer,int32 start) bool -findKey(void *key,int32 length,int32 maxIndex) +findKey(void *key, int32 length, int32 maxIndex) { for (int32 i = length;i < maxIndex;i += MAX_STRING - MIN_STRING) { - if (length == gKeys[i].length - && !memcpy(key,gKeys[i].data,length)) + if (length == (int32)gKeys[i].length + && !memcpy(key, gKeys[i].data, length)) return true; } return false; @@ -606,8 +606,8 @@ usage(char *program) "\t-t\ttype is one of string, int32, uint32, int64, uint64, float,\n" "\t\tor double; defaults to string.\n" "\t-n\tkeys is the number of keys to be used,\n" - "\t\tminimum is 1, defaults to %ld.\n" - "\t-i\titerations is the number of the test cycles, defaults to %ld.\n" + "\t\tminimum is 1, defaults to %d.\n" + "\t-i\titerations is the number of the test cycles, defaults to %d.\n" "\t-r\tthe seed for the random function, defaults to %ld.\n" "\t-h\tremoves the keys and start over again for x times.\n" "\t-e\texcessive validity tests: tree contents will be tested after every operation\n"