diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-14 20:19:07 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-14 21:23:08 +0000 |
| commit | d8b87afe7c5fcee9caaef7124d5bcd5f0c3af8a1 (patch) | |
| tree | ca07ea6097ec12120806ff4c7bd268b9fc063842 /lib/routemap.c | |
| parent | ab78033d65dfcdbd5d1fe952193fc302b9843724 (diff) | |
lib: hashing functions should take const arguments
It doesn't make much sense for a hash function to modify its argument,
so const the hash input.
BGP does it in a couple places, those cast away the const. Not great but
not any worse than it was.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/routemap.c')
| -rw-r--r-- | lib/routemap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/routemap.c b/lib/routemap.c index 0c75be3323..9133b80895 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -623,7 +623,7 @@ struct route_map_list { static struct route_map_list route_map_master = {NULL, NULL, NULL, NULL, NULL}; struct hash *route_map_master_hash = NULL; -static unsigned int route_map_hash_key_make(void *p) +static unsigned int route_map_hash_key_make(const void *p) { const struct route_map *map = p; return string_hash_make(map->name); @@ -673,7 +673,7 @@ struct route_map_dep { /* Hashes maintaining dependency between various sublists used by route maps */ struct hash *route_map_dep_hash[ROUTE_MAP_DEP_MAX]; -static unsigned int route_map_dep_hash_make_key(void *p); +static unsigned int route_map_dep_hash_make_key(const void *p); static void route_map_clear_all_references(char *rmap_name); static void route_map_rule_delete(struct route_map_rule_list *, struct route_map_rule *); @@ -1709,7 +1709,7 @@ static void *route_map_name_hash_alloc(void *p) return ((void *)XSTRDUP(MTYPE_ROUTE_MAP_NAME, (const char *)p)); } -static unsigned int route_map_dep_hash_make_key(void *p) +static unsigned int route_map_dep_hash_make_key(const void *p) { return (string_hash_make((char *)p)); } |
