Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / selection / selvalue.cpp
index 2f6f171efb3575c80a5c2bf18aabdd06ba9694c8..86edfba070fa72c3cc207e17c3c6094c53aed62c 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 2009,2010,2012,2013,2014, 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.
  *
  * GROMACS is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \ingroup module_selection
  */
-#include "gromacs/legacyheaders/smalloc.h"
+#include "gmxpre.h"
+
+#include "selvalue.h"
 
 #include "gromacs/selection/indexutil.h"
 #include "gromacs/selection/position.h"
-#include "gromacs/selection/selvalue.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/smalloc.h"
 
 /*!
  * \param[out] val  Output structure
@@ -97,11 +100,9 @@ _gmx_selvalue_reserve(gmx_ana_selvalue_t *val, int n)
                 }
                 break;
             case POS_VALUE:
-                srenew(val->u.p, n);
-                for (i = val->nalloc; i < n; ++i)
-                {
-                    gmx_ana_pos_clear(&val->u.p[i]);
-                }
+                GMX_RELEASE_ASSERT(val->u.ptr == NULL,
+                                   "Reallocation of position values not supported");
+                val->u.p = new gmx_ana_pos_t[n];
                 break;
             case GROUP_VALUE:
                 srenew(val->u.g, n);