Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / fileio / xdrd.cpp
index 912de023dd6e35dfa69ee61e73d28b2adc8be1a7..45175a5d6aeeeb560de6b633c6a87fa16c83a682 100644 (file)
@@ -41,7 +41,7 @@
 #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;
@@ -53,18 +53,18 @@ int xdr_real(XDR *xdrs, real *r)
 
     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;
+    floatffp;
     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);
@@ -88,11 +88,11 @@ int xdr3drcoord(XDR *xdrs, real *fp, int *size, real *precision)
     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
@@ -101,30 +101,31 @@ int xdr_int32(XDR *xdrs, int32_t *i)
     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));