/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "portable.h" /* PRINTF_STR */
#include "dict_private.h" /* prototypes of this module */
XBT_LOG_EXTERNAL_CATEGORY(dict);
CDEBUG6(dict_search, "search child [%.*s] under [%.*s]=%p (len=%lu)",
key_len, key,
p_elm ? (p_elm->key_len?p_elm->key_len:6) : 6,
- p_elm ? (p_elm->key?p_elm->key:"(NULL)") : "(head)",
+ p_elm ? PRINTF_STR(p_elm->key) : "(head)",
p_elm,
(p_elm&&p_elm->sub) ? xbt_dynar_length(p_elm->sub) : 0);
len = xbt_dynar_length(p_elm->sub);
- if(1) { /* FIXME: Arnaud, did you leave dead code here? */
+ {
int p_min = 0;
int p_max = len-1;
int cmp = 0;
-
+
p = p_min;
if(len==0) {
p=0;
}
}
}
- } else {
- for (p = 0; p < len; p++) {
- int cmp = 0;
-
- _dict_child_cmp(p_elm, p, key, key_len, &o, &m, &cmp);
-
- if (m)
- break;
-
- o = *p_offset;
- m = 0;
- }
}
*p_offset = o;
*p_match = m;
CDEBUG6(dict_search, "search [%.*s] in [%.*s]=%p => %s",
key_len, key,
- p_elm?(p_elm->key_len?p_elm->key_len:6):6, p_elm?(p_elm->key?p_elm->key:"(null)"):"(head)",
+ p_elm?(p_elm->key_len?p_elm->key_len:6):6, p_elm?PRINTF_STR(p_elm->key):"(head)",
p_elm,
( m == 0 ? "no child have a common prefix" :
( m == 1 ? "selected child have exactly this key" :