return fr->natoms;
}
-gmx_bool read_next_frame(const gmx_output_env_t *oenv, t_trxstatus *status, t_trxframe *fr)
+bool read_next_frame(const gmx_output_env_t *oenv, t_trxstatus *status, t_trxframe *fr)
{
real pt;
int ct;
- gmx_bool bOK, bRet, bMissingData = FALSE, bSkip = FALSE;
+ gmx_bool bOK, bMissingData = FALSE, bSkip = FALSE;
+ bool bRet = false;
int ftp;
- bRet = FALSE;
pt = status->tf;
do
}
else if (ct > 0)
{
- bRet = FALSE;
+ bRet = false;
}
else
{
return bRet;
}
-int read_first_frame(const gmx_output_env_t *oenv, t_trxstatus **status,
- const char *fn, t_trxframe *fr, int flags)
+bool read_first_frame(const gmx_output_env_t *oenv, t_trxstatus **status,
+ const char *fn, t_trxframe *fr, int flags)
{
t_fileio *fio = nullptr;
gmx_bool bFirst, bOK;
#define DATA_NOT_OK (1<<1)
#define FRAME_NOT_OK (HEADER_NOT_OK | DATA_NOT_OK)
-int read_first_frame(const gmx_output_env_t *oenv, t_trxstatus **status,
- const char *fn, struct t_trxframe *fr, int flags);
+bool read_first_frame(const gmx_output_env_t *oenv, t_trxstatus **status,
+ const char *fn, struct t_trxframe *fr, int flags);
/* Read the first frame which is in accordance with flags, which are
* defined further up in this file.
* Memory will be allocated for flagged entries.
* The flags are copied to fr for subsequent calls to read_next_frame.
- * Returns TRUE when succeeded, FALSE otherwise.
+ * Returns true when succeeded, false otherwise.
*/
-gmx_bool read_next_frame(const gmx_output_env_t *oenv, t_trxstatus *status,
- struct t_trxframe *fr);
+bool read_next_frame(const gmx_output_env_t *oenv, t_trxstatus *status,
+ struct t_trxframe *fr);
/* Reads the next frame which is in accordance with fr->flags.
- * Returns TRUE when succeeded, FALSE otherwise.
+ * Returns true when succeeded, false otherwise.
*/
int read_first_x(const gmx_output_env_t *oenv, t_trxstatus **status,
int i, natoms = 0;
t_trxstatus *status;
t_trxframe fr;
- gmx_bool ok;
+ bool ok;
for (i = 0; i < nfiles; i++)
{
real **value, real *time, real dt_remd, int isize,
int index[], real dt, const gmx_output_env_t *oenv)
{
- int i, j, k, natoms, nnn;
+ int i, j, k, natoms;
t_trxstatus **fp_in, **fp_out;
gmx_bool bCont, *bSet;
real t, first_time = 0;
t = -1;
for (i = 0; (i < nset); i++)
{
- nnn = read_first_frame(oenv, &(fp_in[i]), fnms[i], &(trx[i]),
- TRX_NEED_X);
+ read_first_frame(oenv, &(fp_in[i]), fnms[i], &(trx[i]),
+ TRX_NEED_X);
if (natoms == -1)
{
- natoms = nnn;
+ natoms = trx[i].natoms;
first_time = trx[i].time;
}
- else if (natoms != nnn)
+ else if (natoms != trx[i].natoms)
{
- gmx_fatal(FARGS, "Trajectory file %s has %d atoms while previous trajs had %d atoms", fnms[i], nnn, natoms);
+ gmx_fatal(FARGS, "Trajectory file %s has %d atoms while previous trajs had %d atoms", fnms[i], trx[i].natoms, natoms);
}
if (t == -1)
{