summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-01-27 22:06:35 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-02-05 13:01:06 +0000
commit5f44a4341cf9793ccfb28cb0ab6876174c0d89dc (patch)
tree75893f12090c9b7a04a2e0535516f3ebda4165e2
parenta2155f7dd3d8d031607036d40b0fa32f0cb8da52 (diff)
libiberty/hashtab: More const parameters
Makes some parameters const in libiberty's hashtab library. include/ChangeLog: * hashtab.h (htab_remove_elt): Make a parameter const. (htab_remove_elt_with_hash): Likewise. libiberty/ChangeLog: * hashtab.c (htab_remove_elt): Make a parameter const. (htab_remove_elt_with_hash): Likewise.
-rw-r--r--include/ChangeLog5
-rw-r--r--include/hashtab.h4
-rw-r--r--libiberty/ChangeLog5
-rw-r--r--libiberty/hashtab.c4
4 files changed, 14 insertions, 4 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 8a2feb911cb..3f9382d9ad4 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-05 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * hashtab.h (htab_remove_elt): Make a parameter const.
+ (htab_remove_elt_with_hash): Likewise.
+
2020-01-10 Thomas Schwinge <thomas@codesourcery.com>
* gomp-constants.h (enum gomp_device_property): Remove.
diff --git a/include/hashtab.h b/include/hashtab.h
index d94b54c3c41..6cca342b989 100644
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -173,8 +173,8 @@ extern void * htab_find_with_hash (htab_t, const void *, hashval_t);
extern void ** htab_find_slot_with_hash (htab_t, const void *,
hashval_t, enum insert_option);
extern void htab_clear_slot (htab_t, void **);
-extern void htab_remove_elt (htab_t, void *);
-extern void htab_remove_elt_with_hash (htab_t, void *, hashval_t);
+extern void htab_remove_elt (htab_t, const void *);
+extern void htab_remove_elt_with_hash (htab_t, const void *, hashval_t);
extern void htab_traverse (htab_t, htab_trav, void *);
extern void htab_traverse_noresize (htab_t, htab_trav, void *);
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 17903ea1be5..b3ec2314d89 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-05 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * hashtab.c (htab_remove_elt): Make a parameter const.
+ (htab_remove_elt_with_hash): Likewise.
+
2020-01-23 Alexandre Oliva <oliva@adacore.com>
* argv.c (writeargv): Output empty args as "".
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index 26c98ce2d68..225e9e540a7 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -709,7 +709,7 @@ htab_find_slot (htab_t htab, const PTR element, enum insert_option insert)
element in the hash table, this function does nothing. */
void
-htab_remove_elt (htab_t htab, PTR element)
+htab_remove_elt (htab_t htab, const PTR element)
{
htab_remove_elt_with_hash (htab, element, (*htab->hash_f) (element));
}
@@ -720,7 +720,7 @@ htab_remove_elt (htab_t htab, PTR element)
function does nothing. */
void
-htab_remove_elt_with_hash (htab_t htab, PTR element, hashval_t hash)
+htab_remove_elt_with_hash (htab_t htab, const PTR element, hashval_t hash)
{
PTR *slot;