stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r574422 - in /incubator/stdcxx/trunk/src: num_get.cpp num_put.cpp punct.cpp
Date Tue, 11 Sep 2007 01:34:09 GMT
Author: sebor
Date: Mon Sep 10 18:34:08 2007
New Revision: 574422

URL: http://svn.apache.org/viewvc?rev=574422&view=rev
Log:
2007-09-10  Martin Sebor  <sebor@roguewave.com>

	STDCXX-547
	* num_get.cpp (__rw_get_num): Cast a wider type to a narrower one
	to silence Sun C++ 64-bit conversion warnings.
	* num_put.cpp (__rw_get_stdio_fmat): Changed the type of the last
	argument so std::streamsize to make it possible to pass in and
	correctly handle 64-bit values and to aid in silencing 64-bit
	conversion warnings at the call site.
	* punct.cpp (__rw_get_stdio_fmat): Same. Used the %ld formatting
	directive and cast streamsize argument to long before passing it
	to sprintf.

Modified:
    incubator/stdcxx/trunk/src/num_get.cpp
    incubator/stdcxx/trunk/src/num_put.cpp
    incubator/stdcxx/trunk/src/punct.cpp

Modified: incubator/stdcxx/trunk/src/num_get.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/num_get.cpp?rev=574422&r1=574421&r2=574422&view=diff
==============================================================================
--- incubator/stdcxx/trunk/src/num_get.cpp (original)
+++ incubator/stdcxx/trunk/src/num_get.cpp Mon Sep 10 18:34:08 2007
@@ -429,7 +429,7 @@
                     val.ul = _RWSTD_UINT_MAX - val.ul + 1;
             }
 
-            *_RWSTD_STATIC_CAST (unsigned*, pval) = val.ul;
+            *_RWSTD_STATIC_CAST (unsigned*, pval) = unsigned (val.ul);
             break;
 
         case __rw_facet::_C_int:
@@ -458,7 +458,7 @@
 
 #endif   // _RWSTD_UINT_MAX < _RWSTD_ULONG_MAX
 
-            *_RWSTD_STATIC_CAST (int*, pval) = val.l;
+            *_RWSTD_STATIC_CAST (int*, pval) = int (val.l);
             break;
 
         case __rw_facet::_C_ulong:

Modified: incubator/stdcxx/trunk/src/num_put.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/num_put.cpp?rev=574422&r1=574421&r2=574422&view=diff
==============================================================================
--- incubator/stdcxx/trunk/src/num_put.cpp (original)
+++ incubator/stdcxx/trunk/src/num_put.cpp Mon Sep 10 18:34:08 2007
@@ -72,7 +72,8 @@
 
 
 const char*
-__rw_get_stdio_fmat (char buf [32], int type, unsigned fmtflags, int prec);
+__rw_get_stdio_fmat (char buf [32], int type, unsigned fmtflags,
+                     _STD::streamsize prec);
 
 
 #ifdef _RWSTD_LONG_LONG
@@ -414,7 +415,7 @@
         j = 0;
 
     do {
-        const int dig = (i >> (j * bits)) & basemask;
+        const int dig = int ((i >> (j * bits)) & basemask);
 
         _RWSTD_ASSERT (dig >= 0 && dig <= basemask);
 

Modified: incubator/stdcxx/trunk/src/punct.cpp
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/src/punct.cpp?rev=574422&r1=574421&r2=574422&view=diff
==============================================================================
--- incubator/stdcxx/trunk/src/punct.cpp (original)
+++ incubator/stdcxx/trunk/src/punct.cpp Mon Sep 10 18:34:08 2007
@@ -22,7 +22,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 2001-2006 Rogue Wave Software.
+ * Copyright 2001-2007 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -582,7 +582,8 @@
 
 
 const char*
-__rw_get_stdio_fmat (char buf [32], int type, unsigned fmtflags, int prec)
+__rw_get_stdio_fmat (char buf [32], int type, unsigned fmtflags,
+                     _STD::streamsize prec)
 {
     char *pbuf = buf;
 
@@ -608,7 +609,7 @@
             // 7.19.6.1, p5 of C99 specifies that, when given using the
             // asterisk, negative precision is treated the same as if
             // it were omitted; treat negative precision the same here
-            pbuf += sprintf (pbuf, ".%d", prec);
+            pbuf += sprintf (pbuf, ".%ld", long (prec));
         }
     }
     else if (fmtflags & _RWSTD_IOS_SHOWBASE)



Mime
View raw message