From 591d23920ae9097c68045cbb5133fcbf5b1f6401 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Thu, 22 Apr 2004 02:41:30 +0000 Subject: "" svn path=/trunk/; revision=1624 --- externals/grill/pool/pool.vcproj | 5 +++-- externals/grill/pool/readme.txt | 1 + externals/grill/pool/source/data.cpp | 2 +- externals/grill/pool/source/main.cpp | 18 +++++++++++++----- externals/grill/pool/source/pool.cpp | 32 +++++++++++++++++--------------- externals/grill/pool/source/pool.h | 6 +++--- 6 files changed, 38 insertions(+), 26 deletions(-) (limited to 'externals') diff --git a/externals/grill/pool/pool.vcproj b/externals/grill/pool/pool.vcproj index 494c67c2..45d0b3d1 100644 --- a/externals/grill/pool/pool.vcproj +++ b/externals/grill/pool/pool.vcproj @@ -92,6 +92,7 @@ Optimization="0" AdditionalIncludeDirectories="f:\prog\pd\pd-cvs\src,f:\prog\max\flext\source" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FLEXT_SYS=2" + StringPooling="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="5" UsePrecompiledHeader="2" @@ -108,11 +109,11 @@ Name="VCCustomBuildTool"/> sym == s) + return; + else + FreePool(); pl = GetPool(s); } else { + // if already private no need to allocate new storage + if(priv) return; + priv = true; + if(pl) FreePool(); pl = new pooldata(NULL,vcnt,dcnt); } } @@ -368,7 +376,7 @@ V pool::ms_pool(const AtomList &l) V pool::mg_pool(AtomList &l) { - if(priv) l(); + if(priv || !pl) l(); else { l(1); SetSymbol(l[0],pl->sym); } } diff --git a/externals/grill/pool/source/pool.cpp b/externals/grill/pool/source/pool.cpp index dcb16237..bda4407a 100644 --- a/externals/grill/pool/source/pool.cpp +++ b/externals/grill/pool/source/pool.cpp @@ -2,7 +2,7 @@ pool - hierarchical storage object for PD and Max/MSP -Copyright (c) 2002-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2002-2004 Thomas Grill (xovo@gmx.net) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -842,18 +842,20 @@ static void indent(ostream &s,I cnt) BL pooldir::SvDirXML(ostream &os,I depth,const AtomList &dir,I ind) { - if(dir.Count()) { - indent(os,ind); - os << "" << endl; - indent(os,ind+1); - os << ""; - WriteAtom(os,dir[dir.Count()-1]); - os << "" << endl; - } + int i,lvls = ind?(dir.Count()?1:0):dir.Count(); + + for(i = 0; i < lvls; ++i) { + indent(os,ind+i); + os << "" << endl; + indent(os,ind+i+1); + os << ""; + WriteAtom(os,dir[i]); + os << "" << endl; + } for(I vi = 0; vi < vsize; ++vi) { for(poolval *ix = vals[vi].v; ix; ix = ix->nxt) { - indent(os,ind+1); + indent(os,ind+lvls); os << ""; WriteAtom(os,ix->key); os << ""; @@ -866,15 +868,15 @@ BL pooldir::SvDirXML(ostream &os,I depth,const AtomList &dir,I ind) I nd = depth > 0?depth-1:-1; for(I di = 0; di < dsize; ++di) { for(pooldir *ix = dirs[di].d; ix; ix = ix->nxt) { - ix->SvDirXML(os,nd,AtomList(dir).Append(ix->dir),ind+1); + ix->SvDirXML(os,nd,AtomList(dir).Append(ix->dir),ind+lvls); } } } - if(dir.Count()) { - indent(os,ind); - os << "" << endl; - } + for(i = lvls-1; i >= 0; --i) { + indent(os,ind+i); + os << "" << endl; + } return true; } diff --git a/externals/grill/pool/source/pool.h b/externals/grill/pool/source/pool.h index 1874d334..64445c06 100644 --- a/externals/grill/pool/source/pool.h +++ b/externals/grill/pool/source/pool.h @@ -2,7 +2,7 @@ pool - hierarchical storage object for PD and Max/MSP -Copyright (c) 2002-2003 Thomas Grill (xovo@gmx.net) +Copyright (c) 2002-2004 Thomas Grill (xovo@gmx.net) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. @@ -15,8 +15,8 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include -#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 402) -#error You need at least flext version 0.4.2 +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 405) +#error You need at least flext version 0.4.5 #endif #include -- cgit v1.2.1