Manage compiler flags and some include options per file or target, not globally
[alexxy/gromacs.git] / src / gromacs / math / vec.h
index 8769c876be8860289966d170a6679e8073b4e006..b5f4a959fe78c1f7f29b6652dad4bb31daddd2b1 100644 (file)
@@ -216,9 +216,9 @@ static inline void copy_rvec_to_dvec(const rvec a, dvec b)
 
 static inline void copy_dvec_to_rvec(const dvec a, rvec b)
 {
-    b[XX] = a[XX];
-    b[YY] = a[YY];
-    b[ZZ] = a[ZZ];
+    b[XX] = static_cast<real>(a[XX]);
+    b[YY] = static_cast<real>(a[YY]);
+    b[ZZ] = static_cast<real>(a[ZZ]);
 }
 
 static inline void copy_rvecn(const rvec *a, rvec *b, int startn, int endn)
@@ -396,7 +396,7 @@ static inline real cos_angle(const rvec a, const rvec b)
     ipab = ipa*ipb;
     if (ipab > 0)
     {
-        cosval = ip*gmx::invsqrt(ipab);  /*  7 */
+        cosval = static_cast<real>(ip*gmx::invsqrt(ipab));  /*  7 */
     }
     else
     {