From: Matthew Fernandez Date: Sat, 17 Sep 2022 00:18:25 +0000 (-0700) Subject: glcomp glCompButtonNew: use cgraph wrapper for allocation X-Git-Tag: 6.0.2~33^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64fcc3c7279476cff110f4890d58ed6b44795e10;p=graphviz glcomp glCompButtonNew: use cgraph wrapper for allocation 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/lib/glcomp/glcompbutton.c b/lib/glcomp/glcompbutton.c index 8a22a0d7d..4bfa2a968 100644 --- a/lib/glcomp/glcompbutton.c +++ b/lib/glcomp/glcompbutton.c @@ -8,13 +8,13 @@ * Contributors: Details at https://graphviz.org *************************************************************************/ +#include #include #include #include #include #include #include -#include #include #include #include @@ -23,8 +23,7 @@ glCompButton *glCompButtonNew(glCompObj * par, GLfloat x, GLfloat y, GLfloat w, GLfloat h, char *caption) { - glCompButton *p; - p = NEW(glCompButton); + glCompButton *p = gv_alloc(sizeof(glCompButton)); glCompInitCommon((glCompObj *) p, par, x, y); p->objType = glButtonObj; /*customize button color */