aboutsummaryrefslogtreecommitdiff
path: root/externals/grill
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-08-22 19:21:31 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-08-22 19:21:31 +0000
commit5323bd2c4efc3796c35e25fc5111aad7dead65f6 (patch)
tree9bff1932954e7832f5e0af180f8dfade76f1bed3 /externals/grill
parent76fd627a763f708d764d5f70b3c71cebc8bdbf4f (diff)
file loading: fixed recognition of stringified directory names
svn path=/trunk/; revision=3446
Diffstat (limited to 'externals/grill')
-rw-r--r--externals/grill/pool/readme.txt1
-rw-r--r--externals/grill/pool/source/pool.cpp27
2 files changed, 14 insertions, 14 deletions
diff --git a/externals/grill/pool/readme.txt b/externals/grill/pool/readme.txt
index e9c21b82..092a4f75 100644
--- a/externals/grill/pool/readme.txt
+++ b/externals/grill/pool/readme.txt
@@ -88,6 +88,7 @@ Version history:
- improved reading of legacy data by Frank Barknecht
- use statically allocated lists where feasible
- bug fix: [reset( didn't reset the current dir
+- file loading: fixed recognition of stringified directory names
0.2.0:
- attributes (pool,private,echodir,absdir)
diff --git a/externals/grill/pool/source/pool.cpp b/externals/grill/pool/source/pool.cpp
index 7fd1c289..e99f8cf5 100644
--- a/externals/grill/pool/source/pool.cpp
+++ b/externals/grill/pool/source/pool.cpp
@@ -467,7 +467,7 @@ BL pooldir::Copy(pooldir *p,I depth,BL cut)
}
-static char *ReadAtom(char *c,A *a)
+static const char *ReadAtom(const char *c,A &a)
{
// skip leading whitespace
while(*c && isspace(*c)) ++c;
@@ -522,18 +522,15 @@ static char *ReadAtom(char *c,A *a)
fres = (float)strtod(tmp,&endp);
if(!issymbol && !*endp && endp != tmp) {
#endif
- if(a) {
- int ires = (int)fres; // try a cast
- if(fres == ires)
- flext::SetInt(*a,ires);
- else
- flext::SetFloat(*a,fres);
- }
+ int ires = (int)fres; // try a cast
+ if(fres == ires)
+ flext::SetInt(a,ires);
+ else
+ flext::SetFloat(a,fres);
}
// no, it's a symbol
- else {
- if(a) flext::SetString(*a,tmp);
- }
+ else
+ flext::SetString(a,tmp);
return c;
}
@@ -543,8 +540,8 @@ static BL ParseAtoms(C *tmp,flext::AtomList &l)
const int MAXATOMS = 1024;
int cnt = 0;
t_atom atoms[MAXATOMS];
- for(char *t = tmp; *t && cnt < MAXATOMS; ++cnt) {
- t = ReadAtom(t,&atoms[cnt]);
+ for(const char *t = tmp; *t && cnt < MAXATOMS; ++cnt) {
+ t = ReadAtom(t,atoms[cnt]);
if(!t) break;
}
l(cnt,atoms);
@@ -817,12 +814,14 @@ BL pooldir::LdDirXMLRec(istream &is,I depth,BL mkdir,AtomList &d)
}
else {
t_atom &dkey = d[d.Count()-1];
+ FLEXT_ASSERT(IsSymbol(dkey));
const char *ds = GetString(dkey);
FLEXT_ASSERT(ds);
if(*ds)
post("pool - XML load: dir key already given, ignoring new key");
else
- SetString(dkey,s.c_str());
+ ReadAtom(s.c_str(),dkey);
+
ret = true;
}
if(!ret) post("pool - error interpreting XML value (%s)",s.c_str());