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
Bugfix: don't assume that null content means not found. Add tons of debugs to find...
[simgrid.git]
/
src
/
xbt
/
dict_cursor.c
diff --git
a/src/xbt/dict_cursor.c
b/src/xbt/dict_cursor.c
index
3dc52dc
..
1e33935
100644
(file)
--- a/
src/xbt/dict_cursor.c
+++ b/
src/xbt/dict_cursor.c
@@
-64,7
+64,7
@@
xbt_dict_cursor_free(xbt_dict_cursor_t *cursor) {
if (*cursor) {
xbt_dynar_free(&((*cursor)->keys));
xbt_dynar_free(&((*cursor)->key_lens));
if (*cursor) {
xbt_dynar_free(&((*cursor)->keys));
xbt_dynar_free(&((*cursor)->key_lens));
-
xbt_
free(*cursor);
+ free(*cursor);
*cursor = NULL;
}
}
*cursor = NULL;
}
}
@@
-94,9
+94,9
@@
_cursor_push_keys(xbt_dict_cursor_t cursor,
int i = 0;
static volatile int count = 0; /* ??? */
int i = 0;
static volatile int count = 0; /* ??? */
- CDEBUG
1(dict_cursor, "Push childs of %p in the cursor", (void*)elm
);
+ CDEBUG
3(dict_cursor, "Push childs of %p (%.*s) in the cursor", (void*)elm, elm->key_len, elm->key
);
- if (
elm->content
) {
+ if (
!elm->internal
) {
xbt_dynar_push(cursor->keys, &elm->key );
xbt_dynar_push(cursor->key_lens, &elm->key_len);
count++;
xbt_dynar_push(cursor->keys, &elm->key );
xbt_dynar_push(cursor->key_lens, &elm->key_len);
count++;
@@
-155,6
+155,9
@@
void
xbt_dict_cursor_step(xbt_dict_cursor_t cursor) {
xbt_assert(cursor);
xbt_dict_cursor_step(xbt_dict_cursor_t cursor) {
xbt_assert(cursor);
+ DEBUG2("step cursor. Current=%.*s",
+ xbt_dynar_get_as(cursor->key_lens,cursor->pos_len,int),
+ xbt_dynar_get_as(cursor->keys,cursor->pos,char *));
xbt_dynar_cursor_step(cursor->keys, &cursor->pos);
xbt_dynar_cursor_step(cursor->key_lens, &cursor->pos_len);
}
xbt_dynar_cursor_step(cursor->keys, &cursor->pos);
xbt_dynar_cursor_step(cursor->key_lens, &cursor->pos_len);
}
@@
-166,8
+169,8
@@
xbt_dict_cursor_step(xbt_dict_cursor_t cursor) {
*/
int
xbt_dict_cursor_get_or_free(xbt_dict_cursor_t *cursor,
*/
int
xbt_dict_cursor_get_or_free(xbt_dict_cursor_t *cursor,
-
char **key,
-
void **data) {
+ char **key,
+ void **data) {
xbt_error_t errcode = no_error;
int key_len = 0;
xbt_error_t errcode = no_error;
int key_len = 0;