You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by pe...@apache.org on 2004/09/09 22:09:31 UTC

cvs commit: xml-xerces/c/src/xercesc/util XMLFloat.cpp XMLDouble.cpp XMLAbstractDoubleFloat.hpp XMLAbstractDoubleFloat.cpp

peiyongz    2004/09/09 13:09:31

  Modified:    c/src/xercesc/util XMLFloat.cpp XMLDouble.cpp
                        XMLAbstractDoubleFloat.hpp
                        XMLAbstractDoubleFloat.cpp
  Log:
  getDataOverflowed()
  
  Revision  Changes    Path
  1.16      +11 -9     xml-xerces/c/src/xercesc/util/XMLFloat.cpp
  
  Index: XMLFloat.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLFloat.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- XMLFloat.cpp	8 Sep 2004 13:56:24 -0000	1.15
  +++ XMLFloat.cpp	9 Sep 2004 20:09:30 -0000	1.16
  @@ -17,6 +17,9 @@
   /*
    * $Id$
    * $Log$
  + * Revision 1.16  2004/09/09 20:09:30  peiyongz
  + * getDataOverflowed()
  + *
    * Revision 1.15  2004/09/08 13:56:24  peiyongz
    * Apache License Version 2.0
    *
  @@ -154,36 +157,33 @@
       // check if overflow/underflow occurs
       if (errno == ERANGE)
       {
  +
  +        fDataConverted = true;
  +
           if ( fValue < 0 )
           {
               if (fValue > (-1)*DBL_MIN)
               {
  -                fDataConverted = true;
                   fValue = 0;
               }
               else
               {
                   fType = NegINF;
  -                fDataConverted = true;
  +                fDataOverflowed = true;
               }
           }
           else if ( fValue > 0)
           {
               if (fValue < DBL_MIN )
               {
  -                fDataConverted = true;
                   fValue = 0;
               }
               else
               {
                   fType = PosINF;
  -                fDataConverted = true;
  +                fDataOverflowed = true;
               }
           }
  -        else
  -        {
  -            fDataConverted = true;
  -        }
       }
       else
       {
  @@ -194,6 +194,7 @@
           {
               fType = NegINF;
               fDataConverted = true;
  +            fDataOverflowed = true;
           }
           else if (fValue > (-1)*FLT_MIN && fValue < 0)
           {
  @@ -209,6 +210,7 @@
           {
               fType = PosINF;
               fDataConverted = true;
  +            fDataOverflowed = true;
           }
       }
   }
  
  
  
  1.15      +9 -9      xml-xerces/c/src/xercesc/util/XMLDouble.cpp
  
  Index: XMLDouble.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLDouble.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XMLDouble.cpp	8 Sep 2004 13:56:24 -0000	1.14
  +++ XMLDouble.cpp	9 Sep 2004 20:09:30 -0000	1.15
  @@ -17,6 +17,9 @@
   /*
    * $Id$
    * $Log$
  + * Revision 1.15  2004/09/09 20:09:30  peiyongz
  + * getDataOverflowed()
  + *
    * Revision 1.14  2004/09/08 13:56:24  peiyongz
    * Apache License Version 2.0
    *
  @@ -159,35 +162,32 @@
       // check if overflow/underflow occurs
       if (errno == ERANGE)
       {
  +            
  +        fDataConverted = true;
  +
           if ( fValue < 0 )
           {
               if (fValue > (-1)*DBL_MIN)
               {
  -                fDataConverted = true;
                   fValue = 0;
               }
               else
               {
                   fType = NegINF;
  -                fDataConverted = true;
  +                fDataOverflowed = true;
               }
           }
           else if ( fValue > 0)
           {
               if (fValue < DBL_MIN )
               {
  -                fDataConverted = true;
                   fValue = 0;
               }
               else
               {
                   fType = PosINF;
  -                fDataConverted = true;
  +                fDataOverflowed = true;
               }
  -        }
  -        else
  -        {
  -            fDataConverted = true;
           }
   
       }
  
  
  
  1.24      +12 -1     xml-xerces/c/src/xercesc/util/XMLAbstractDoubleFloat.hpp
  
  Index: XMLAbstractDoubleFloat.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLAbstractDoubleFloat.hpp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- XMLAbstractDoubleFloat.hpp	8 Sep 2004 13:56:23 -0000	1.23
  +++ XMLAbstractDoubleFloat.hpp	9 Sep 2004 20:09:30 -0000	1.24
  @@ -17,6 +17,9 @@
   /*
    * $Id$
    * $Log$
  + * Revision 1.24  2004/09/09 20:09:30  peiyongz
  + * getDataOverflowed()
  + *
    * Revision 1.23  2004/09/08 13:56:23  peiyongz
    * Apache License Version 2.0
    *
  @@ -175,6 +178,8 @@
   
       inline  bool          isDataConverted()  const;
   
  +    inline  bool          isDataOverflowed()  const;
  +
       inline  double        getValue() const;
   
       /***
  @@ -246,6 +251,7 @@
       double                  fValue;
       LiteralType             fType;
       bool                    fDataConverted;
  +    bool                    fDataOverflowed;
   
   private:
       int                     fSign;
  @@ -277,6 +283,11 @@
   inline bool XMLAbstractDoubleFloat::isDataConverted() const
   {
       return fDataConverted;
  +}
  +
  +inline bool XMLAbstractDoubleFloat::isDataOverflowed() const
  +{
  +    return fDataOverflowed;
   }
   
   inline double XMLAbstractDoubleFloat::getValue() const
  
  
  
  1.29      +5 -1      xml-xerces/c/src/xercesc/util/XMLAbstractDoubleFloat.cpp
  
  Index: XMLAbstractDoubleFloat.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLAbstractDoubleFloat.cpp,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- XMLAbstractDoubleFloat.cpp	8 Sep 2004 13:56:23 -0000	1.28
  +++ XMLAbstractDoubleFloat.cpp	9 Sep 2004 20:09:30 -0000	1.29
  @@ -17,6 +17,9 @@
   /*
    * $Id$
    * $Log$
  + * Revision 1.29  2004/09/09 20:09:30  peiyongz
  + * getDataOverflowed()
  + *
    * Revision 1.28  2004/09/08 13:56:23  peiyongz
    * Apache License Version 2.0
    *
  @@ -140,6 +143,7 @@
   : fValue(0)
   , fType(Normal)
   , fDataConverted(false)
  +, fDataOverflowed(false)
   , fSign(0)
   , fRawData(0)
   , fFormattedString(0)
  
  
  

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