]> granicus.if.org Git - graphviz/commitdiff
common arrow_match_name_frag: take 'arrownames' parameter as const
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 8 Oct 2022 22:25:01 +0000 (15:25 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 12 Oct 2022 14:51:43 +0000 (07:51 -0700)
lib/common/arrows.c

index a13bc5f19e380c82f6db847a0f878c19e1b1890f..6cd76fda8eefd238cd497f1162ba0f24c2aff7b8 100644 (file)
@@ -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;