]> granicus.if.org Git - graphviz/commitdiff
agsafeset: take const pointers for 'value' and 'def' arguments
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 15 Aug 2021 19:31:18 +0000 (12:31 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 19 Aug 2021 02:45:11 +0000 (19:45 -0700)
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.

lib/cgraph/attr.c
lib/cgraph/cgraph.h

index 331183ecfe2a9e39aca96d6a007cf66e9c692601..6a3de88dbc44c33996760b7c24667dc1db741e62 100644 (file)
@@ -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);
index 96977b04a52acee5a1ffb74dc8c22a655e0e18a0..4ad5761e963f0e32b9d1ca5c7894494bc3f51dce 100644 (file)
@@ -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 */