From: Nicola Pero Date: Tue, 19 Apr 2011 09:14:48 +0000 (+0000) Subject: In gcc/: 2011-04-19 Nicola Pero X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=897e0a890fe6e35fb53f3f6185e9167e113fd102;p=gcc.git In gcc/: 2011-04-19 Nicola Pero In gcc/: 2011-04-19 Nicola Pero * gengtype-state.c (string_eq): New. (read_state): Use string_eq instead of strcmp when creating the state_ident_tab. From-SVN: r172702 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2ce7bb77e0b..0db250d1261 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-04-19 Nicola Pero + + * gengtype-state.c (string_eq): New. + (read_state): Use string_eq instead of strcmp when creating the + state_ident_tab. + 2011-04-19 Wei Guozhi PR target/47855 diff --git a/gcc/gengtype-state.c b/gcc/gengtype-state.c index 07c880258a6..fbfb35a54b2 100644 --- a/gcc/gengtype-state.c +++ b/gcc/gengtype-state.c @@ -2385,6 +2385,15 @@ 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 @@ -2408,7 +2417,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, (htab_eq) strcmp, NULL); + htab_create (4027, htab_hash_string, string_eq, NULL); read_state_version (version_string); read_state_srcdir (); read_state_languages ();