From d07506ed1963277f3b366d979f9a530ffa6caba9 Mon Sep 17 00:00:00 2001 From: erg Date: Fri, 10 Jul 2009 16:09:03 +0000 Subject: [PATCH] Remove added #include and use forward declaration to move free_attr to the procedures section --- cmd/tools/gmlparse.y | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/tools/gmlparse.y b/cmd/tools/gmlparse.y index e78b15f57..5b4f330b1 100644 --- a/cmd/tools/gmlparse.y +++ b/cmd/tools/gmlparse.y @@ -22,8 +22,6 @@ #include #include -#include "gmlparse.h" - #define NEW(t) (t*)malloc(sizeof(t)) #define N_NEW(n,t) (t*)malloc((n)*sizeof(t)) #define RALLOC(size,ptr,type) ((type*)realloc(ptr,(size)*sizeof(type))) @@ -37,6 +35,8 @@ static Dt_t* L; static Dt_t** liststk; static int liststk_sz, liststk_cnt; +static void free_attr (Dt_t*d, gmlattr* p, Dtdisc_t* ds); /* forward decl */ + static void free_node (Dt_t*d, gmlnode* p, Dtdisc_t* ds) { @@ -53,18 +53,6 @@ free_edge (Dt_t*d, gmledge* p, Dtdisc_t* ds) free (p); } -static void -free_attr (Dt_t*d, gmlattr* p, Dtdisc_t* ds) -{ - if (!p) return; - if (p->kind == LIST) - dtclose (p->u.lp); - else - free (p->u.value); - free (p->name); - free (p); -} - static void free_graph (Dt_t*d, gmlgraph* p, Dtdisc_t* ds) { @@ -400,6 +388,18 @@ alistitem : NAME INTEGER { $$ = mkAttr ($1, 0, INTEGER, $2, 0); } %% +static void +free_attr (Dt_t*d, gmlattr* p, Dtdisc_t* ds) +{ + if (!p) return; + if (p->kind == LIST) + dtclose (p->u.lp); + else + free (p->u.value); + free (p->name); + free (p); +} + static void deparseList (Dt_t* alist, agxbuf* xb); /* forward declaration */ static void -- 2.40.0