mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Add const declarations to hash-table functions.
This commit is contained in:
parent
d0e36f1261
commit
b49e89e78a
@ -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
|
||||
|
10
src/hash.c
10
src/hash.c
@ -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;
|
||||
}
|
||||
|
@ -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 *));
|
||||
|
Loading…
Reference in New Issue
Block a user