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
This commit is contained in:
Dan Ibanez
2017-01-25 15:22:42 -07:00
parent caea8973a3
commit 6328beb7d7
2 changed files with 6 additions and 8 deletions

View File

@ -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)

View File

@ -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)