]> granicus.if.org Git - graphviz/commitdiff
core plugin: make 'IS_CLUSTER' macro a function
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 27 Sep 2022 15:23:27 +0000 (08:23 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 28 Sep 2022 14:57:12 +0000 (07:57 -0700)
This improves type safety, while still being inline-able by the compiler.

plugin/core/gvrender_core_json.c

index 7b75a4f2b6a7b1ef39ec33b59da19df187071105..e25810d533bded79dbd93d57e8537f55e9f86b63 100644 (file)
@@ -58,7 +58,9 @@ typedef struct {
 #define ED_gid(n) (((gvid_t*)aggetrec(n, ID, FALSE))->id) 
 #define GD_gid(n) (((gvid_t*)aggetrec(n, ID, FALSE))->id) 
 
-#define IS_CLUSTER(s) startswith(agnameof(s), "cluster")
+static bool IS_CLUSTER(Agraph_t *s) {
+  return startswith(agnameof(s), "cluster");
+}
 
 static void json_begin_graph(GVJ_t *job)
 {