Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / gmxana / powerspect.c
index 2acc5219141d9bf809536f9e91350b8f9d772956..071e50afaddd7daf1732a021362465720fdde496 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,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.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include "smalloc.h"
+#include "gromacs/utility/smalloc.h"
 #include "gromacs/fft/fft.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
 #include "interf.h"
 #include "powerspect.h"
 
@@ -73,7 +71,6 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
 /*Prepare data structures for FFT, with time averaging of power spectrum*/
     if ( (status = gmx_fft_init_2d_real(&fftp, xbins, ybins, GMX_FFT_FLAG_NONE) ) != 0)
     {
-        free(fftp);
         gmx_fatal(status, __FILE__, __LINE__, "Error allocating FFT");
     }
 
@@ -99,8 +96,8 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
     }
     /*Print out average energy-spectrum to outfiles[0] and outfiles[1];*/
 
-    datfile1 = ffopen(outfiles[0], "w");
-    datfile2 = ffopen(outfiles[1], "w");
+    datfile1 = gmx_ffopen(outfiles[0], "w");
+    datfile2 = gmx_ffopen(outfiles[1], "w");
 
 /*Filling dat files with spectral data*/
     fprintf(datfile1, "%s\n", "kx\t ky\t\tPower(kx,ky)");
@@ -110,11 +107,11 @@ void powerspectavg(real ***intftab, int tsteps, int xbins, int ybins, char **out
         fprintf(datfile1, "%d\t%d\t %8.6f\n", (n / fy), (n % fy), pspectavg1[n]);
         fprintf(datfile2, "%d\t%d\t %8.6f\n", (n /fy), (n % fy), pspectavg2[n]);
     }
-    ffclose(datfile1);
-    ffclose(datfile2);
+    gmx_ffclose(datfile1);
+    gmx_ffclose(datfile2);
 
-    free(ftspect1);
-    free(ftspect2);
+    sfree(ftspect1);
+    sfree(ftspect2);
 
 }