Merge branch 'master' into pygromacs
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_sans.cpp
similarity index 97%
rename from src/gromacs/gmxana/gmx_sans.c
rename to src/gromacs/gmxana/gmx_sans.cpp
index 90d30a617a1718e45aa45c4102fc6725b21a2332..f017f4145c1c57d1de072ce7f0e7ee0191f48331 100644 (file)
@@ -53,6 +53,7 @@
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/gmxomp.h"
 #include "gromacs/utility/smalloc.h"
 
@@ -118,12 +119,10 @@ int gmx_sans(int argc, char *argv[])
 #endif
     };
     FILE                                 *fp;
-    const char                           *fnTPX, *fnNDX, *fnTRX, *fnDAT = NULL;
+    const char                           *fnTPX, *fnTRX, *fnDAT = NULL;
     t_trxstatus                          *status;
     t_topology                           *top  = NULL;
-    t_atom                               *atom = NULL;
     gmx_rmpbc_t                           gpbc = NULL;
-    gmx_bool                              bTPX;
     gmx_bool                              bFFT = FALSE, bDEBYE = FALSE;
     gmx_bool                              bMC  = FALSE;
     int                                   ePBC = -1;
@@ -135,7 +134,7 @@ int gmx_sans(int argc, char *argv[])
     char                                **grpname = NULL;
     atom_id                              *index   = NULL;
     int                                   isize;
-    int                                   i, j;
+    int                                   i;
     char                                 *hdr            = NULL;
     char                                 *suffix         = NULL;
     t_filenm                             *fnmdup         = NULL;
@@ -172,6 +171,7 @@ int gmx_sans(int argc, char *argv[])
     gmx_omp_set_num_threads(nthreads);
 
     /* Now try to parse opts for modes */
+    GMX_RELEASE_ASSERT(emethod[0] != NULL, "Options inconsistency; emethod[0] is NULL");
     switch (emethod[0][0])
     {
         case 'd':
@@ -227,7 +227,7 @@ int gmx_sans(int argc, char *argv[])
     snew(grpname, 1);
     snew(index, 1);
 
-    bTPX = read_tps_conf(fnTPX, title, top, &ePBC, &x, NULL, box, TRUE);
+    read_tps_conf(fnTPX, title, top, &ePBC, &x, NULL, box, TRUE);
 
     printf("\nPlease select group for SANS spectra calculation:\n");
     get_index(&(top->atoms), ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, grpname);