diff options
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r-- | gcc/attribs.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c index 5ac72f7..feb1c30 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -87,8 +87,8 @@ substring_hash (const char *str, int l) static hashval_t hash_attr (const void *p) { - struct attribute_spec *spec = (struct attribute_spec *) p; - int l = strlen (spec->name); + const struct attribute_spec *const spec = (const struct attribute_spec *) p; + const int l = strlen (spec->name); return substring_hash (spec->name, l); } @@ -98,8 +98,8 @@ hash_attr (const void *p) static int eq_attr (const void *p, const void *q) { - const struct attribute_spec *spec = (struct attribute_spec *) p; - const struct substring *str = (struct substring *) q; + const struct attribute_spec *const spec = (const struct attribute_spec *) p; + const struct substring *const str = (const struct substring *) q; return (!strncmp (spec->name, str->str, str->length) && !spec->name[str->length]); } @@ -183,15 +183,15 @@ init_attributes (void) for (k = 0; attribute_tables[i][k].name != NULL; k++) { struct substring str; - void **slot; + const void **slot; str.str = attribute_tables[i][k].name; str.length = strlen (attribute_tables[i][k].name); - slot = htab_find_slot_with_hash (attribute_hash, &str, + slot = (const void **)htab_find_slot_with_hash (attribute_hash, &str, substring_hash (str.str, str.length), INSERT); gcc_assert (!*slot); - *slot = (void *)&attribute_tables[i][k]; + *slot = &attribute_tables[i][k]; } attributes_initialized = true; } |