Author: sebor
Date: Sat Jan 7 16:42:36 2006
New Revision: 366965
URL: http://svn.apache.org/viewcvs?rev=366965&view=rev
Log:
2006-01-07 Martin Sebor <[EMAIL PROTECTED]>
* fstream.cc (underflow): Used char_traits::move() instead of memmove.
* _messages.cc (do_get): Used char_traits::length() instead of strlen.
Modified:
incubator/stdcxx/trunk/include/fstream.cc
incubator/stdcxx/trunk/include/loc/_messages.cc
Modified: incubator/stdcxx/trunk/include/fstream.cc
URL:
http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/fstream.cc?rev=366965&r1=366964&r2=366965&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/fstream.cc (original)
+++ incubator/stdcxx/trunk/include/fstream.cc Sat Jan 7 16:42:36 2006
@@ -3,7 +3,7 @@
*
* fstream.cc - Definition for the Standard Library file streams
*
- * $Id: //stdlib/dev/include/fstream.cc#54 $
+ * $Id$
*
***************************************************************************
*
@@ -261,8 +261,10 @@
// compute the length of partially converted sequence
__n -= __from_next - __xbuf;
+ typedef char_traits<char> CharTraits;
+
// copy the sequence to beginning of xbuf
- memmove (__xbuf, __from_next, __n);
+ CharTraits::move (__xbuf, __from_next, __n);
// will append external chars to end of the sequence
__from_base = __xbuf + __n;
Modified: incubator/stdcxx/trunk/include/loc/_messages.cc
URL:
http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/loc/_messages.cc?rev=366965&r1=366964&r2=366965&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/loc/_messages.cc (original)
+++ incubator/stdcxx/trunk/include/loc/_messages.cc Sat Jan 7 16:42:36 2006
@@ -2,7 +2,7 @@
*
* _messages.cc - definition of std::messages members
*
- * $Id: //stdlib/dev/include/loc/_messages.cc#24 $
+ * $Id$
*
***************************************************************************
*
@@ -52,18 +52,20 @@
return _RWSTD_REINTERPRET_CAST (const _CharT*, __text);
}
- const _RWSTD_SIZE_T __src_length = strlen (__text);
+ typedef char_traits<char> CharTraits;
+
+ const _RWSTD_SIZE_T __src_len = CharTraits::length (__text);
const char* const __src_first = __text;
- const char* const __src_last = __text + __src_length;
+ const char* const __src_last = __text + __src_len;
const char* __src_next = __src_first;
// allocate a [wide] string large enough to hold at least
// as many internal characters as there are bytes in the
// multibyte characater message
- string_type __result_str ((const _CharT*)0, __src_length);
+ string_type __result_str ((const _CharT*)0, __src_len);
_CharT* const __dst_first = &__result_str [0];
- _CharT* const __dst_last = __dst_first + __src_length;
+ _CharT* const __dst_last = __dst_first + __src_len;
_CharT* __dst_next = __dst_first;
state_type __state = state_type ();
@@ -92,7 +94,7 @@
const _Ctype& __ctp =
_V3_USE_FACET (_Ctype, _RW::__rw_get_locale (__cat));
- for (_RWSTD_SIZE_T __i = 0; __i != __src_length; ++__i)
+ for (_RWSTD_SIZE_T __i = 0; __i != __src_len; ++__i)
__dst_first [__i] = __ctp.widen (__text [__i]);
return __result_str;