]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libiberty/hashtab: More const parameters
authorAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 27 Jan 2020 22:06:35 +0000 (22:06 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 5 Feb 2020 13:01:06 +0000 (13:01 +0000)
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.

include/ChangeLog
include/hashtab.h
libiberty/ChangeLog
libiberty/hashtab.c

index 8a2feb911cbb1c76220774267afdfd3c28271cee..3f9382d9ad4c402ac32fdbaa9f85788323bd31cc 100644 (file)
@@ -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.
index d94b54c3c41e287b4ae623a8da92ac973fc666a1..6cca342b98973320086b58734aac922b1eeab617 100644 (file)
@@ -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 *);
index 17903ea1be5313388324dd50b94f37f6018829cc..b3ec2314d89a5a2dcb8d4d25656f0b4f382c271d 100644 (file)
@@ -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 "".
index 26c98ce2d6865939d0f9c723cac23bd8efeb8b40..225e9e540a7d2877289cec0a36d2011f233e1ea5 100644 (file)
@@ -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;