Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Mark integer dicts as deprecated.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 25 Nov 2011 22:23:49 +0000 (23:23 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 8 Feb 2012 17:04:18 +0000 (18:04 +0100)
ChangeLog
include/xbt/dict.h
src/xbt/dict.c

index bad8650..7142fe1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -75,6 +75,7 @@ SimGrid (3.7) NOT RELEASED; urgency=low
     create homogeneous dictionaries, where all the elements share the
     same free function. Non homogeneous dictionaries will be
     deprecated in the next release.
+  * Dicts: dicts of scalar elements (xbt_dicti_*) are deprecated.
   * mmalloc module:
     - cleanups and simplifications to make it maintainable again
     - exotic features (such as memalign and valloc) were removed
index 5c6f6df..10cf467 100644 (file)
@@ -91,12 +91,12 @@ XBT_PUBLIC(void *) xbt_dict_get_or_null_ext(xbt_dict_t dict,
 XBT_PUBLIC(void) xbt_dict_remove_ext(xbt_dict_t dict, const char *key,
                                      int key_len);
 
-
+#ifdef XBT_USE_DEPRECATED
 XBT_PUBLIC(void) xbt_dicti_set(xbt_dict_t dict, uintptr_t key,
                                uintptr_t data);
 XBT_PUBLIC(uintptr_t) xbt_dicti_get(xbt_dict_t dict, uintptr_t key);
 XBT_PUBLIC(void) xbt_dicti_remove(xbt_dict_t dict, uintptr_t key);
-
+#endif
 
 /** @} */
 /** @defgroup XBT_dict_curs Cursors on dictionaries
index 04f969d..ed59711 100644 (file)
@@ -495,6 +495,7 @@ XBT_INLINE void xbt_dict_remove(xbt_dict_t dict, const char *key)
   xbt_dict_remove_ext(dict, key, strlen(key));
 }
 
+#ifdef XBT_USE_DEPRECATED
 /**
  * \brief Add data to the dict (arbitrary key)
  * \param dict the container
@@ -529,7 +530,7 @@ XBT_INLINE void xbt_dicti_remove(xbt_dict_t dict, uintptr_t key)
 {
   xbt_dict_remove_ext(dict, (void *)&key, sizeof key);
 }
-
+#endif
 
 /**
  * \brief Remove all data from the dict
@@ -1123,6 +1124,7 @@ XBT_TEST_UNIT("nulldata", test_dict_nulldata, "NULL data management")
   xbt_dict_free(&head);
 }
 
+#ifdef XBT_USE_DEPRECATED
 static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data)
 {
   uintptr_t stored_data = 0;
@@ -1138,9 +1140,11 @@ static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data)
                    "Retrieved data (%zu) is not what I just stored (%zu) under key %zu",
                    stored_data, data, key);
 }
+#endif
 
 XBT_TEST_UNIT("dicti", test_dict_scalar, "Scalar data and key management")
 {
+#if XBT_USE_DEPRECATED
   xbt_test_add("Fill in the dictionnary");
 
   head = xbt_dict_new();
@@ -1163,6 +1167,7 @@ XBT_TEST_UNIT("dicti", test_dict_scalar, "Scalar data and key management")
   debuged_addi(head, 0, 0);
 
   xbt_dict_free(&head);
+#endif
 }
 
 #define NB_ELM 20000