xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject cvs commit: xml-xalan/c/src/xalanc/PlatformSupport DoubleSupport.cpp DoubleSupport.hpp
Date Fri, 07 Oct 2005 22:40:28 GMT
dbertoni    2005/10/07 15:40:28

  Modified:    c/src/xalanc/PlatformSupport DoubleSupport.cpp
                        DoubleSupport.hpp
  Log:
  Fixes for XALANC-511.
  
  Revision  Changes    Path
  1.12      +30 -3     xml-xalan/c/src/xalanc/PlatformSupport/DoubleSupport.cpp
  
  Index: DoubleSupport.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/DoubleSupport.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DoubleSupport.cpp	14 Jun 2005 19:49:49 -0000	1.11
  +++ DoubleSupport.cpp	7 Oct 2005 22:40:28 -0000	1.12
  @@ -19,7 +19,9 @@
   
   #include <clocale>
   #include <cmath>
  -
  +#if !defined(XALAN_NO_STD_NUMERIC_LIMITS)
  +#include <limits>
  +#endif
   
   
   #include "DOMStringHelper.hpp"
  @@ -31,7 +33,18 @@
   
   
   
  +#if defined(XALAN_NO_STD_NUMERIC_LIMITS)
   DoubleSupport::NumberUnion          DoubleSupport::s_NaN;
  +#else
  +const DoubleSupport::NumberUnion    DoubleSupport::s_NaN =
  +{
  +#if defined(XALAN_NO_STD_NAMESPACE)
  +    numeric_limits<double>::quiet_NaN()
  +#else
  +    std::numeric_limits<double>::quiet_NaN()
  +#endif
  +};
  +#endif
   
   const DoubleSupport::NumberUnion    DoubleSupport::s_positiveInfinity = { HUGE_VAL };
   
  @@ -46,6 +59,7 @@
   void
   DoubleSupport::initialize()
   {
  +#if defined(XALAN_NO_STD_NUMERIC_LIMITS)
       // We initialize this at here because some
       // platforms have had issues with signals
       // if we call sqrt(-2.01) during static
  @@ -55,6 +69,13 @@
   #else
       s_NaN.d = sqrt(-2.01);
   #endif
  +#else
  +    #if defined(XALAN_NO_STD_NAMESPACE)
  +        XALAN_STATIC_ASSERT(numeric_limits<double>::is_iec559);
  +    #else
  +        XALAN_STATIC_ASSERT(std::numeric_limits<double>::is_iec559);
  +    #endif
  +#endif
   }
   
   
  @@ -62,7 +83,9 @@
   void
   DoubleSupport::terminate()
   {
  +#if defined(XALAN_NO_STD_NUMERIC_LIMITS)
       s_NaN.d = 0.0L;
  +#endif
   }
   
   
  @@ -301,6 +324,8 @@
       }
   }
   
  +
  +
   double
   DoubleSupport::abs(double theDouble)
   {
  @@ -317,6 +342,8 @@
       }
   }
   
  +
  +
   double
   DoubleSupport::toDouble(
               const XalanDOMString&   theString,
  @@ -482,7 +509,7 @@
   
   
   #if defined(XALAN_NON_ASCII_PLATFORM)
  -void
  +static void
   translateWideString(
               const XalanDOMChar*         theWideString,
               char*                       theNarrowString,
  @@ -642,7 +669,7 @@
   
   
   
  -double
  +inline double
   doConvert(
               const XalanDOMChar*     theString,
               MemoryManager&          theManager)
  
  
  
  1.10      +5 -0      xml-xalan/c/src/xalanc/PlatformSupport/DoubleSupport.hpp
  
  Index: DoubleSupport.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/PlatformSupport/DoubleSupport.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DoubleSupport.hpp	14 Jun 2005 19:49:49 -0000	1.9
  +++ DoubleSupport.hpp	7 Oct 2005 22:40:28 -0000	1.10
  @@ -623,7 +623,12 @@
   
   private:
   
  +#if defined(XALAN_NO_STD_NUMERIC_LIMITS)
       static NumberUnion          s_NaN;
  +#else
  +    static const NumberUnion    s_NaN;
  +#endif
  +
       static const NumberUnion    s_positiveInfinity;
       static const NumberUnion    s_negativeInfinity;
       static const NumberUnion    s_positiveZero;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message