From a3e24e5ec82cda3495ee375ad6a1f2100b15359c Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sat, 22 Oct 2005 18:56:30 +0000 Subject: file loading: fixed recognition of stringified directory names fixed clearing values and dirs, e.g. with messages clrall and clrrec fixed c++ conformance svn path=/trunk/; revision=3751 --- externals/grill/pool/source/pool.cpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'externals/grill/pool/source/pool.cpp') diff --git a/externals/grill/pool/source/pool.cpp b/externals/grill/pool/source/pool.cpp index e99f8cf5..7632998d 100644 --- a/externals/grill/pool/source/pool.cpp +++ b/externals/grill/pool/source/pool.cpp @@ -17,8 +17,6 @@ WARRANTIES, see the file, "license.txt," in this distribution. using namespace std; -#define VBITS 6 -#define DBITS 5 inline I compare(I a,I b) { return a == b?0:(a < b?-1:1); } inline I compare(F a,F b) { return a == b?0:(a < b?-1:1); } @@ -84,7 +82,7 @@ poolval *poolval::Dup() const pooldir::pooldir(const A &d,pooldir *p,I vcnt,I dcnt): parent(p),nxt(NULL),vals(NULL),dirs(NULL), - vbits(vcnt?Int2Bits(vcnt):VBITS),dbits(dcnt?Int2Bits(dcnt):DBITS), + vbits(Int2Bits(vcnt)),dbits(Int2Bits(dcnt)), vsize(1<nxt; + delete d; + } while((d = d1) != NULL); + dirs[i].d = NULL; + dirs[i].cnt = 0; + } + } } if(!dironly && vals) { - for(I i = 0; i < vsize; ++i) if(vals[i].v) { delete vals[i].v; vals[i].v = NULL; } - } + for(I i = 0; i < vsize; ++i) { + poolval *v = vals[i].v,*v1; + if(v) { + do { + v1 = v->nxt; + delete v; + } while((v = v1) != NULL); + vals[i].v = NULL; + vals[i].cnt = 0; + } + } + } } V pooldir::Reset(BL realloc) -- cgit v1.2.1