From cf4565095c3bc1c01f68c8109e9fd9c6bf939019 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 28 Jul 2008 20:50:41 +0200 Subject: [PATCH] Use == in RealEquals and get rid of the memcmp there entirely. --- dmd/expression.c | 2 +- dmd/mars.h | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dmd/expression.c b/dmd/expression.c index 4a118fac..f0ed8ebd 100644 --- a/dmd/expression.c +++ b/dmd/expression.c @@ -1498,7 +1498,7 @@ int RealEquals(real_t x1, real_t x2) /* In some cases, the REALPAD bytes get garbage in them, * so be sure and ignore them. */ - memcmp(&x1, &x2, REAL_T_SIZE - REAL_T_PAD) == 0; + x1 == x2; } int RealExp::equals(Object *o) diff --git a/dmd/mars.h b/dmd/mars.h index 8d1d8901..037087e7 100644 --- a/dmd/mars.h +++ b/dmd/mars.h @@ -213,14 +213,6 @@ typedef d_uns32 d_dchar; #include "d-gcc-real.h" #else typedef long double real_t; -// this should be enough -#if defined(i386) || defined(__i386__) || defined(_WIN32) || defined(__MINGW32__) -#define REAL_T_SIZE 12 -#define REAL_T_PAD 2 -#else -#define REAL_T_SIZE sizeof(real_t) -#define REAL_T_PAD 0 -#endif #endif // Modify OutBuffer::writewchar to write the correct size of wchar