* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
#include <limits.h>
#include <math.h>
#include "xdrf.h"
#include "xdr_datatype.h"
-#include "futil.h"
+#include "gromacs/utility/futil.h"
/* This is just for clarity - it can never be anything but 4! */
#define XDR_INT_SIZE 4
return res;
}
-
int
xdr_xtc_seek_frame(int frame, FILE *fp, XDR *xdrs, int natoms)
{
{
return -1;
}
- if (fr != frame && abs(low-high) > header_size)
+ if (fr != frame && llabs(low-high) > header_size)
{
if (fr < frame)
{
if (bSeekForwardOnly)
{
- low = gmx_ftell(fp);
+ low = gmx_ftell(fp)-header_size;
}
if (gmx_fseek(fp, 0, SEEK_END))
{
the current time and the target time is bigger than dt and above all the distance between high
and low is bigger than 1 frame, then do another step of binary search. Otherwise stop and check
if we reached the solution */
- if ((((t < time && dt_sign >= 0) || (t > time && dt_sign == -1)) || ((t
- - time) >= dt && dt_sign >= 0)
- || ((time - t) >= -dt && dt_sign < 0)) && (abs(low - high)
- > header_size))
+ if ((((t < time && dt_sign >= 0) || (t > time && dt_sign == -1)) ||
+ ((t - time) >= dt && dt_sign >= 0) || ((time - t) >= -dt && dt_sign < 0)) &&
+ (llabs(low - high) > header_size))
{
if (dt >= 0 && dt_sign != -1)
{
}
else
{
- if (abs(low - high) <= header_size)
+ if (llabs(low - high) <= header_size)
{
break;
}