From: Matthew Fernandez Date: Sat, 19 Nov 2022 23:18:26 +0000 (-0800) Subject: neatogen: mark 'adjustMode' const X-Git-Tag: 7.0.3~1^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17588c3fe33a5e7d5226801047d560555a535a0b;p=graphviz neatogen: mark 'adjustMode' const This makes it more obvious to the compiler it can e.g. unroll and inline loops involving this array. --- diff --git a/lib/neatogen/adjust.c b/lib/neatogen/adjust.c index 3f54ee484..79a50fe52 100644 --- a/lib/neatogen/adjust.c +++ b/lib/neatogen/adjust.c @@ -936,7 +936,7 @@ typedef struct { * adjustMode[0] corresponds to overlap=true * adjustMode[1] corresponds to overlap=false */ -static lookup_t adjustMode[] = { +static const lookup_t adjustMode[] = { ITEM(AM_NONE, "", "none"), #if ((defined(HAVE_GTS) || defined(HAVE_TRIANGLE)) && defined(SFDP)) ITEM(AM_PRISM, "prism", "prism"), @@ -984,7 +984,7 @@ setPrismValues (Agraph_t* g, char* s, adjust_data* dp) */ static adjust_data *getAdjustMode(Agraph_t* g, char *s, adjust_data* dp) { - lookup_t *ap = adjustMode + 1; + const lookup_t *ap = adjustMode + 1; if (s == NULL || *s == '\0') { dp->mode = adjustMode[0].mode; dp->print = adjustMode[0].print;