/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
struct gmx_ana_indexgrps_t
{
//! Initializes an empty set of groups.
- explicit gmx_ana_indexgrps_t(int nr) : nr(nr), g(NULL)
+ explicit gmx_ana_indexgrps_t(int nr) : nr(nr), g(nullptr)
{
names.reserve(nr);
snew(g, nr);
gmx_ana_indexgrps_init(gmx_ana_indexgrps_t **g, gmx_mtop_t *top,
const char *fnm)
{
- t_blocka *block = NULL;
- char **names = NULL;
+ t_blocka *block = nullptr;
+ char **names = nullptr;
if (fnm)
{
{
if (n < 0 || n >= g->nr)
{
- return NULL;
+ return nullptr;
}
return &g->g[n];
}
return false;
}
- if (destName != NULL)
+ if (destName != nullptr)
{
*destName = src->names[n];
}
gmx_ana_index_clear(gmx_ana_index_t *g)
{
g->isize = 0;
- g->index = NULL;
+ g->index = nullptr;
g->nalloc_index = 0;
}
t->index[0] = 0;
t->index[1] = 0;
t->nra = 0;
- t->a = NULL;
+ t->a = nullptr;
t->nalloc_a = 0;
return;
}
// TODO: Check callers and either check these there as well, or turn these
// into exceptions.
- GMX_RELEASE_ASSERT(top != NULL || (type != INDEX_RES && type != INDEX_MOL),
+ GMX_RELEASE_ASSERT(top != nullptr || (type != INDEX_RES && type != INDEX_MOL),
"Topology must be provided for residue or molecule blocks");
GMX_RELEASE_ASSERT(!(type == INDEX_MOL && top->mols.nr == 0),
"Molecule information must be present for molecule blocks");
gmx_ana_indexmap_clear(gmx_ana_indexmap_t *m)
{
m->type = INDEX_UNKNOWN;
- m->refid = NULL;
- m->mapid = NULL;
+ m->refid = nullptr;
+ m->mapid = nullptr;
m->mapb.nr = 0;
- m->mapb.index = NULL;
+ m->mapb.index = nullptr;
m->mapb.nalloc_index = 0;
m->mapb.nra = 0;
- m->mapb.a = NULL;
+ m->mapb.a = nullptr;
m->mapb.nalloc_a = 0;
- m->orgid = NULL;
+ m->orgid = nullptr;
m->b.nr = 0;
- m->b.index = NULL;
+ m->b.index = nullptr;
m->b.nra = 0;
- m->b.a = NULL;
+ m->b.a = nullptr;
m->b.nalloc_index = 0;
m->b.nalloc_a = 0;
m->bStatic = true;
GMX_RELEASE_ASSERT(m->bStatic,
"Changing original IDs is not supported after starting "
"to use the mapping");
- GMX_RELEASE_ASSERT(top != NULL || (type != INDEX_RES && type != INDEX_MOL),
+ GMX_RELEASE_ASSERT(top != nullptr || (type != INDEX_RES && type != INDEX_MOL),
"Topology must be provided for residue or molecule blocks");
GMX_RELEASE_ASSERT(!(type == INDEX_MOL && top->mols.nr == 0),
"Molecule information must be present for molecule blocks");