Author: sebor
Date: Mon Apr 21 20:24:44 2008
New Revision: 650367

URL: http://svn.apache.org/viewvc?rev=650367&view=rev
Log:
2008-04-21  Martin Sebor  <[EMAIL PROTECTED]>

        * include/valarray.cc (shift, cshift): Removed assumptions about
        value_type being constructible from int. Revealed by regression
        test for STDCXX-316 committed in rev 650366.
        (cshift): Replaced a functional cast involving _RWSTD_PTRDIFF_T
        with a C-style one in case the macro expands to something like
        "signed long."

Modified:
    stdcxx/trunk/include/valarray.cc

Modified: stdcxx/trunk/include/valarray.cc
URL: 
http://svn.apache.org/viewvc/stdcxx/trunk/include/valarray.cc?rev=650367&r1=650366&r2=650367&view=diff
==============================================================================
--- stdcxx/trunk/include/valarray.cc (original)
+++ stdcxx/trunk/include/valarray.cc Mon Apr 21 20:24:44 2008
@@ -22,7 +22,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2008 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -37,7 +37,7 @@
         return *this;
 
     if (size () <= (_RWSTD_SIZE_T)(__n < 0 ? -__n : __n))
-        return valarray (_TypeT (0), size ());
+        return valarray (_TypeT (), size ());
         
     _RW::__rw_array <_TypeT> __tmp (_TypeT (0), size ());
 
@@ -56,13 +56,13 @@
 {
     // compute non-negative modulus - the sign of (a % b) is
     // implementation-defined if either argument is negative (5.6, p4)
-    _RWSTD_PTRDIFF_T __mod = size () ? __n % _RWSTD_PTRDIFF_T (size ()) : 0;
+    _RWSTD_PTRDIFF_T __mod = size () ? __n % (_RWSTD_PTRDIFF_T)size () : 0;
     _RWSTD_SIZE_T    __rem = __mod < 0 ? -__mod : __mod;
 
     if (0 == __rem)
         return *this;
 
-    _RW::__rw_array<_TypeT> __tmp (_TypeT (0), size ());
+    _RW::__rw_array<_TypeT> __tmp (_TypeT (), size ());
 
     // 26.3.2.7, p7 - negative n rotates right, positive left
     rotate_copy (_C_array.begin (),


Reply via email to