From: Matthew Fernandez Date: Sat, 8 Oct 2022 22:25:01 +0000 (-0700) Subject: common arrow_match_name_frag: take 'arrownames' parameter as const X-Git-Tag: 7.0.0~15^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c81519b195c64d52ea84223136f5650fc4fb02cf;p=graphviz common arrow_match_name_frag: take 'arrownames' parameter as const --- diff --git a/lib/common/arrows.c b/lib/common/arrows.c index a13bc5f19..6cd76fda8 100644 --- a/lib/common/arrows.c +++ b/lib/common/arrows.c @@ -139,13 +139,13 @@ static const arrowtype_t Arrowtypes[] = { static const size_t Arrowtypes_size = sizeof(Arrowtypes) / sizeof(Arrowtypes[0]); -static char *arrow_match_name_frag(char *name, arrowname_t * arrownames, int *flag) -{ - arrowname_t *arrowname; +static char *arrow_match_name_frag(char *name, const arrowname_t *arrownames, + int *flag) { size_t namelen = 0; char *rest = name; - for (arrowname = arrownames; arrowname->name; arrowname++) { + for (const arrowname_t *arrowname = arrownames; arrowname->name; + arrowname++) { namelen = strlen(arrowname->name); if (strncmp(name, arrowname->name, namelen) == 0) { *flag |= arrowname->type;