Skip to content
Snippets Groups Projects
Commit a8d7b01e authored by James Willis's avatar James Willis
Browse files

Remove vector casts for c++ compilation.

parent 6f1cd9a7
No related branches found
No related tags found
1 merge request!505Cpp
...@@ -275,11 +275,15 @@ __attribute__((always_inline)) INLINE static vector pow_dimension_vec( ...@@ -275,11 +275,15 @@ __attribute__((always_inline)) INLINE static vector pow_dimension_vec(
#if defined(HYDRO_DIMENSION_3D) #if defined(HYDRO_DIMENSION_3D)
return (vector)(vec_mul(vec_mul(x.v, x.v), x.v)); vector x3;
x3.v = vec_mul(vec_mul(x.v, x.v), x.v);
return x3;
#elif defined(HYDRO_DIMENSION_2D) #elif defined(HYDRO_DIMENSION_2D)
return (vector)(vec_mul(x.v, x.v)); vector x2;
x2.v = vec_mul(x.v, x.v);
return x2;
#elif defined(HYDRO_DIMENSION_1D) #elif defined(HYDRO_DIMENSION_1D)
...@@ -304,16 +308,22 @@ __attribute__((always_inline)) INLINE static vector pow_dimension_plus_one_vec( ...@@ -304,16 +308,22 @@ __attribute__((always_inline)) INLINE static vector pow_dimension_plus_one_vec(
#if defined(HYDRO_DIMENSION_3D) #if defined(HYDRO_DIMENSION_3D)
const vector x2 = (vector)(vec_mul(x.v, x.v)); vector x2, x4;
return (vector)(vec_mul(x2.v, x2.v)); x2.v = vec_mul(x.v, x.v);
x4.v = vec_mul(x2.v, x2.v);
return x4;
#elif defined(HYDRO_DIMENSION_2D) #elif defined(HYDRO_DIMENSION_2D)
return (vector)(vec_mul(x.v, vec_mul(x.v, x.v))); vector x3;
x3.v = vec_mul(vec_mul(x.v, x.v), x.v);
return x3;
#elif defined(HYDRO_DIMENSION_1D) #elif defined(HYDRO_DIMENSION_1D)
return (vector)(vec_mul(x.v, x.v)); vector x2;
x2.v = vec_mul(x.v, x.v);
return x2;
#else #else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment