A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
there is now a flush function
[simgrid.git]
/
src
/
xbt
/
dict_elm.c
diff --git
a/src/xbt/dict_elm.c
b/src/xbt/dict_elm.c
index
b5b5154
..
29f06e9
100644
(file)
--- a/
src/xbt/dict_elm.c
+++ b/
src/xbt/dict_elm.c
@@
-211,7
+211,9
@@
gras_dictelm_free(gras_dictelm_t **pp_elm) {
static
void
_dictelm_wrapper_free(void *pp_elm) {
static
void
_dictelm_wrapper_free(void *pp_elm) {
- DEBUG2("Free dictelm %p (*=%p)", pp_elm, *(void**)pp_elm);
+ DEBUG3("Free dictelm '%.*s' %p",
+ (*(gras_dictelm_t**)pp_elm)->key_len, (*(gras_dictelm_t**)pp_elm)->key,
+ *(void**)pp_elm);
gras_dictelm_free((gras_dictelm_t**)pp_elm);
}
gras_dictelm_free((gras_dictelm_t**)pp_elm);
}
@@
-237,7
+239,7
@@
_str_prefix_lgr(const char *key1,
m = 0;
m = 0;
- /*CDEBUG5(dict_search, "%s: [%
*s] <=> [%
*s]", __FUNCTION__,
+ /*CDEBUG5(dict_search, "%s: [%
.*s] <=> [%.
*s]", __FUNCTION__,
key1,key_len1,key2,key_len2);*/
if (o < key_len1 && o < key_len2) {
key1,key_len1,key2,key_len2);*/
if (o < key_len1 && o < key_len2) {
@@
-313,10
+315,10
@@
_dict_child_cmp(gras_dictelm_t *p_dict,
cmp = 1;
}
cmp = 1;
}
- CDEBUG
5(dict_search, "Cmp %*s and %*s
=> %d",
+ CDEBUG
6(dict_search, "Cmp '%.*s' and '%.*s' (offset=%d)
=> %d",
p_child->key_len - *p_offset, p_child->key + *p_offset,
p_child->key_len - *p_offset, p_child->key + *p_offset,
- p_child->key_len - *p_offset, key + *p_offset,
- cmp);
+ key_len - *p_offset, key + *p_offset,
+
*p_offset,
cmp);
end:
*p_offset = o;
end:
*p_offset = o;
@@
-361,7
+363,7
@@
_gras_dictelm_child_search(gras_dictelm_t *p_elm,
int len = 0;
int len = 0;
- CDEBUG5(dict_search, "search child [%
*s] under [%
*s] (len=%d)",
+ CDEBUG5(dict_search, "search child [%
.*s] under [%.
*s] (len=%d)",
key_len, key,
p_elm?p_elm->key_len:6, p_elm?p_elm->key:"(head)",
(p_elm&&p_elm->sub)?gras_dynar_length(p_elm->sub):0);
key_len, key,
p_elm?p_elm->key_len:6, p_elm?p_elm->key:"(head)",
(p_elm&&p_elm->sub)?gras_dynar_length(p_elm->sub):0);
@@
-384,7
+386,7
@@
_gras_dictelm_child_search(gras_dictelm_t *p_elm,
*p_offset = o;
*p_pos = p;
*p_match = m;
*p_offset = o;
*p_pos = p;
*p_match = m;
- CDEBUG5(dict_search, "search [%
*s] in [%
*s] => %s",
+ CDEBUG5(dict_search, "search [%
.*s] in [%.
*s] => %s",
key_len, key,
p_elm?p_elm->key_len:6, p_elm?p_elm->key:"(head)",
( m == 0 ? "no child have a common prefix" :
key_len, key,
p_elm?p_elm->key_len:6, p_elm?p_elm->key:"(head)",
( m == 0 ? "no child have a common prefix" :
@@
-442,7
+444,7
@@
_gras_dictelm_set_rec(gras_dictelm_t *p_head,
int pos = 0;
const int old_offset = offset;
int pos = 0;
const int old_offset = offset;
- CDEBUG6(dict_add, "--> Insert '%
*s' after '%
*s' (offset=%d) in tree %p",
+ CDEBUG6(dict_add, "--> Insert '%
.*s' after '%.
*s' (offset=%d) in tree %p",
key_len, key,
((p_head && p_head->key) ? p_head->key_len : 6),
((p_head && p_head->key) ? p_head->key : "(head)"),
key_len, key,
((p_head && p_head->key) ? p_head->key_len : 6),
((p_head && p_head->key) ? p_head->key : "(head)"),
@@
-538,7
+540,7
@@
_gras_dictelm_set_rec(gras_dictelm_t *p_head,
TRY(_gras_dictelm_alloc(anc_key, anc_key_len, old_offset,
NULL, NULL, &p_anc));
TRY(_gras_dictelm_alloc(anc_key, anc_key_len, old_offset,
NULL, NULL, &p_anc));
- CDEBUG3(dict_add, "-> Make a common ancestor %p (%*s)",
+ CDEBUG3(dict_add, "-> Make a common ancestor %p (%
.
*s)",
p_anc, anc_key_len, anc_key);
if (key[offset] < p_child->key[offset]) {
p_anc, anc_key_len, anc_key);
if (key[offset] < p_child->key[offset]) {
@@
-648,7
+650,7
@@
_gras_dictelm_get_rec(gras_dictelm_t *p_head,
gras_error_t errcode = no_error;
gras_error_t errcode = no_error;
- CDEBUG3(dict_search, "Search %*s in %p", key_len, key, p_head);
+ CDEBUG3(dict_search, "Search %
.
*s in %p", key_len, key, p_head);
/*** The trivial case first ***/
/*** The trivial case first ***/
@@
-784,7
+786,7
@@
_collapse_if_need(gras_dictelm_t *p_head,
/* Get the child's key as new key */
CDEBUG2(dict_collapse,
/* Get the child's key as new key */
CDEBUG2(dict_collapse,
- "Do collapse with only child %*s", p_child->key_len, p_child->key);
+ "Do collapse with only child %
.
*s", p_child->key_len, p_child->key);
p_head->content = p_child->content;
p_head->free_ctn = p_child->free_ctn;
p_head->content = p_child->content;
p_head->free_ctn = p_child->free_ctn;
@@
-852,7
+854,7
@@
_gras_dictelm_remove_rec(gras_dictelm_t *p_head,
gras_dictelm_t *p_child = NULL;
gras_dynar_get(p_head->sub, pos, &p_child);
gras_dictelm_t *p_child = NULL;
gras_dynar_get(p_head->sub, pos, &p_child);
- /*DEBUG5("Recurse on child %d of %p to remove %*s (prefix=%d)",
+ /*DEBUG5("Recurse on child %d of %p to remove %
.
*s (prefix=%d)",
pos, p_child, key+offset, key_len-offset,offset);*/
TRY(_gras_dictelm_remove_rec(p_child, key, key_len, offset));
pos, p_child, key+offset, key_len-offset,offset);*/
TRY(_gras_dictelm_remove_rec(p_child, key, key_len, offset));
@@
-956,7
+958,7
@@
_gras_dictelm_dump_rec(gras_dictelm_t *p_head,
_gras_bytes_to_string(key, key_len, key_string);
_gras_bytes_to_string(key, key_len, key_string);
- printf("%*s|(%d)", key_len-offset, key_string + offset, offset);
+ printf("%
.
*s|(%d)", key_len-offset, key_string + offset, offset);
free(key_string);
}
free(key_string);
}