Move fileio sources to C++
[alexxy/gromacs.git] / src / gromacs / fileio / trxio.cpp
similarity index 99%
rename from src/gromacs/fileio/trxio.c
rename to src/gromacs/fileio/trxio.cpp
index 8c296dcee574e0163a8d0e35d794817271742486..86b52201aff8e5e91950312ec75eb0625bdb53b6 100644 (file)
@@ -40,8 +40,8 @@
 
 #include "config.h"
 
-#include <assert.h>
-#include <math.h>
+#include <cassert>
+#include <cmath>
 
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
@@ -61,6 +61,7 @@
 #include "gromacs/topology/atoms.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 #ifdef GMX_USE_PLUGINS
@@ -784,7 +785,6 @@ gmx_bool read_next_frame(const output_env_t oenv, t_trxstatus *status, t_trxfram
     real     pt;
     int      ct;
     gmx_bool bOK, bRet, bMissingData = FALSE, bSkip = FALSE;
-    int      dummy = 0;
     int      ftp;
 
     bRet = FALSE;
@@ -914,9 +914,7 @@ int read_first_frame(const output_env_t oenv, t_trxstatus **status,
 {
     t_fileio      *fio;
     gmx_bool       bFirst, bOK;
-    int            dummy = 0;
     int            ftp   = fn2ftp(fn);
-    gmx_int64_t   *tng_ids;
 
     clear_trxframe(fr, TRUE);
     fr->flags = flags;
@@ -964,13 +962,13 @@ int read_first_frame(const output_env_t oenv, t_trxstatus **status,
             {
                 snew(fr->v, fr->natoms);
             }
-            fio = (*status)->fio = gmx_fio_open(fn, "r");
+            (*status)->fio = gmx_fio_open(fn, "r");
             break;
         case efXTC:
             if (read_first_xtc(fio, &fr->natoms, &fr->step, &fr->time, fr->box, &fr->x,
                                &fr->prec, &bOK) == 0)
             {
-                assert(!bOK);
+                GMX_RELEASE_ASSERT(!bOK, "Inconsistent results - OK status from read_first_xtc, but 0 atom coords read");
                 fr->not_ok = DATA_NOT_OK;
             }
             if (fr->not_ok)