From a9909685b1ea5014a81a2d2e5963203637bdb3ce Mon Sep 17 00:00:00 2001 From: Jens Vollinga Date: Thu, 17 Aug 2006 14:10:37 +0000 Subject: [PATCH] Fixed warning on 64bit machines. --- ginac/numeric.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ginac/numeric.cpp b/ginac/numeric.cpp index cc72565a..582bfdcf 100644 --- a/ginac/numeric.cpp +++ b/ginac/numeric.cpp @@ -92,10 +92,16 @@ numeric::numeric(int i) : basic(&numeric::tinfo_static) // emphasizes efficiency. However, if the integer is small enough // we save space and dereferences by using an immediate type. // (C.f. ) + // The #if clause prevents compiler warnings on 64bit machines where the + // comparision is always true. +#if cl_value_len >= 32 + value = cln::cl_I(i); +#else if (i < (1L << (cl_value_len-1)) && i >= -(1L << (cl_value_len-1))) value = cln::cl_I(i); else value = cln::cl_I(static_cast(i)); +#endif setflag(status_flags::evaluated | status_flags::expanded); } @@ -107,10 +113,16 @@ numeric::numeric(unsigned int i) : basic(&numeric::tinfo_static) // emphasizes efficiency. However, if the integer is small enough // we save space and dereferences by using an immediate type. // (C.f. ) + // The #if clause prevents compiler warnings on 64bit machines where the + // comparision is always true. +#if cl_value_len >= 32 + value = cln::cl_I(i); +#else if (i < (1UL << (cl_value_len-1))) value = cln::cl_I(i); else value = cln::cl_I(static_cast(i)); +#endif setflag(status_flags::evaluated | status_flags::expanded); } -- 2.44.0