From 79d9a0eadea4d00dbf2de0c19f6a8c0451f40e34 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 2 Apr 2019 14:36:25 +0200 Subject: [PATCH 1/1] Kill unused xbt_dict_dump(). It's last usage was in ancient unit tests. --- ChangeLog | 3 +++ include/xbt/dict.h | 1 - src/xbt/dict.cpp | 34 ---------------------------------- 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0fa7201068..725ee0199d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ SimGrid (3.23) NOT RELEASED (Release Target: June 21. 2019, 15:54 UTC) +XBT: + - Drop xbt_dict_dump. + ---------------------------------------------------------------------------- SimGrid (3.22) April 1. 2019 diff --git a/include/xbt/dict.h b/include/xbt/dict.h index 2ee6f60837..589af4a591 100644 --- a/include/xbt/dict.h +++ b/include/xbt/dict.h @@ -79,7 +79,6 @@ XBT_PUBLIC xbt_dictelm_t xbt_dict_get_elm_or_null(xbt_dict_t dict, const char* k XBT_PUBLIC void xbt_dict_remove(xbt_dict_t dict, const char* key); XBT_PUBLIC void xbt_dict_reset(xbt_dict_t dict); XBT_PUBLIC int xbt_dict_length(xbt_dict_t dict); -XBT_PUBLIC void xbt_dict_dump(xbt_dict_t dict, void (*output)(void*)); XBT_PUBLIC int xbt_dict_is_empty(xbt_dict_t dict); /** @} */ diff --git a/src/xbt/dict.cpp b/src/xbt/dict.cpp index e15c41d516..94be19e07d 100644 --- a/src/xbt/dict.cpp +++ b/src/xbt/dict.cpp @@ -397,40 +397,6 @@ int xbt_dict_is_empty(xbt_dict_t dict) return not dict || (xbt_dict_length(dict) == 0); } -/** - * @brief Outputs the content of the structure (debugging purpose) - * - * @param dict the exibitionist - * @param output a function to dump each data in the tree - * - * Outputs the content of the structure. (for debugging purpose). - * @a output is a function to output the data. If nullptr, data won't be displayed. - */ -void xbt_dict_dump(xbt_dict_t dict, void_f_pvoid_t output) -{ - xbt_dictelm_t element; - printf("Dict %p:\n", dict); - if (dict != nullptr) { - for (int i = 0; i < dict->table_size; i++) { - element = dict->table[i]; - if (element) { - printf("[\n"); - while (element != nullptr) { - printf(" %s -> '", element->key); - if (output != nullptr) { - output(element->content); - } - printf("'\n"); - element = element->next; - } - printf("]\n"); - } else { - printf("[]\n"); - } - } - } -} - /** * Create the dict mallocators. * This is an internal XBT function called during the lib initialization. -- 2.20.1