Commit a2a2c1f1 authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@363 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent 70b441e4
......@@ -70,15 +70,17 @@ flext::AtomList &flext::AtomList::Append(const t_atom &a)
flext::AtomList &flext::AtomList::Append(int argc,const t_atom *argv)
{
t_atom *nlst = new t_atom[cnt+argc];
int i;
for(i = 0; i < cnt; ++i) SetAtom(nlst[i],lst[i]);
for(i = 0; i < argc; ++i) SetAtom(nlst[cnt+i],argv[i]);
if(lst) delete[] lst;
lst = nlst;
cnt += argc;
if(argc) {
t_atom *nlst = new t_atom[cnt+argc];
int i;
for(i = 0; i < cnt; ++i) SetAtom(nlst[i],lst[i]);
if(argv)
for(i = 0; i < argc; ++i) SetAtom(nlst[cnt+i],argv[i]);
if(lst) delete[] lst;
lst = nlst;
cnt += argc;
}
return *this;
}
......@@ -97,15 +99,18 @@ flext::AtomList &flext::AtomList::Prepend(const t_atom &a)
flext::AtomList &flext::AtomList::Prepend(int argc,const t_atom *argv)
{
t_atom *nlst = new t_atom[cnt+argc];
int i;
for(i = 0; i < argc; ++i) SetAtom(nlst[i],argv[i]);
for(i = 0; i < cnt; ++i) SetAtom(nlst[argc+i],lst[i]);
if(lst) delete[] lst;
lst = nlst;
cnt += argc;
if(argc) {
t_atom *nlst = new t_atom[cnt+argc];
int i;
if(argv)
for(i = 0; i < argc; ++i) SetAtom(nlst[i],argv[i]);
for(i = 0; i < cnt; ++i) SetAtom(nlst[argc+i],lst[i]);
if(lst) delete[] lst;
lst = nlst;
cnt += argc;
}
return *this;
}
......
......@@ -304,13 +304,13 @@ public:
//! Append an atom to the list
AtomList &Append(const t_atom &a);
//! Append an atom list to the list
AtomList &Append(int argc,const t_atom *argv);
AtomList &Append(int argc,const t_atom *argv = NULL);
//! Append an atom list to the list
AtomList &Append(const AtomList &a) { return Append(a.Count(),a.Atoms()); }
//! Prepend an atom to the list
AtomList &Prepend(const t_atom &a);
//! Prepend an atom list to the list
AtomList &Prepend(int argc,const t_atom *argv);
AtomList &Prepend(int argc,const t_atom *argv = NULL);
//! Prepend an atom list to the list
AtomList &Prepend(const AtomList &a) { return Prepend(a.Count(),a.Atoms()); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment