From: Matthew Fernandez Date: Thu, 14 Apr 2022 00:19:15 +0000 (-0700) Subject: gvpack: take const values in various functions that call 'agattr' X-Git-Tag: 4.0.0~67^2~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17ce8286c6199146b7884bd266556b05bf4c07ed;p=graphviz gvpack: take const values in various functions that call 'agattr' This pre-emptively squashes several upcoming warnings when converting this file to C++ which otherwise fail the CMake build: cmd/tools/gvpack.cpp:181:22: error: ISO C++11 does not allow conversion from string literal to 'char *' [-Werror,-Wwritable-strings] Gitlab: #2154 --- diff --git a/cmd/tools/gvpack.c b/cmd/tools/gvpack.c index ecb351813..c7d8241ef 100644 --- a/cmd/tools/gvpack.c +++ b/cmd/tools/gvpack.c @@ -155,18 +155,15 @@ static int setUInt(unsigned int *v, char *arg) return 0; } -static Agsym_t *agraphattr(Agraph_t *g, char *name, char *value) -{ +static Agsym_t *agraphattr(Agraph_t *g, char *name, const char *value) { return agattr(g, AGRAPH, name, value); } -static Agsym_t *agnodeattr(Agraph_t *g, char *name, char *value) -{ +static Agsym_t *agnodeattr(Agraph_t *g, char *name, const char *value) { return agattr(g, AGNODE, name, value); } -static Agsym_t *agedgeattr(Agraph_t *g, char *name, char *value) -{ +static Agsym_t *agedgeattr(Agraph_t *g, char *name, const char *value) { return agattr(g, AGEDGE, name, value); } @@ -463,7 +460,7 @@ static void fillDict(Dt_t * newdict, Agraph_t* g, int kind) */ static void fillGraph(Agraph_t * g, Dt_t * d, - Agsym_t * (*setf) (Agraph_t *, char *, char *), int cnt) + Agsym_t * (*setf) (Agraph_t *, char *, const char *), int cnt) { attr_t *av; for (av = (attr_t *) dtflatten(d); av;