]> sjero.net Git - wget/commitdiff
[svn] Add const declarations to hash-table functions.
authorhniksic <devnull@localhost>
Thu, 9 Oct 2003 13:32:28 +0000 (06:32 -0700)
committerhniksic <devnull@localhost>
Thu, 9 Oct 2003 13:32:28 +0000 (06:32 -0700)
src/ChangeLog
src/hash.c
src/hash.h

index 2e13ab9caadbd25ef2180c9e2c69614dcc46155a..e6fb559dcfd9b384d3e195bfd5347843c52f29ff 100644 (file)
@@ -1,3 +1,11 @@
+2003-10-09  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * hash.c (hash_table_get): Declare hash-table argument as const.
+       (find_mapping): Ditto.
+       (hash_table_get_pair): Ditto.
+       (hash_table_contains): Ditto.
+       (hash_table_count): Ditto.
+
 2003-10-08  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * html-url.c (get_urls_html): Parse the appropriate flags to
index 6373895f7ab13bb7d8dd871ff8a51bdbbd7ffea1..2925625f4b80e1f03306578871d7350a6024ed5c 100644 (file)
@@ -272,7 +272,7 @@ hash_table_destroy (struct hash_table *ht)
    mapping that matches KEY, or NULL if none matches.  */
 
 static inline struct mapping *
-find_mapping (struct hash_table *ht, const void *key)
+find_mapping (const struct hash_table *ht, const void *key)
 {
   struct mapping *mappings = ht->mappings;
   int size = ht->size;
@@ -293,7 +293,7 @@ find_mapping (struct hash_table *ht, const void *key)
    function.  */
 
 void *
-hash_table_get (struct hash_table *ht, const void *key)
+hash_table_get (const struct hash_table *ht, const void *key)
 {
   struct mapping *mp = find_mapping (ht, key);
   if (mp)
@@ -306,7 +306,7 @@ hash_table_get (struct hash_table *ht, const void *key)
    value.  Returns non-zero on success.  */
 
 int
-hash_table_get_pair (struct hash_table *ht, const void *lookup_key,
+hash_table_get_pair (const struct hash_table *ht, const void *lookup_key,
                     void *orig_key, void *value)
 {
   struct mapping *mp = find_mapping (ht, lookup_key);
@@ -326,7 +326,7 @@ hash_table_get_pair (struct hash_table *ht, const void *lookup_key,
 /* Return 1 if HT contains KEY, 0 otherwise. */
 
 int
-hash_table_contains (struct hash_table *ht, const void *key)
+hash_table_contains (const struct hash_table *ht, const void *key)
 {
   return find_mapping (ht, key) != NULL;
 }
@@ -494,7 +494,7 @@ hash_table_map (struct hash_table *ht,
    greater than the number of elements.  */
 
 int
-hash_table_count (struct hash_table *ht)
+hash_table_count (const struct hash_table *ht)
 {
   return ht->count;
 }
index 1e013da05ead14d1f69ba7e6131ffd6a3c277f2e..a9b9aca22e36562918fb837f0226c796c3028140 100644 (file)
@@ -50,10 +50,10 @@ struct hash_table *hash_table_new PARAMS ((int,
                                                    const void *)));
 void hash_table_destroy PARAMS ((struct hash_table *));
 
-void *hash_table_get PARAMS ((struct hash_table *, const void *));
-int hash_table_get_pair PARAMS ((struct hash_table *, const void *,
+void *hash_table_get PARAMS ((const struct hash_table *, const void *));
+int hash_table_get_pair PARAMS ((const struct hash_table *, const void *,
                                 void *, void *));
-int hash_table_contains PARAMS ((struct hash_table *, const void *));
+int hash_table_contains PARAMS ((const struct hash_table *, const void *));
 
 void hash_table_put PARAMS ((struct hash_table *, const void *, void *));
 int hash_table_remove PARAMS ((struct hash_table *, const void *));
@@ -62,7 +62,7 @@ void hash_table_clear PARAMS ((struct hash_table *));
 void hash_table_map PARAMS ((struct hash_table *,
                             int (*) (void *, void *, void *),
                             void *));
-int hash_table_count PARAMS ((struct hash_table *));
+int hash_table_count PARAMS ((const struct hash_table *));
 
 unsigned long string_hash PARAMS ((const void *));
 int string_cmp PARAMS ((const void *, const void *));