You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by fa...@apache.org on 2008/03/18 15:27:56 UTC

svn commit: r638384 - in /stdcxx/branches/4.2.x: include/fstream include/istream src/podarray.h

Author: faridz
Date: Tue Mar 18 07:27:54 2008
New Revision: 638384

URL: http://svn.apache.org/viewvc?rev=638384&view=rev
Log:
2008-03-18  Farid Zaripov  <fa...@epam.com>

	Merged r638382 from trunk with a fix for STDCXX-648
	* include/fstream: Change 'class' keyword to 'struct' to hide MSVC warning C4099:
	'std::ios_base::Init' : type name first seen using 'struct' now seen using 'class'.
	* include/istream [_RWSTD_NO_EXT_NUM_GET] (__rw_extract(istream&, short &)):
	New overload, implemented thus__rw_extract<long>.
	[_RWSTD_NO_EXT_NUM_GET] (__rw_extract(istream&, int &)):
	New overload, implemented thus__rw_extract<long>.
	* src/podarray.h (_C_length): Use inplace algorithm instead of
	char_traits::length when _RWSTD_NO_EXT_CHAR_TRAITS_PRIMARY macro is #defined.

Modified:
    stdcxx/branches/4.2.x/include/fstream
    stdcxx/branches/4.2.x/include/istream
    stdcxx/branches/4.2.x/src/podarray.h

Modified: stdcxx/branches/4.2.x/include/fstream
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/fstream?rev=638384&r1=638383&r2=638384&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/fstream (original)
+++ stdcxx/branches/4.2.x/include/fstream Tue Mar 18 07:27:54 2008
@@ -121,7 +121,7 @@
 private:
 
     // g++ 2.95 error: `std::ios_base::Init' does not declare a template type
-    friend class ios_base::Init;
+    friend struct ios_base::Init;
 
 #endif   // _RWSTD_NO_EXT_FILEBUF && !_RWSTD_NO_STATIC_IOSTREAM_INIT
 

Modified: stdcxx/branches/4.2.x/include/istream
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/istream?rev=638384&r1=638383&r2=638384&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/istream (original)
+++ stdcxx/branches/4.2.x/include/istream Tue Mar 18 07:27:54 2008
@@ -55,6 +55,45 @@
 _STD::basic_istream<_CharT, _Traits>&
 __rw_extract (_STD::basic_istream<_CharT, _Traits>&, _NativeType&);
 
+
+#ifdef _RWSTD_NO_EXT_NUM_GET
+
+template <class _CharT, class _Traits>
+inline _STD::basic_istream<_CharT, _Traits>&
+__rw_extract (_STD::basic_istream<_CharT, _Traits> &__strm,
+              short                                &__val)
+{
+    long __tmp = __val;
+    __rw_extract (__strm, __tmp);
+
+    _STD::ios_base::iostate __err = _STD::ios_base::goodbit;
+    __val = __rw_check_overflow_short (__tmp, __strm.flags (), __err);
+
+    if (_STD::ios_base::goodbit != __err)
+        __strm.setstate (__err);
+
+    return __strm;
+}
+
+template <class _CharT, class _Traits>
+inline _STD::basic_istream<_CharT, _Traits>&
+__rw_extract (_STD::basic_istream<_CharT, _Traits> &__strm,
+              int                                  &__val)
+{
+    long __tmp = __val;
+    __rw_extract (__strm, __tmp);
+
+    _STD::ios_base::iostate __err = _STD::ios_base::goodbit;
+    __val = __rw_check_overflow_int (__tmp, __strm.flags (), __err);
+
+    if (_STD::ios_base::goodbit != __err)
+        __strm.setstate (__err);
+
+    return __strm;
+}
+
+#endif   // _RWSTD_NO_EXT_NUM_GET
+
 }   // namespace __rw
 
 

Modified: stdcxx/branches/4.2.x/src/podarray.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/src/podarray.h?rev=638384&r1=638383&r2=638384&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/src/podarray.h (original)
+++ stdcxx/branches/4.2.x/src/podarray.h Tue Mar 18 07:27:54 2008
@@ -198,7 +198,13 @@
 private:
 
     static _RWSTD_SIZE_T _C_length (const _TypeT *__a) {
+#ifndef _RWSTD_NO_EXT_CHAR_TRAITS_PRIMARY
         return _STD::char_traits<_TypeT>::length (__a);
+#else    // #ifdef _RWSTD_NO_EXT_CHAR_TRAITS_PRIMARY
+        _RWSTD_SIZE_T __len = 0;
+        for (; _TypeT () != *__a; ++__a, ++__len) ;
+        return __len;
+#endif   // _RWSTD_NO_EXT_CHAR_TRAITS_PRIMARY
     }
 };