Remove unreachable fatal error
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 8 Jan 2014 12:57:01 +0000 (13:57 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 8 Jan 2014 23:26:11 +0000 (00:26 +0100)
read_first_xtc returns the same value that is stored in the output
argument, so one branch of the old code was unreachable.

Noticed this while implementing TNG support, but fixed it here since
it is technically unrelated.

Change-Id: I52387ad1628944edca12703557857bf748e7bb86

src/gromacs/fileio/trxio.c

index e229a105d81d2146ea642c8b5a64e4d166c112c0..7367fa92aa907b4fc24239c9082c743a8937c86a 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <ctype.h>
 #include <math.h>
+#include <assert.h>
 
 #include "sysstuff.h"
 #include "typedefs.h"
@@ -1051,14 +1052,8 @@ int read_first_frame(const output_env_t oenv, t_trxstatus **status,
             if (read_first_xtc(fio, &fr->natoms, &fr->step, &fr->time, fr->box, &fr->x,
                                &fr->prec, &bOK) == 0)
             {
-                if (bOK)
-                {
-                    gmx_fatal(FARGS, "No XTC!\n");
-                }
-                else
-                {
-                    fr->not_ok = DATA_NOT_OK;
-                }
+                assert(!bOK);
+                fr->not_ok = DATA_NOT_OK;
             }
             if (fr->not_ok)
             {