From: Matthew Fernandez Date: Fri, 2 Sep 2022 01:54:37 +0000 (-0700) Subject: smyrna main: use cgraph wrapper for allocations X-Git-Tag: 6.0.1~13^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d39a8bba2ea769ffc939549eb911c219fce844d;p=graphviz smyrna main: use cgraph wrapper for allocations 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. --- diff --git a/cmd/smyrna/main.c b/cmd/smyrna/main.c index be908ba13..1196c3a0d 100644 --- a/cmd/smyrna/main.c +++ b/cmd/smyrna/main.c @@ -26,7 +26,6 @@ #include "gltemplate.h" #include #include -#include #include "gvprpipe.h" #include "frmobjectui.h" #ifdef ENABLE_NLS @@ -212,7 +211,7 @@ int main(int argc, char *argv[]) } *s = '\0'; - smyrnaDir = N_NEW(strlen(line)+sizeof(SMYRNA), char); + smyrnaDir = gv_calloc(strlen(line) + sizeof(SMYRNA), sizeof(char)); strcpy (smyrnaDir, line); strcat(smyrnaDir, SMYRNA); #else @@ -236,7 +235,7 @@ int main(int argc, char *argv[]) bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); #endif - view = NEW(ViewInfo); + view = gv_alloc(sizeof(ViewInfo)); init_viewport(view); view->initFileName = parseArgs(argc, argv, view); if(view->initFileName)