From 17ce8286c6199146b7884bd266556b05bf4c07ed Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 13 Apr 2022 17:19:15 -0700 Subject: [PATCH] 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 --- cmd/tools/gvpack.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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; -- 2.40.0