]> granicus.if.org Git - graphviz/commitdiff
glcomp glCompPanelNew: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Sep 2022 00:45:07 +0000 (17:45 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 21 Sep 2022 00:17:10 +0000 (17:17 -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.

lib/glcomp/glcomppanel.c

index d8d20499e017e2d42eef0ad455654768630e244f..109677d24c1dd155cec57aa82186ee084c3a18cd 100644 (file)
@@ -8,18 +8,17 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#include <cgraph/alloc.h>
 #include <glcomp/glcomppanel.h>
 #include <glcomp/glcompfont.h>
 #include <glcomp/glcompset.h>
 #include <glcomp/glcomptexture.h>
 #include <glcomp/glutils.h>
-#include <common/memory.h>
 
 glCompPanel *glCompPanelNew(glCompObj * parentObj, GLfloat x, GLfloat y,
                            GLfloat w, GLfloat h)
 {
-    glCompPanel *p;
-    p = NEW(glCompPanel);
+    glCompPanel *p = gv_alloc(sizeof(glCompPanel));
     glCompInitCommon((glCompObj *) p, parentObj, x, y);
 
     p->shadowcolor.R = GLCOMPSET_PANEL_SHADOW_COLOR_R;