stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r660548 - /stdcxx/branches/4.3.x/src/num_put.cpp
Date Tue, 27 May 2008 15:01:45 GMT
Author: sebor
Date: Tue May 27 08:01:43 2008
New Revision: 660548

URL: http://svn.apache.org/viewvc?rev=660548&view=rev
Log:
2008-05-27  Martin Sebor  <sebor@roguewave.com>

	Completed the merge of rev 659199 from 4.2.x, the first part of which
	was committed in rev 660350.

	2008-05-22  Martin Sebor  <sebor@roguewave.com>

	* src/num_put.cpp (__rw_isfinite, __rw_signbit, __rw_isinf,
	__rw_isnan, __rw_isqnan, __rw_issnan): Moved inline functions to
	the new fpclass.h header.

	Also merged the first part of rev 651034.

	2008-04-23  Martin Sebor  <sebor@roguewave.com>

	* src/num_put.cpp (__rw_fmat_infinite): Silence HP aCC remark #2826-D:
	parameter was never referenced.

Modified:
    stdcxx/branches/4.3.x/src/num_put.cpp

Modified: stdcxx/branches/4.3.x/src/num_put.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/src/num_put.cpp?rev=660548&r1=660547&r2=660548&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/src/num_put.cpp (original)
+++ stdcxx/branches/4.3.x/src/num_put.cpp Tue May 27 08:01:43 2008
@@ -34,15 +34,9 @@
 #include <stdio.h>    // for snprintf()
 #include <string.h>   // for memmove(), memset()
 
-#include <float.h>   // for _finite(), _fpclass(), _isnan(), _copysign()
-#include <math.h>    // for isfinite(), isnan(), isinf(), signbit()
-
-#ifndef _RWSTD_NO_IEEEFP_H
-#  include <ieeefp.h>   // for fpclass(), isnan()
-#endif   // _RWSTD_NO_IEEEFP_H
-
 #include <loc/_num_put.h>
 
+#include "fpclass.h"  // for __rw_isfinite(), ...
 #include "strtol.h"   // for __rw_digit_map
 #include "punct.h"    // for __rw_get_stdio_fmat
 
@@ -80,161 +74,14 @@
     "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 
 
-#if defined (_MSC_VER)
-
-inline bool __rw_isfinite (double val) { return !!_finite (val); }
-
-inline bool __rw_signbit (double val) { return 0 > _copysign (1., val); }
-
-inline bool __rw_isinf (double val) {
-    const int fpc = _fpclass (val);
-
-    if (_FPCLASS_NINF == fpc) {
-        // verify that __rw_signbit() correctly determines
-        // the sign of negative infinity
-        _RWSTD_ASSERT (__rw_signbit (val));
-        return true;
-    }
-    else if (_FPCLASS_PINF == fpc) {
-        // verify that __rw_signbit() correctly determines
-        // the sign of positive infinity
-        _RWSTD_ASSERT (!__rw_signbit (val));
-        return true;
-    }
-
-    return false;
-}
-
-inline bool __rw_isnan (double val) { return !!_isnan (val); }
-
-inline bool __rw_isqnan (double val) {
-    return _FPCLASS_QNAN == _fpclass (val);
-}
-
-inline bool __rw_issnan (double val) {
-    return _FPCLASS_SNAN == _fpclass (val);
-}
-
-#elif defined (_RWSTD_OS_SUNOS)
-
-inline bool __rw_isfinite (double val) { return !!finite (val); }
-
-inline bool __rw_signbit (double val)
-{
-    // implement own signbit() to avoid dragging in libm or libsunmath
-    return _RWSTD_REINTERPRET_CAST (const _RWSTD_UINT64_T&, val) >> 63;
-}
-
-inline bool __rw_isinf (double val) {
-    const int fpc = fpclass (val);
-
-    if (FP_NINF == fpc) {
-        // verify that __rw_signbit() correctly determines
-        // the sign of negative infinity
-        _RWSTD_ASSERT (__rw_signbit (val));
-        return true;
-    }
-    else if (FP_PINF == fpc) {
-        // verify that __rw_signbit() correctly determines
-        // the sign of positive infinity
-        _RWSTD_ASSERT (!__rw_signbit (val));
-        return true;
-    }
-
-    return false;
-}
-
-inline bool __rw_isnan (double val) { return 0 != isnan (val); }
-
-inline bool __rw_isqnan (double val) { return FP_QNAN == fpclass (val); }
-
-inline bool __rw_issnan (double val) { return FP_SNAN == fpclass (val); }
-
-#elif defined (fpclassify)
-
-inline bool __rw_isfinite (double val) { return !!isfinite (val); }
-
-inline bool __rw_signbit (double val) { return !!signbit (val); }
-
-inline bool __rw_isinf (double val) { return !!isinf (val); }
-
-inline bool __rw_isnan (double val) { return !!isnan (val); }
-
-inline bool __rw_isqnan (double) { return false; }
-
-inline bool __rw_issnan (double) { return false; }
-
-#else
-
-inline bool __rw_isfinite (double) { return true; }
-
-inline bool __rw_signbit (double) { return false; }
-
-inline bool __rw_isinf (double) { return false; }
-
-inline bool __rw_isnan (double) { return false; }
-
-inline bool __rw_isqnan (double) { return false; }
-
-inline bool __rw_issnan (double) { return false; }
-
-#endif
-
-
-inline bool __rw_isfinite (float) { return true; }
-
-inline bool __rw_signbit (float) { return false; }
-
-inline bool __rw_isinf (float) { return false; }
-
-inline bool __rw_isnan (float) { return false; }
-
-inline bool __rw_isqnan (float) { return false; }
-
-inline bool __rw_issnan (float) { return false; }
-
-
-#ifndef _RWSTD_NO_LONG_DOUBLE
-
-#  if _RWSTD_DBL_SIZE == _RWSTD_LDBL_SIZE
-
-inline bool __rw_isfinite (long double x) { return __rw_isfinite (double (x)); }
-
-inline bool __rw_signbit (long double x) { return __rw_signbit (double (x)); }
-
-inline bool __rw_isinf (long double x) { return __rw_isinf (double (x)); }
-
-inline bool __rw_isnan (long double x) { return __rw_isnan (double (x)); }
-
-inline bool __rw_isqnan (long double x) { return __rw_isqnan (double (x)); }
-
-inline bool __rw_issnan (long double x) { return __rw_issnan (double (x)); }
-
-#  else   // _RWSTD_DBL_SIZE != _RWSTD_LDBL_SIZE
-
-inline bool __rw_isfinite (long double) { return true; }
-
-inline bool __rw_signbit (long double) { return false; }
-
-inline bool __rw_isinf (long double) { return false; }
-
-inline bool __rw_isnan (long double) { return false; }
-
-inline bool __rw_isqnan (long double) { return false; }
-
-inline bool __rw_issnan (long double) { return false; }
-
-#  endif   // _RWSTD_DBL_SIZE == _RWSTD_LDBL_SIZE
-
-#endif   // _RWSTD_NO_LONG_DOUBLE
-
-
 static int
 __rw_fmat_infinite (char *buf, size_t bufsize, double val, unsigned flags)
 {
     _RWSTD_ASSERT (!__rw_isfinite (val));
     _RWSTD_ASSERT (5 <= bufsize);
 
+    _RWSTD_UNUSED (bufsize); 
+
     char* end = buf;
     const bool cap = !!(flags & _RWSTD_IOS_UPPERCASE);
 



Mime
View raw message