From b1d4df3ac310fc152f4ee24b610efaf89748a46c Mon Sep 17 00:00:00 2001 From: erg Date: Mon, 12 Jul 2010 13:46:36 +0000 Subject: [PATCH] Remove use of btree.h --- cmd/smyrna/Makefile.am | 2 +- cmd/smyrna/tvnodes.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/smyrna/Makefile.am b/cmd/smyrna/Makefile.am index c8a5d2d48..9a0706169 100644 --- a/cmd/smyrna/Makefile.am +++ b/cmd/smyrna/Makefile.am @@ -35,7 +35,7 @@ bin_PROGRAMS += smyrna_static endif endif -noinst_HEADERS = arcball.h draw.h glexpose.h btree.h \ +noinst_HEADERS = arcball.h draw.h glexpose.h \ glmotion.h gltemplate.h gui/appmouse.h gui/callbacks.h \ hotkeymap.h materials.h md5.h polytess.h selectionfuncs.h \ smyrna_utils.h smyrnadefs.h support.h topfisheyeview.h \ diff --git a/cmd/smyrna/tvnodes.c b/cmd/smyrna/tvnodes.c index 8d89c6d64..f6730580b 100755 --- a/cmd/smyrna/tvnodes.c +++ b/cmd/smyrna/tvnodes.c @@ -14,9 +14,7 @@ * AT&T Research, Florham Park NJ * **********************************************************/ -/* #include "topview.h" */ #include "tvnodes.h" -#include "btree.h" #include "viewport.h" #include "topviewfuncs.h" #include "memory.h" @@ -320,7 +318,7 @@ static void add_column(grid* g,char* name,int editable,GType g_type) static void clear_grid(grid* g, char* flds) { - int id=0; + int id; if (g->count) { for (id=0;id < g->count ; id++) { free(g->columns[id]->name); @@ -328,6 +326,7 @@ static void clear_grid(grid* g, char* flds) } } free (g->columns); + g->count = 0; g->columns = 0; g->flds=flds; } @@ -341,9 +340,9 @@ static grid* initGrid(char* flds) return gr; } -static grid* update_colums(grid* g,char* str) +static grid* update_columns(grid* g,char* str) { - /*free memory for existing c*/ + /*free existing memory if necessary */ char* a; if(g) { if (g->flds != str) clear_grid(g, str); @@ -375,7 +374,7 @@ void setup_tree (Agraph_t* g) static grid* gr; char* buf = agget(g,"datacolumns"); - gr = update_colums(gr,buf); + gr = update_columns(gr,buf); tree=update_tree (tree,gr); populate_data(g,gr); } -- 2.40.0