From 9e4875c2d328b4708ff67275882a164446db8d1e Mon Sep 17 00:00:00 2001 From: navarrop Date: Fri, 18 Jun 2010 10:07:28 +0000 Subject: [PATCH] Declare LOG_DEFAULT_CATEGORY with LOG_NEW_DEFAULT_SUBCATEGORY. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7900 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/config_unit.c | 2 +- src/dict_unit.c | 6 ++++-- src/dynar_unit.c | 2 +- src/xbt/config.c | 2 +- src/xbt/dict.c | 6 ++++-- src/xbt/dynar.c | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/config_unit.c b/src/config_unit.c index 5d10c3cf64..aee0d7304a 100644 --- a/src/config_unit.c +++ b/src/config_unit.c @@ -12,7 +12,7 @@ #include "xbt.h" #include "xbt/ex.h" -XBT_LOG_EXTERNAL_CATEGORY(xbt_cfg); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support"); static xbt_cfg_t make_set() diff --git a/src/dict_unit.c b/src/dict_unit.c index 55ac0e86d7..56e96f220b 100644 --- a/src/dict_unit.c +++ b/src/dict_unit.c @@ -14,7 +14,8 @@ #include "portable.h" XBT_LOG_EXTERNAL_CATEGORY(xbt_dict); -XBT_LOG_DEFAULT_CATEGORY(xbt_dict); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict, xbt, + "Dictionaries provide the same functionalities than hash tables"); static void print_str(void *str) @@ -363,6 +364,7 @@ XBT_TEST_UNIT("nulldata", test_dict_nulldata, "NULL data management") } static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data) { + uintptr_t stored_data = 0; xbt_test_log2("Add %zu under %zu", data, key); xbt_dicti_set(head, key, data); @@ -370,7 +372,7 @@ static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data) { xbt_dict_dump(head, (void (*)(void *)) &printf); fflush(stdout); } - uintptr_t stored_data = xbt_dicti_get(head, key); + stored_data = xbt_dicti_get(head, key); xbt_test_assert3(stored_data==data, "Retrieved data (%zu) is not what I just stored (%zu) under key %zu",stored_data,data,key); } diff --git a/src/dynar_unit.c b/src/dynar_unit.c index 6791935093..3c9b2761fe 100644 --- a/src/dynar_unit.c +++ b/src/dynar_unit.c @@ -13,7 +13,7 @@ #define NB_ELEM 5000 XBT_LOG_EXTERNAL_CATEGORY(xbt_dyn); -XBT_LOG_DEFAULT_CATEGORY(xbt_dyn); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dyn, xbt, "Dynamic arrays"); XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers") { diff --git a/src/xbt/config.c b/src/xbt/config.c index 442c3a2cdd..0936822379 100644 --- a/src/xbt/config.c +++ b/src/xbt/config.c @@ -1294,7 +1294,7 @@ xbt_cfg_get_peer_at(xbt_cfg_t cfg, const char *name, int pos, #include "xbt.h" #include "xbt/ex.h" -XBT_LOG_EXTERNAL_CATEGORY(xbt_cfg); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support"); XBT_TEST_SUITE("config", "Configuration support"); diff --git a/src/xbt/dict.c b/src/xbt/dict.c index 8d9fa7e222..4f507cbb75 100644 --- a/src/xbt/dict.c +++ b/src/xbt/dict.c @@ -811,7 +811,8 @@ static void dict_mallocator_reset_f(void *dict) #include "portable.h" XBT_LOG_EXTERNAL_CATEGORY(xbt_dict); -XBT_LOG_DEFAULT_CATEGORY(xbt_dict); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict, xbt, + "Dictionaries provide the same functionalities than hash tables"); XBT_TEST_SUITE("dict", "Dict data container"); @@ -1161,6 +1162,7 @@ XBT_TEST_UNIT("nulldata", test_dict_nulldata, "NULL data management") } static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data) { + uintptr_t stored_data = 0; xbt_test_log2("Add %zu under %zu", data, key); xbt_dicti_set(head, key, data); @@ -1168,7 +1170,7 @@ static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data) { xbt_dict_dump(head, (void (*)(void *)) &printf); fflush(stdout); } - uintptr_t stored_data = xbt_dicti_get(head, key); + stored_data = xbt_dicti_get(head, key); xbt_test_assert3(stored_data==data, "Retrieved data (%zu) is not what I just stored (%zu) under key %zu",stored_data,data,key); } diff --git a/src/xbt/dynar.c b/src/xbt/dynar.c index 5770d7ce6b..02a9a12591 100644 --- a/src/xbt/dynar.c +++ b/src/xbt/dynar.c @@ -717,7 +717,7 @@ XBT_INLINE void xbt_dynar_sort(xbt_dynar_t dynar, int_f_cpvoid_cpvoid_t compar_f XBT_TEST_SUITE("dynar", "Dynar data container"); XBT_LOG_EXTERNAL_CATEGORY(xbt_dyn); -XBT_LOG_DEFAULT_CATEGORY(xbt_dyn); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dyn, xbt, "Dynamic arrays"); XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers") { -- 2.20.1