Commit ae9771dc authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Replace Macro DBL_IS_EQUAL by inline function.

parent 894a82e4
......@@ -140,7 +140,7 @@ int find_corner(size_t g1_add, size_t off1, size_t off2, const Varray<double> &g
}
static void
genBoxGridCurv2D(int gridID1, long xinc, long yinc, int gridID2)
genBoxGridCurv2D(int gridID1, size_t xinc, size_t yinc, int gridID2)
{
const auto nlon1 = gridInqXsize(gridID1);
const auto nlat1 = gridInqYsize(gridID1);
......
......@@ -631,7 +631,7 @@ getMemAlignment()
for (int k = 0; k < 4; ++k)
if (iptr % ma_check[k]) ma_result[k] = 0;
}
for (auto &i : ptr) free(i);
for (auto &p : ptr) free(p);
for (int i = NTESTS - 1; i >= 0; i--)
{
......@@ -640,7 +640,7 @@ getMemAlignment()
for (int k = 0; k < 4; ++k)
if (iptr % ma_check[k]) ma_result[k] = 0;
}
for (auto &i : ptr) free(i);
for (auto &p : ptr) free(p);
for (int k = 0; k < 4; ++k)
if (ma_result[k]) ma = ma_check[k];
......@@ -873,6 +873,7 @@ print_system_info()
fprintf(stderr, "\n");
fprintf(stderr, "sizeof(size_t) = %zu\n", sizeof(size_t));
fprintf(stderr, "alignof(double*) = %zu\n", alignof(double*));
fprintf(stderr, "mem alignment = %d\n\n", getMemAlignment());
#if defined(HAVE_MMAP)
......@@ -886,8 +887,9 @@ print_system_info()
#if defined(_OPENACC)
fprintf(stderr, "OPENACC VERSION = %d\n", _OPENACC);
#endif
/* OPENMP 3: 201107 */
/* OPENMP 4: 201307 gcc 4.9 */
// OPENMP3: 201107
// OPENMP4: 201307 gcc 4.9
// OPENMP45: 201511
#ifdef _OPENMP
fprintf(stderr, "OPENMP VERSION = %d\n", _OPENMP);
#endif
......
......@@ -22,10 +22,26 @@
#include <cstring>
//#define DBL_IS_EQUAL(x,y) (!(x < y || y < x))
#define DBL_IS_EQUAL(x, y) (std::isnan(x) || std::isnan(y) ? (std::isnan(x) && std::isnan(y) ? 1 : 0) : !(x < y || y < x))
//#define DBL_IS_EQUAL(x, y) (std::isnan(x) || std::isnan(y) ? (std::isnan(x) && std::isnan(y) ? 1 : 0) : !(x < y || y < x))
static inline bool
DBL_IS_EQUAL(double x, double y)
{
return (std::isnan(x) || std::isnan(y) ? (std::isnan(x) && std::isnan(y) ? 1 : 0) : !(x < y || y < x));
}
//#define IS_NOT_EQUAL(x, y) (x < y || y < x)
//#define IS_EQUAL(x, y) (!IS_NOT_EQUAL(x, y))
constexpr bool
IS_NOT_EQUAL(double x, double y) noexcept
{
return (x < y || y < x);
}
#define IS_NOT_EQUAL(x, y) (x < y || y < x)
#define IS_EQUAL(x, y) (!IS_NOT_EQUAL(x, y))
constexpr bool
IS_EQUAL(double x, double y) noexcept
{
return !(x < y || y < x);
}
static inline bool
cstrIsEqual(const char *x, const char *y)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment