ffp = &mtop->ffparams;
idef = &top->idef;
- idef->ntypes = ffp->ntypes;
+ idef->ntypes = ffp->numTypes();
idef->atnr = ffp->atnr;
/* we can no longer copy the pointers to the mtop members,
* because they will become invalid as soon as mtop gets free'd.
* We also need to make sure to only operate on valid data!
*/
- if (ffp->functype)
+ if (!ffp->functype.empty())
{
- snew(idef->functype, ffp->ntypes);
- std::copy(ffp->functype, ffp->functype + ffp->ntypes, idef->functype);
+ snew(idef->functype, ffp->functype.size());
+ std::copy(ffp->functype.data(), ffp->functype.data() + ffp->functype.size(), idef->functype);
}
else
{
idef->functype = nullptr;
}
- if (ffp->iparams)
+ if (!ffp->iparams.empty())
{
- snew(idef->iparams, ffp->ntypes);
- std::copy(ffp->iparams, ffp->iparams + ffp->ntypes, idef->iparams);
+ snew(idef->iparams, ffp->iparams.size());
+ std::copy(ffp->iparams.data(), ffp->iparams.data() + ffp->iparams.size(), idef->iparams);
}
else
{