projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7c94d5b
)
Add propper debugging for lflathashs, crash if debug and invalid combination of ...
author
Wilfried Goesgens
<willi@arangodb.com>
Sun, 11 Oct 2015 21:24:37 +0000
(23:24 +0200)
committer
Wilfried Goesgens
<willi@arangodb.com>
Sun, 11 Oct 2015 21:24:37 +0000
(23:24 +0200)
libcitadel/lib/hash.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/hash.c
b/libcitadel/lib/hash.c
index 0eedcab41c3850fd35746079009842e8a97050d3..ab7eec1896206b12797b442b4952114414c64285 100644
(file)
--- a/
libcitadel/lib/hash.c
+++ b/
libcitadel/lib/hash.c
@@
-230,7
+230,12
@@
int dbg_PrintHash(HashList *Hash, PrintHashContent First, PrintHashContent Secon
}
#ifdef DEBUG
}
#ifdef DEBUG
- printf (" ---- Hashkey[%ld][%ld]: '%s' Value: '%s' ; %s\n", i, key, foo, bar, bla);
+ if ((Hash->Algorithm == lFlathash) || (Hash->Algorithm == Flathash)) {
+ printf (" ---- Hashkey[%ld][%ld]: %ld '%s' Value: '%s' ; %s\n", i, key, *(long*) foo, foo, bar, bla);
+ }
+ else {
+ printf (" ---- Hashkey[%ld][%ld]: '%s' Value: '%s' ; %s\n", i, key, foo, bar, bla);
+ }
#endif
}
#ifdef DEBUG
#endif
}
#ifdef DEBUG
@@
-618,7
+623,13
@@
static long FindInHash(HashList *Hash, long HashBinKey)
long Flathash(const char *str, long len)
{
if (len != sizeof (int))
long Flathash(const char *str, long len)
{
if (len != sizeof (int))
+ {
+#ifdef DEBUG
+ int *crash = NULL;
+ *crash = 1;
+#endif
return 0;
return 0;
+ }
else return *(int*)str;
}
else return *(int*)str;
}
@@
-632,7
+643,13
@@
long Flathash(const char *str, long len)
long lFlathash(const char *str, long len)
{
if (len != sizeof (long))
long lFlathash(const char *str, long len)
{
if (len != sizeof (long))
+ {
+#ifdef DEBUG
+ int *crash = NULL;
+ *crash = 1;
+#endif
return 0;
return 0;
+ }
else return *(long*)str;
}
else return *(long*)str;
}