From 42ef52132a1ac49ea1d370c92eb133cbd2d16382 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 27 Feb 2009 16:11:57 +0000 Subject: [PATCH] Made usable from userland. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29335 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/util/OpenHashTable.h | 22 +++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/headers/private/kernel/util/OpenHashTable.h b/headers/private/kernel/util/OpenHashTable.h index 6cf2fcb8ae..1a28614a06 100644 --- a/headers/private/kernel/util/OpenHashTable.h +++ b/headers/private/kernel/util/OpenHashTable.h @@ -6,8 +6,12 @@ #define _KERNEL_UTIL_OPEN_HASH_TABLE_H -#include -#include +#include + +#ifdef _KERNEL_MODE +# include +# include +#endif /*! @@ -116,8 +120,13 @@ public: void InsertUnchecked(ValueType *value) { - if (CheckDuplicates && _ExhaustiveSearch(value)) + if (CheckDuplicates && _ExhaustiveSearch(value)) { +#ifdef _KERNEL_MODE panic("Hash Table: value already in table."); +#else + debugger("Hash Table: value already in table."); +#endif + } _Insert(fTable, fTableSize, value); fItemCount++; @@ -160,8 +169,13 @@ public: if (slot == NULL) return false; - if (CheckDuplicates && _ExhaustiveSearch(value)) + if (CheckDuplicates && _ExhaustiveSearch(value)) { +#ifdef _KERNEL_MODE panic("Hash Table: duplicate detected."); +#else + debugger("Hash Table: duplicate detected."); +#endif + } fItemCount--; return true;