To be on the safe side the function to estimate the time
step betwen frames was fixed such that the return value
bOK is always set even if the file was missing or empty.
In addition the function is made static since it is not
used outside the file.
Change-Id: I8706a23b7a198f9d0718f1bfcb4a7770b2e6e53c
* "WARNING during %s:", where warn is printed in %s.
*/
* "WARNING during %s:", where warn is printed in %s.
*/
-float xdr_xtc_estimate_dt(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bOK);
-
- int xdr_xtc_seek_time(real time, FILE *fp, XDR *xdrs, int natoms,gmx_bool bSeekForwardOnly);
+int xdr_xtc_seek_time(real time, FILE *fp, XDR *xdrs, int natoms,gmx_bool bSeekForwardOnly);
int xdr_xtc_seek_frame(int frame, FILE *fp, XDR *xdrs, int natoms);
int xdr_xtc_seek_frame(int frame, FILE *fp, XDR *xdrs, int natoms);
float
xdr_xtc_estimate_dt(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bOK)
{
float
xdr_xtc_estimate_dt(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bOK)
{
float tinit;
gmx_off_t off;
float tinit;
gmx_off_t off;
if((off = gmx_ftell(fp)) < 0){
return -1;
}
tinit = xtc_get_current_frame_time(fp,xdrs,natoms,bOK);
if((off = gmx_ftell(fp)) < 0){
return -1;
}
tinit = xtc_get_current_frame_time(fp,xdrs,natoms,bOK);
- if(gmx_fseek(fp,off,SEEK_SET)){
+ if (0 != gmx_fseek(fp,off,SEEK_SET)) {