diff options
author | Tom Tromey <tom@tromey.com> | 2021-05-08 07:50:47 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-05-08 07:50:47 -0600 |
commit | 65a9835b29386b6ebccfff059efb4d5cd95beeaf (patch) | |
tree | 64f0089ff3bd7c619358bdd018fa26790f6f90d5 /sim/common | |
parent | 4655f8509fd44e6efabefa373650d9982ff37fd6 (diff) | |
download | gdb-65a9835b29386b6ebccfff059efb4d5cd95beeaf.zip gdb-65a9835b29386b6ebccfff059efb4d5cd95beeaf.tar.gz gdb-65a9835b29386b6ebccfff059efb4d5cd95beeaf.tar.bz2 |
sim: use htab_eq_string
This changes the sim to use htab_eq_string from libiberty.
sim/common/ChangeLog
2021-05-08 Tom Tromey <tom@tromey.com>
* sim-options.c (compare_strings): Remove.
(dup_arg_p): Use htab_eq_string.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 5 | ||||
-rw-r--r-- | sim/common/sim-options.c | 10 |
2 files changed, 6 insertions, 9 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index d96faee..1f978a7 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +2021-05-08 Tom Tromey <tom@tromey.com> + + * sim-options.c (compare_strings): Remove. + (dup_arg_p): Use htab_eq_string. + 2021-05-04 Mike Frysinger <vapier@gentoo.org> * sim-hw.c (sim_hw_install): Rename to ... diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index 1efb21f..ff325e6 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -416,14 +416,6 @@ standard_install (SIM_DESC sd) return SIM_RC_OK; } -/* Equality function for arguments. */ - -static int -compare_strings (const void *a, const void *b) -{ - return strcmp (a, b) == 0; -} - /* Return non-zero if arg is a duplicate argument. If ARG is NULL, initialize. */ @@ -437,7 +429,7 @@ dup_arg_p (const char *arg) { if (arg_table == NULL) arg_table = htab_create_alloc (10, htab_hash_string, - compare_strings, NULL, + htab_eq_string, NULL, xcalloc, free); htab_empty (arg_table); return 0; |