#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
-int xdr_real(XDR *xdrs, real *r)
+int xdr_real(XDR* xdrs, real* r)
{
#if GMX_DOUBLE
float f;
return ret;
#else
- return xdr_float(xdrs, static_cast<float *>(r));
+ return xdr_float(xdrs, static_cast<float*>(r));
#endif
}
-int xdr3drcoord(XDR *xdrs, real *fp, int *size, real *precision)
+int xdr3drcoord(XDR* xdrs, real* fp, int* size, real* precision)
{
#if GMX_DOUBLE
- float *ffp;
+ float* ffp;
float fprec;
int i, ret, isize;
- isize = *size*DIM;
+ isize = *size * DIM;
if (isize <= 0)
{
gmx_fatal(FARGS, "Don't know what to malloc for ffp, isize = %d", isize);
sfree(ffp);
return ret;
#else
- return xdr3dfcoord(xdrs, reinterpret_cast<float *>(fp), size, reinterpret_cast<float *>(precision));
+ return xdr3dfcoord(xdrs, reinterpret_cast<float*>(fp), size, reinterpret_cast<float*>(precision));
#endif
}
-int xdr_int32(XDR *xdrs, int32_t *i)
+int xdr_int32(XDR* xdrs, int32_t* i)
{
// Note that this implementation assumes that an int is at least
// 32 bits, which is not strictly required by the language, but
static_assert(sizeof(int) >= 4, "XDR handling assumes that an int32_t can be stored in an int");
int temporary = static_cast<int>(*i);
int ret = xdr_int(xdrs, &temporary);
- *i = static_cast<int32_t>(temporary);
+ *i = static_cast<int32_t>(temporary);
return ret;
}
-int xdr_int64(XDR *xdrs, int64_t *i)
+int xdr_int64(XDR* xdrs, int64_t* i)
{
// Note that this implementation assumes that an int is at least
// 32 bits, which is not strictly required by the language, but
// good enough in practice on 32- or 64-bit systems. GROMACS
// requires 64-bit systems.
- static_assert(2*sizeof(int) >= 8, "XDR handling assumes that an int64_t can be stored in two ints");
- int imaj, imin;
- int ret;
+ static_assert(2 * sizeof(int) >= 8,
+ "XDR handling assumes that an int64_t can be stored in two ints");
+ int imaj, imin;
+ int ret;
static const int64_t two_p32_m1 = 0xFFFFFFFF;
int64_t imaj64, imin64;
- imaj64 = ((*i)>>32) & two_p32_m1;
+ imaj64 = ((*i) >> 32) & two_p32_m1;
imin64 = (*i) & two_p32_m1;
imaj = static_cast<int>(imaj64);
imin = static_cast<int>(imin64);
ret = xdr_int(xdrs, &imaj);
- ret |= xdr_int(xdrs, &imin);
+ ret |= xdr_int(xdrs, &imin);
*i = ((static_cast<int64_t>(imaj) << 32) | (static_cast<int64_t>(imin) & two_p32_m1));