From 6328beb7d791cea640993dd44167a41855c1cb37 Mon Sep 17 00:00:00 2001 From: Dan Ibanez <daibane@sandia.gov> Date: Wed, 25 Jan 2017 15:22:42 -0700 Subject: [PATCH] fix double-return warning this #ifdef adds a return statement for little endian machines, but leaves the old one, which the compiler comlains is unreachable. this commit combines the conditionals so we can use #else --- src/KOKKOS/math_special_kokkos.h | 7 +++---- src/math_special.h | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/KOKKOS/math_special_kokkos.h b/src/KOKKOS/math_special_kokkos.h index c177e88574..88008312bf 100644 --- a/src/KOKKOS/math_special_kokkos.h +++ b/src/KOKKOS/math_special_kokkos.h @@ -42,12 +42,11 @@ namespace MathSpecialKokkos { { x *= x; x *= 1.4426950408889634074; // log_2(e) -#if defined(__BYTE_ORDER__) -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ return (x < 1023.0) ? exp2_x86(-x) : 0.0; -#endif -#endif +#else return (x < 1023.0) ? exp2(-x) : 0.0; +#endif } // x**2, use instead of pow(x,2.0) diff --git a/src/math_special.h b/src/math_special.h index 059ef5d3c7..e4b4998d54 100644 --- a/src/math_special.h +++ b/src/math_special.h @@ -41,12 +41,11 @@ namespace MathSpecial { { x *= x; x *= 1.4426950408889634074; // log_2(e) -#if defined(__BYTE_ORDER__) -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ return (x < 1023.0) ? exp2_x86(-x) : 0.0; -#endif -#endif +#else return (x < 1023.0) ? exp2(-x) : 0.0; +#endif } // x**2, use instead of pow(x,2.0) -- GitLab