stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r638382 - in /stdcxx/trunk: include/fstream include/istream src/podarray.h
Date Tue, 18 Mar 2008 14:22:19 GMT
Author: faridz
Date: Tue Mar 18 07:22:15 2008
New Revision: 638382

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

	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/trunk/include/fstream
    stdcxx/trunk/include/istream
    stdcxx/trunk/src/podarray.h

Modified: stdcxx/trunk/include/fstream
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/fstream?rev=638382&r1=638381&r2=638382&view=diff
==============================================================================
--- stdcxx/trunk/include/fstream (original)
+++ stdcxx/trunk/include/fstream Tue Mar 18 07:22:15 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/trunk/include/istream
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/istream?rev=638382&r1=638381&r2=638382&view=diff
==============================================================================
--- stdcxx/trunk/include/istream (original)
+++ stdcxx/trunk/include/istream Tue Mar 18 07:22:15 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/trunk/src/podarray.h
URL: http://svn.apache.org/viewvc/stdcxx/trunk/src/podarray.h?rev=638382&r1=638381&r2=638382&view=diff
==============================================================================
--- stdcxx/trunk/src/podarray.h (original)
+++ stdcxx/trunk/src/podarray.h Tue Mar 18 07:22:15 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
     }
 };
 



Mime
View raw message