Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename functions xbt_dict_hash*() to xbt_str_hash().
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 12 Jun 2012 13:49:05 +0000 (15:49 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 12 Jun 2012 13:49:05 +0000 (15:49 +0200)
ChangeLog
include/xbt/str.h
src/surf/trace_mgr.c
src/xbt/dict.c

index 80e6ed1..3e4440a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,10 @@ SimGrid (3.8) NOT RELEASED; urgency=low
    seamlessly.
  * New function SD_workstation_dump to display various information
 
+ XBT:
+ * Functions xbt_dict_hash() and xbt_dict_hash_ext() are made public,
+  and renamed to xbt_str_hash() and xbt_str_ext()._
+
  -- $date Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
 
 SimGrid (3.7.1) stable; urgency=low
index 63a3826..865ea28 100644 (file)
@@ -55,7 +55,7 @@ XBT_PUBLIC(char *) xbt_str_from_file(FILE * file);
 /**
  * @brief Returns the hash code of a string.
  */
-static XBT_INLINE unsigned int xbt_dict_hash_ext(const char *str, int str_len)
+static XBT_INLINE unsigned int xbt_str_hash_ext(const char *str, int str_len)
 {
 
 #ifdef DJB2_HASH_FUNCTION
@@ -97,7 +97,7 @@ static XBT_INLINE unsigned int xbt_dict_hash_ext(const char *str, int str_len)
 /**
  * @brief Returns the hash code of a string.
  */
-static XBT_INLINE unsigned int xbt_dict_hash(const char *str)
+static XBT_INLINE unsigned int xbt_str_hash(const char *str)
 {
 #ifdef DJB2_HASH_FUNCTION
   /* fast implementation of djb2 algorithm */
index 6367757..67b7468 100644 (file)
@@ -47,7 +47,7 @@ tmgr_trace_t tmgr_trace_new_from_generator(const char *id,
   RngStream rng_stream = NULL;
   
   rng_stream = RngStream_CopyStream(common_rng_stream);
-  id_hash = xbt_dict_hash(id);
+  id_hash = xbt_str_hash(id);
   RngStream_AdvanceState(rng_stream, 0, id_hash);
   
   trace = xbt_new0(s_tmgr_trace_t, 1);
index 06be987..b844cb4 100644 (file)
@@ -166,7 +166,7 @@ XBT_INLINE void xbt_dict_set_ext(xbt_dict_t dict,
                                  void *data, void_f_pvoid_t free_ctn)
 {
 
-  unsigned int hash_code = xbt_dict_hash_ext(key, key_len);
+  unsigned int hash_code = xbt_str_hash_ext(key, key_len);
 
   xbt_dictelm_t current, previous = NULL;
   xbt_assert(dict);
@@ -237,7 +237,7 @@ XBT_INLINE void *xbt_dict_get_ext(xbt_dict_t dict, const char *key,
 {
 
 
-  unsigned int hash_code = xbt_dict_hash_ext(key, key_len);
+  unsigned int hash_code = xbt_str_hash_ext(key, key_len);
   xbt_dictelm_t current;
 
   xbt_assert(dict);
@@ -262,7 +262,7 @@ void *xbt_dict_get_or_null_ext(xbt_dict_t dict, const char *key,
                                int key_len)
 {
 
-  unsigned int hash_code = xbt_dict_hash_ext(key, key_len);
+  unsigned int hash_code = xbt_str_hash_ext(key, key_len);
   xbt_dictelm_t current;
 
   xbt_assert(dict);
@@ -317,7 +317,7 @@ char *xbt_dict_get_key(xbt_dict_t dict, const void *data)
 XBT_INLINE void *xbt_dict_get(xbt_dict_t dict, const char *key)
 {
 
-  unsigned int hash_code = xbt_dict_hash(key);
+  unsigned int hash_code = xbt_str_hash(key);
   xbt_dictelm_t current;
 
   xbt_assert(dict);
@@ -338,7 +338,7 @@ XBT_INLINE void *xbt_dict_get(xbt_dict_t dict, const char *key)
  */
 XBT_INLINE void *xbt_dict_get_or_null(xbt_dict_t dict, const char *key)
 {
-  unsigned int hash_code = xbt_dict_hash(key);
+  unsigned int hash_code = xbt_str_hash(key);
   xbt_dictelm_t current;
 
   xbt_assert(dict);
@@ -369,7 +369,7 @@ XBT_INLINE void xbt_dict_remove_ext(xbt_dict_t dict, const char *key,
 {
 
 
-  unsigned int hash_code = xbt_dict_hash_ext(key, key_len);
+  unsigned int hash_code = xbt_str_hash_ext(key, key_len);
   xbt_dictelm_t current, previous = NULL;
 
   xbt_assert(dict);