You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2002/04/11 07:53:43 UTC

cvs commit: xml-xalan/c/src/XPath FunctionCeiling.cpp FunctionFloor.cpp FunctionSubstring.cpp FunctionSum.cpp XObject.cpp XPathProcessorImpl.cpp

dbertoni    02/04/10 22:53:43

  Modified:    c/src/XPath FunctionCeiling.cpp FunctionFloor.cpp
                        FunctionSubstring.cpp FunctionSum.cpp XObject.cpp
                        XPathProcessorImpl.cpp
  Log:
  Cleanup for picky compilers.
  
  Revision  Changes    Path
  1.8       +4 -0      xml-xalan/c/src/XPath/FunctionCeiling.cpp
  
  Index: FunctionCeiling.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionCeiling.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionCeiling.cpp	20 Sep 2001 18:05:34 -0000	1.7
  +++ FunctionCeiling.cpp	11 Apr 2002 05:53:43 -0000	1.8
  @@ -83,7 +83,11 @@
   {
   	assert(arg1.null() == false);
   
  +#if defined(XALAN_STRICT_ANSI_HEADERS)
  +	return executionContext.getXObjectFactory().createNumber(std::ceil(arg1->num()));
  +#else
   	return executionContext.getXObjectFactory().createNumber(ceil(arg1->num()));
  +#endif
   }
   
   
  
  
  
  1.8       +4 -0      xml-xalan/c/src/XPath/FunctionFloor.cpp
  
  Index: FunctionFloor.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionFloor.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionFloor.cpp	20 Sep 2001 18:05:34 -0000	1.7
  +++ FunctionFloor.cpp	11 Apr 2002 05:53:43 -0000	1.8
  @@ -83,7 +83,11 @@
   {	
   	assert(arg1.null() == false);	
   
  +#if defined(XALAN_STRICT_ANSI_HEADERS)
  +	return executionContext.getXObjectFactory().createNumber(std::floor(arg1->num()));
  +#else
   	return executionContext.getXObjectFactory().createNumber(floor(arg1->num()));
  +#endif
   }
   
   
  
  
  
  1.17      +12 -2     xml-xalan/c/src/XPath/FunctionSubstring.cpp
  
  Index: FunctionSubstring.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSubstring.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- FunctionSubstring.cpp	7 Mar 2002 05:35:48 -0000	1.16
  +++ FunctionSubstring.cpp	11 Apr 2002 05:53:43 -0000	1.17
  @@ -144,7 +144,7 @@
   			double						theSecondArgValue,
   			const XObjectPtr&			arg3)
   {
  -	// Total the second and third arguments.  Ithe third argument is
  +	// Total the second and third arguments.  If the third argument is
   	// missing, make it the length of the string + 1 (for XPath
   	// indexing style).
   	if (arg3.null() == true)
  @@ -154,7 +154,7 @@
   	else
   	{
   		const double	theRoundedValue =
  -			DoubleSupport::round(theSecondArgValue + arg3->num());
  +			DoubleSupport::round(DoubleSupport::add(theSecondArgValue, arg3->num()));
   
   		// If there's overflow, then we should return the length of the string + 1.
   		if (DoubleSupport::isPositiveInfinity(theRoundedValue) == true)
  @@ -216,9 +216,19 @@
   	}
   	else
   	{
  +		volatile double		foo = 0.0;
  +
  +		fprintf(stderr, "arg2->num() = '%f'\n", arg2->num());
  +		fprintf(stderr, "0 / 0 = '%f'\n", 0.0 / foo);
  +		fprintf(stderr, "-1 / 0 = '%f'\n", 1.0 / foo);
  +		fprintf(stderr, "1 / 0 = '%f'\n", 1.0 / foo);
  +		fprintf(stderr, "sqrt(-2.01) = '%f'\n", sqrt(-2.01));
  +
   		// Get the value of the second argument...
   		const double	theSecondArgValue =
   			DoubleSupport::round(arg2->num());
  +
  +		fprintf(stderr, "theSecondArgValue = '%f'\n", theSecondArgValue);
   
   		// XPath indexes from 1, so this is the first XPath index....
   		const XalanDOMString::size_type		theStartIndex = getStartIndex(theSecondArgValue, theSourceStringLength);
  
  
  
  1.11      +1 -1      xml-xalan/c/src/XPath/FunctionSum.cpp
  
  Index: FunctionSum.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/FunctionSum.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FunctionSum.cpp	26 Sep 2001 20:58:46 -0000	1.10
  +++ FunctionSum.cpp	11 Apr 2002 05:53:43 -0000	1.11
  @@ -101,7 +101,7 @@
   	{
   		DOMServices::getNodeData(*nl.item(i), theString);
   
  -		sum += DoubleSupport::toDouble(theString);
  +		sum = DoubleSupport::add(sum, DoubleSupport::toDouble(theString));
   
   		clear(theString);
   	}
  
  
  
  1.29      +4 -2      xml-xalan/c/src/XPath/XObject.cpp
  
  Index: XObject.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XObject.cpp,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- XObject.cpp	4 Jan 2002 17:29:07 -0000	1.28
  +++ XObject.cpp	11 Apr 2002 05:53:43 -0000	1.29
  @@ -180,6 +180,8 @@
   
   
   
  +static int foo = 0;
  +
   const ResultTreeFragBase&
   XObject::rtree() const
   {
  @@ -187,9 +189,9 @@
   
   	// This is just a dummy value to satisfy the compiler.
   #if defined(XALAN_OLD_STYLE_CASTS)
  -	return *((ResultTreeFragBase*)0);
  +	return (const ResultTreeFragBase&)foo;
   #else
  -	return *reinterpret_cast<ResultTreeFragBase*>(0);
  +	return reinterpret_cast<const ResultTreeFragBase&>(foo);
   #endif
   }
   
  
  
  
  1.53      +1 -1      xml-xalan/c/src/XPath/XPathProcessorImpl.cpp
  
  Index: XPathProcessorImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathProcessorImpl.cpp,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- XPathProcessorImpl.cpp	3 Apr 2002 05:13:10 -0000	1.52
  +++ XPathProcessorImpl.cpp	11 Apr 2002 05:53:43 -0000	1.53
  @@ -725,7 +725,7 @@
   {
   	const unsigned int	theTokenLength = length(m_token);
   
  -	const unsigned int	theStringLength = strlen(s);
  +	const unsigned int	theStringLength = XalanDOMString::length(s);
   
   	if (theTokenLength != theStringLength)
   	{
  
  
  

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