From: Mark Stapp Date: Thu, 4 Apr 2019 14:54:10 +0000 (-0400) Subject: libs: use const in copy_nexthops api X-Git-Tag: 7.1_pulled~102^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=deff170e8b363f4f746b7fc9c652ca27f4dd0961;p=mirror%2Ffrr.git libs: use const in copy_nexthops api Use const for the source arg to copy_nexthops(). Signed-off-by: Mark Stapp --- diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c index dbc3337785..5fb4ea5234 100644 --- a/lib/nexthop_group.c +++ b/lib/nexthop_group.c @@ -118,11 +118,11 @@ void nexthop_del(struct nexthop_group *nhg, struct nexthop *nh) nh->next = NULL; } -void copy_nexthops(struct nexthop **tnh, struct nexthop *nh, +void copy_nexthops(struct nexthop **tnh, const struct nexthop *nh, struct nexthop *rparent) { struct nexthop *nexthop; - struct nexthop *nh1; + const struct nexthop *nh1; for (nh1 = nh; nh1; nh1 = nh1->next) { nexthop = nexthop_new(); diff --git a/lib/nexthop_group.h b/lib/nexthop_group.h index c6e290eeea..d96d0ab9f5 100644 --- a/lib/nexthop_group.h +++ b/lib/nexthop_group.h @@ -44,7 +44,7 @@ void nexthop_group_delete(struct nexthop_group **nhg); void nexthop_add(struct nexthop **target, struct nexthop *nexthop); void nexthop_del(struct nexthop_group *nhg, struct nexthop *nexthop); -void copy_nexthops(struct nexthop **tnh, struct nexthop *nh, +void copy_nexthops(struct nexthop **tnh, const struct nexthop *nh, struct nexthop *rparent); /* The following for loop allows to iterate over the nexthop