aboutsummaryrefslogtreecommitdiff
path: root/externals/grill
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-10-22 18:56:30 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-10-22 18:56:30 +0000
commita3e24e5ec82cda3495ee375ad6a1f2100b15359c (patch)
treef35327ec1e4457723ee707fe0aa706f744cc9b8f /externals/grill
parentcff3f74cfb2688fc6b28bcddd7e6b4635d58a2f1 (diff)
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
Diffstat (limited to 'externals/grill')
-rw-r--r--externals/grill/pool/readme.txt3
-rw-r--r--externals/grill/pool/source/main.cpp11
-rw-r--r--externals/grill/pool/source/pool.cpp30
-rw-r--r--externals/grill/pool/source/pool.h2
4 files changed, 35 insertions, 11 deletions
diff --git a/externals/grill/pool/readme.txt b/externals/grill/pool/readme.txt
index 092a4f75..84d377ff 100644
--- a/externals/grill/pool/readme.txt
+++ b/externals/grill/pool/readme.txt
@@ -75,6 +75,9 @@ bash ../flext/build.sh
Version history:
+0.2.2:
+- fixed serious bug with clearing values and dirs. e.g. "clrall" and "clrrec" messages.
+
0.2.1:
- fixed "cntsub"... directories in current directory have been forgotten
- store/create also empty dirs with file I/O
diff --git a/externals/grill/pool/source/main.cpp b/externals/grill/pool/source/main.cpp
index 088a0917..cddf33c0 100644
--- a/externals/grill/pool/source/main.cpp
+++ b/externals/grill/pool/source/main.cpp
@@ -11,12 +11,11 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "pool.h"
#include <string>
-#define POOL_VERSION "0.2.1"
+#define POOL_VERSION "0.2.2pre"
-#define VCNT 64
-#define DCNT 16
+#define VCNT 32
+#define DCNT 8
-const t_symbol *sym_echo = flext::MakeSymbol("echo");
class pool:
public flext_base
@@ -117,6 +116,8 @@ private:
static BL ValChk(const AtomList &l) { return ValChk(l.Count(),l.Atoms()); }
V ToOutAtom(I ix,const A &a);
+ static const t_symbol *sym_echo;
+
enum get_t { get_norm,get_cnt,get_print };
V set(I argc,const A *argv,BL over);
@@ -227,6 +228,7 @@ FLEXT_NEW_V("pool",pool);
pooldata *pool::head,*pool::tail;
+const t_symbol *pool::sym_echo;
V pool::setup(t_classid c)
@@ -236,6 +238,7 @@ V pool::setup(t_classid c)
post("");
head = tail = NULL;
+ sym_echo = MakeSymbol("echo");
FLEXT_CADDATTR_VAR(c,"pool",mg_pool,ms_pool);
FLEXT_CADDATTR_VAR1(c,"absdir",absdir);
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<<vbits),dsize(1<<dbits)
{
Reset();
@@ -101,11 +99,31 @@ pooldir::~pooldir()
V pooldir::Clear(BL rec,BL dironly)
{
if(rec && dirs) {
- for(I i = 0; i < dsize; ++i) if(dirs[i].d) { delete dirs[i].d; dirs[i].d = NULL; }
+ for(I i = 0; i < dsize; ++i) {
+ pooldir *d = dirs[i].d,*d1;
+ if(d) {
+ do {
+ d1 = d->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)
diff --git a/externals/grill/pool/source/pool.h b/externals/grill/pool/source/pool.h
index 49b9c378..5d251cd8 100644
--- a/externals/grill/pool/source/pool.h
+++ b/externals/grill/pool/source/pool.h
@@ -53,7 +53,7 @@ class pooldir:
public flext
{
public:
- pooldir(const A &dir,pooldir *parent,I vcnt = 0,I dcnt = 0);
+ pooldir(const A &dir,pooldir *parent,I vcnt,I dcnt);
~pooldir();
V Clear(BL rec,BL dironly = false);