diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2005-03-15 04:56:36 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2005-03-15 04:56:36 +0000 |
commit | 31a2d9dcc2b3a519033918e180f81c4e7b9f8e7e (patch) | |
tree | 7eae5d3f1e302843147fdc6bc13c99e101906d32 /externals/grill/flext/source/flmeth.cpp | |
parent | 3e0446e7fda10c3d85a628b8c1effaa5bf7f5529 (diff) |
new data type flext::AtomListStatic using pre-allocated space if possible
fixes for OSX
replaced memory-intensive STL maps by custom-made vector/map-container
fix for gcc strangeness
no more static assignment of symbols (problems with Metrowerks)
small fix for gcc
fixed bugs in SIMD code for non-power-of-2 lengths
fixes for attribute editor (to deal with large dialogs)
svn path=/trunk/; revision=2628
Diffstat (limited to 'externals/grill/flext/source/flmeth.cpp')
-rwxr-xr-x | externals/grill/flext/source/flmeth.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/externals/grill/flext/source/flmeth.cpp b/externals/grill/flext/source/flmeth.cpp index 5de2083a..a9bf6749 100755 --- a/externals/grill/flext/source/flmeth.cpp +++ b/externals/grill/flext/source/flmeth.cpp @@ -92,7 +92,7 @@ void flext_base::AddMethod(ItemCont *ma,int inlet,const t_symbol *tag,methfun fu void flext_base::ListMethods(AtomList &la,int inlet) const { - typedef DataMap<int,const t_symbol *> MethList; + typedef TableMap<int,t_symbol,32> MethList; MethList list[2]; int i; @@ -100,13 +100,12 @@ void flext_base::ListMethods(AtomList &la,int inlet) const ItemCont *a = i?methhead:clmethhead; if(a && a->Contained(inlet)) { ItemSet &ai = a->GetInlet(inlet); - for(ItemSet::iterator as = ai.begin(); as != ai.end(); ++as) { + for(ItemSet::iterator as(ai); as; ++as) { for(Item *al = as.data(); al; al = al->nxt) { MethItem *aa = (MethItem *)al; - // check it's not related to an attribute if(!aa->IsAttr()) { - list[i][aa->index] = as.key(); + list[i].insert(aa->index,const_cast<t_symbol *>(as.key())); break; } } @@ -116,9 +115,8 @@ void flext_base::ListMethods(AtomList &la,int inlet) const la((int)list[0].size()+(int)list[1].size()); int ix = 0; - MethList::iterator it; for(i = 0; i <= 1; ++i) - for(it = list[i].begin(); it != list[i].end(); ++it) + for(MethList::iterator it(list[i]); it; ++it) SetSymbol(la[ix++],it.data()); } @@ -129,7 +127,7 @@ bool flext_base::cb_ListMethods(flext_base *c,int argc,const t_atom *argv) extern const t_symbol *sym_methods; int inlet = argc?GetAInt(argv[0]):0; - AtomList la; + AtomListStatic<32> la; c->ListMethods(la,inlet); c->ToOutAnything(c->GetOutAttr(),sym_methods,la.Count(),la.Atoms()); return true; |