]> granicus.if.org Git - graphviz/commitdiff
smyrna add_column: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 00:47:46 +0000 (17:47 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 2 Sep 2022 00:47:46 +0000 (17:47 -0700)
The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h
wrappers except (1) they are header-only and (2) they live in a directory
(cgraph) that is at the root of the dependency tree. The long term plan is to
replace all use of lib/common/memory.h with lib/cgraph/alloc.h.

cmd/smyrna/tvnodes.c

index ad7fbc0be298894c72ff2b0ddcd4c3f0b52adb19..ac9e9fa8299d0c01fd0a4e0d37f2d36633390fcb 100644 (file)
@@ -312,7 +312,7 @@ static void add_column(grid * g, char *name, bool editable, GType g_type)
        return;
     g->columns = gv_recalloc(g->columns, g->count, g->count + 1,
                              sizeof(gridCol*));
-    g->columns[g->count] = NEW(gridCol);
+    g->columns[g->count] = gv_alloc(sizeof(gridCol));
     g->columns[g->count]->editable = editable;
     g->columns[g->count]->name = name;
     g->columns[g->count]->type = g_type;