From: Arnaud Giersch Date: Mon, 25 Jun 2018 09:10:16 +0000 (+0200) Subject: Remove features marked with DEPRECATED_v321. X-Git-Tag: v3_21~633 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/76c70a751b2ef94044ccb57c6c9cff83e0aec728?hp=7bd6ef615b0ed25b508ab8bc0e128a6584e8ad66 Remove features marked with DEPRECATED_v321. --- diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 4f86868c25..edbd796ffb 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -1461,7 +1461,6 @@ PREDEFINED = XBT_PUBLIC= \ XBT_PUBLIC_DATA=extern \ XBT_INLINE= \ XBT_PRIVATE= \ - XBT_ATTRIB_DEPRECATED_v321(m)= \ XBT_ATTRIB_DEPRECATED_v322(m)= \ XBT_ATTRIB_DEPRECATED_v323(m)= diff --git a/include/simgrid/s4u/Link.hpp b/include/simgrid/s4u/Link.hpp index fd39b35d3c..e1832a8b22 100644 --- a/include/simgrid/s4u/Link.hpp +++ b/include/simgrid/s4u/Link.hpp @@ -94,7 +94,6 @@ public: static simgrid::xbt::signal on_communication_state_change; // Deprecated methods - XBT_ATTRIB_DEPRECATED_v321("Use get_cname(): v3.21 will turn this warning into an error.") const char* name(); XBT_ATTRIB_DEPRECATED_v323("Please use Link::by_name()") static Link* byName(const char* name) { return by_name(name); } XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_name()") const std::string& getName() const { return get_name(); } XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_cname()") const char* getCname() const { return get_cname(); } diff --git a/include/xbt/base.h b/include/xbt/base.h index 34e588f5b1..53f71a36ce 100644 --- a/include/xbt/base.h +++ b/include/xbt/base.h @@ -71,7 +71,6 @@ #define XBT_ATTRIB_DEPRECATED(mesg) __attribute__((deprecated(mesg))) #endif -#define XBT_ATTRIB_DEPRECATED_v321(mesg) XBT_ATTRIB_DEPRECATED(mesg) /* Will be dropped in v3.21 */ #define XBT_ATTRIB_DEPRECATED_v322(mesg) XBT_ATTRIB_DEPRECATED(mesg) /* Will be dropped in v3.22 */ #define XBT_ATTRIB_DEPRECATED_v323(mesg) \ XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped in v3.23)") /* Will be dropped in v3.23 */ diff --git a/include/xbt/dict.h b/include/xbt/dict.h index a4623bf575..3eeca4d023 100644 --- a/include/xbt/dict.h +++ b/include/xbt/dict.h @@ -73,19 +73,13 @@ XBT_PUBLIC void xbt_dict_set(xbt_dict_t dict, const char* key, void* data, void_ XBT_PUBLIC void* xbt_dict_get(xbt_dict_t dict, const char* key); XBT_PUBLIC void* xbt_dict_get_or_null(xbt_dict_t dict, const char* key); XBT_PUBLIC char* xbt_dict_get_key(xbt_dict_t dict, const void* data); -XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC - char* xbt_dict_get_elm_key(xbt_dictelm_t elem); XBT_PUBLIC xbt_dictelm_t xbt_dict_get_elm(xbt_dict_t dict, const char* key); XBT_PUBLIC xbt_dictelm_t xbt_dict_get_elm_or_null(xbt_dict_t dict, const char* key); 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_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC - void xbt_dict_dump_output_string(void* s); XBT_PUBLIC void xbt_dict_dump(xbt_dict_t dict, void (*output)(void*)); -XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC - void xbt_dict_dump_sizes(xbt_dict_t dict); XBT_PUBLIC int xbt_dict_is_empty(xbt_dict_t dict); /** @} */ @@ -143,8 +137,6 @@ XBT_PUBLIC void xbt_dict_cursor_rewind(xbt_dict_cursor_t cursor); XBT_PUBLIC char* xbt_dict_cursor_get_key(xbt_dict_cursor_t cursor); XBT_PUBLIC void* xbt_dict_cursor_get_data(xbt_dict_cursor_t cursor); -XBT_ATTRIB_DEPRECATED_v321("xbt_dict is dying. v3.21 will turn this warning into an error.") XBT_PUBLIC - void xbt_dict_cursor_set_data(xbt_dict_cursor_t cursor, void* data, void_f_pvoid_t free_ctn); XBT_PUBLIC void xbt_dict_cursor_first(const xbt_dict_t dict, xbt_dict_cursor_t* cursor); XBT_PUBLIC void xbt_dict_cursor_step(xbt_dict_cursor_t cursor); diff --git a/src/s4u/s4u_Link.cpp b/src/s4u/s4u_Link.cpp index bf07bfdd9a..a49d92dcb6 100644 --- a/src/s4u/s4u_Link.cpp +++ b/src/s4u/s4u_Link.cpp @@ -43,10 +43,6 @@ const char* Link::get_cname() const { return this->pimpl_->get_cname(); } -const char* Link::name() -{ - return get_cname(); -} bool Link::is_used() { return this->pimpl_->is_used(); diff --git a/src/xbt/dict.cpp b/src/xbt/dict.cpp index d4c7af3e10..ce4cc7bb6b 100644 --- a/src/xbt/dict.cpp +++ b/src/xbt/dict.cpp @@ -246,12 +246,6 @@ char *xbt_dict_get_key(xbt_dict_t dict, const void *data) return nullptr; } -/** @brief retrieve the key associated to that xbt_dictelm_t. */ -char *xbt_dict_get_elm_key(xbt_dictelm_t elm) -{ - return elm->key; -} - /** * \brief Retrieve data from the dict (null-terminated key) * @@ -394,12 +388,6 @@ int xbt_dict_length(xbt_dict_t dict) return dict->count; } -/** @brief function to be used in xbt_dict_dump as long as the stored values are strings */ -void xbt_dict_dump_output_string(void *s) -{ - fputs((char*) s, stdout); -} - /** * \brief test if the dict is empty or not */ @@ -442,63 +430,6 @@ void xbt_dict_dump(xbt_dict_t dict, void_f_pvoid_t output) } } -xbt_dynar_t all_sizes = nullptr; -/** @brief shows some debugging info about the bucklet repartition */ -void xbt_dict_dump_sizes(xbt_dict_t dict) -{ - unsigned int count; - unsigned int size; - - printf("Dict %p: %d bucklets, %d used cells (of %d) ", dict, dict->count, dict->fill, dict->table_size); - - if (not dict) { - printf("\n"); - return; - } - xbt_dynar_t sizes = xbt_dynar_new(sizeof(int), nullptr); - - for (int i = 0; i < dict->table_size; i++) { - xbt_dictelm_t element = dict->table[i]; - size = 0; - if (element) { - while (element != nullptr) { - size++; - element = element->next; - } - } - if (xbt_dynar_length(sizes) <= size) { - int prevsize = 1; - xbt_dynar_set(sizes, size, &prevsize); - } else { - int prevsize; - xbt_dynar_get_cpy(sizes, size, &prevsize); - prevsize++; - xbt_dynar_set(sizes, size, &prevsize); - } - } - if (not all_sizes) - all_sizes = xbt_dynar_new(sizeof(int), nullptr); - - xbt_dynar_foreach(sizes, count, size) { - /* Copy values of this one into all_sizes */ - int prevcount; - if (xbt_dynar_length(all_sizes) <= count) { - prevcount = size; - xbt_dynar_set(all_sizes, count, &prevcount); - } else { - xbt_dynar_get_cpy(all_sizes, count, &prevcount); - prevcount += size; - xbt_dynar_set(all_sizes, count, &prevcount); - } - - /* Report current sizes */ - if (count != 0 && size != 0) - printf("%uelm x %u cells; ", count, size); - } - printf("\n"); - xbt_dynar_free(&sizes); -} - /** * Create the dict mallocators. * This is an internal XBT function called during the lib initialization. @@ -521,24 +452,6 @@ void xbt_dict_postexit() xbt_mallocator_free(dict_elm_mallocator); dict_elm_mallocator = nullptr; } - if (all_sizes) { - unsigned int count; - int size; - double avg = 0; - int total_count = 0; - printf("Overall stats:"); - xbt_dynar_foreach(all_sizes, count, size) { - if (count != 0 && size != 0) { - printf("%uelm x %d cells; ", count, size); - avg += count * size; - total_count += size; - } - } - if (total_count > 0) - printf("; %f elm per cell\n", avg / (double)total_count); - else - printf("; 0 elm per cell\n"); - } } #ifdef SIMGRID_TEST diff --git a/src/xbt/dict_cursor.c b/src/xbt/dict_cursor.c index f6b6a3d045..b528645f03 100644 --- a/src/xbt/dict_cursor.c +++ b/src/xbt/dict_cursor.c @@ -164,15 +164,3 @@ inline void *xbt_dict_cursor_get_data(xbt_dict_cursor_t cursor) return cursor->current->content; } - -/** - * @brief Set current data - * @param cursor the cursor - * @param data the new data - * @param free_ctn unused parameter (kept for compatibility) - */ -inline void xbt_dict_cursor_set_data(xbt_dict_cursor_t cursor, void* data, XBT_ATTRIB_UNUSED void_f_pvoid_t free_ctn) -{ - __cursor_not_null(cursor); - xbt_dictelm_set_data(cursor->dict, cursor->current, data); -}