From: Matthew Fernandez Date: Sun, 15 Aug 2021 19:31:18 +0000 (-0700) Subject: agsafeset: take const pointers for 'value' and 'def' arguments X-Git-Tag: 2.49.0~15^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0490586e2e7c62fc032ad75d3933e1a03bbb96f;p=graphviz agsafeset: take const pointers for 'value' and 'def' arguments Neither of these are modified by this function. Closes #634. I believe this is the last Cgraph function currently able to receive a modification like this. --- diff --git a/lib/cgraph/attr.c b/lib/cgraph/attr.c index 331183ecf..6a3de88db 100644 --- a/lib/cgraph/attr.c +++ b/lib/cgraph/attr.c @@ -488,8 +488,7 @@ int agxset(void *obj, Agsym_t * sym, const char *value) return SUCCESS; } -int agsafeset(void *obj, char *name, char *value, char *def) -{ +int agsafeset(void *obj, char *name, const char *value, const char *def) { Agsym_t *a; a = agattr(agraphof(obj), AGTYPE(obj), name, 0); diff --git a/lib/cgraph/cgraph.h b/lib/cgraph/cgraph.h index 96977b04a..4ad5761e9 100644 --- a/lib/cgraph/cgraph.h +++ b/lib/cgraph/cgraph.h @@ -353,7 +353,8 @@ CGRAPH_API char *agget(void *obj, char *name); CGRAPH_API char *agxget(void *obj, Agsym_t * sym); CGRAPH_API int agset(void *obj, char *name, const char *value); CGRAPH_API int agxset(void *obj, Agsym_t * sym, const char *value); -CGRAPH_API int agsafeset(void* obj, char* name, char* value, char* def); +CGRAPH_API int agsafeset(void* obj, char* name, const char* value, + const char* def); /* definitions for subgraphs */ CGRAPH_API Agraph_t *agsubg(Agraph_t * g, char *name, int cflag); /* constructor */