]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc: use htab_eq_string
authorTom Tromey <tom@tromey.com>
Thu, 29 Apr 2021 00:46:44 +0000 (18:46 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 6 May 2021 14:51:28 +0000 (08:51 -0600)
This changes one spot in GCC to use the new htab_eq_string function.

gcc

* gengtype-state.c (read_state): Use htab_eq_string.
(string_eq): Remove.

gcc/gengtype-state.c

index 891f2e18a610c0db10c9e904882724568696f877..a8fde959f4eb4309ec8c2a803b49dd1b2f6ff437 100644 (file)
@@ -2556,15 +2556,6 @@ equals_type_number (const void *ty1, const void *ty2)
   return type1->state_number == type2->state_number;
 }
 
-static int
-string_eq (const void *a, const void *b)
-{
-  const char *a0 = (const char *)a;
-  const char *b0 = (const char *)b;
-
-  return (strcmp (a0, b0) == 0);
-}
-
 
 /* The function reading the state, called by main from gengtype.c.  */
 void
@@ -2588,7 +2579,7 @@ read_state (const char *path)
   state_seen_types =
     htab_create (2017, hash_type_number, equals_type_number, NULL);
   state_ident_tab =
-    htab_create (4027, htab_hash_string, string_eq, NULL);
+    htab_create (4027, htab_hash_string, htab_eq_string, NULL);
   read_state_version (version_string);
   read_state_srcdir ();
   read_state_languages ();