OSDN Git Service

2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Aug 2008 01:06:45 +0000 (01:06 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Aug 2008 01:06:45 +0000 (01:06 +0000)
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139367 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/char_traits.h

index 80267a1..64bfa34 100644 (file)
@@ -1,5 +1,11 @@
 2008-08-20  Paolo Carlini  <paolo.carlini@oracle.com>
 
 2008-08-20  Paolo Carlini  <paolo.carlini@oracle.com>
 
+       * include/bits/char_traits.h (char_traits<char16_t>::
+       assign(char_type*, size_t, char_type), char_traits<char32_t>::
+       assign(char_type*, size_t, char_type)): For now, just open-code.
+
+2008-08-20  Paolo Carlini  <paolo.carlini@oracle.com>
+
        PR c++/33979 (partial)
        * include/bits/postypes.h (u16streampos, u32streampos): Add.
        * include/bits/char_traits.h (char_traits<char16_t>,
        PR c++/33979 (partial)
        * include/bits/postypes.h (u16streampos, u32streampos): Add.
        * include/bits/char_traits.h (char_traits<char16_t>,
index 9dac222..77a634b 100644 (file)
@@ -298,7 +298,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       { return __c1 == __c2; }
 
       static int_type
       { return __c1 == __c2; }
 
       static int_type
-      eof() { return static_cast<int_type>(_CHAR_TRAITS_EOF); }
+      eof()
+      { return static_cast<int_type>(_CHAR_TRAITS_EOF); }
 
       static int_type
       not_eof(const int_type& __c)
 
       static int_type
       not_eof(const int_type& __c)
@@ -354,17 +355,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       { return wmemset(__s, __a, __n); }
 
       static char_type
       { return wmemset(__s, __a, __n); }
 
       static char_type
-      to_char_type(const int_type& __c) { return char_type(__c); }
+      to_char_type(const int_type& __c)
+      { return char_type(__c); }
 
       static int_type
 
       static int_type
-      to_int_type(const char_type& __c) { return int_type(__c); }
+      to_int_type(const char_type& __c)
+      { return int_type(__c); }
 
       static bool
       eq_int_type(const int_type& __c1, const int_type& __c2)
       { return __c1 == __c2; }
 
       static int_type
 
       static bool
       eq_int_type(const int_type& __c1, const int_type& __c2)
       { return __c1 == __c2; }
 
       static int_type
-      eof() { return static_cast<int_type>(WEOF); }
+      eof()
+      { return static_cast<int_type>(WEOF); }
 
       static int_type
       not_eof(const int_type& __c)
 
       static int_type
       not_eof(const int_type& __c)
@@ -447,23 +451,27 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
       static char_type*
       assign(char_type* __s, size_t __n, char_type __a)
 
       static char_type*
       assign(char_type* __s, size_t __n, char_type __a)
-      { 
-       std::fill_n(__s, __n, __a);
+      {
+       for (size_t __i = 0; __i < __n; ++__i)
+         assign(__s[__i], __a);
        return __s;
       }
 
       static char_type
        return __s;
       }
 
       static char_type
-      to_char_type(const int_type& __c) { return char_type(__c); }
+      to_char_type(const int_type& __c)
+      { return char_type(__c); }
 
       static int_type
 
       static int_type
-      to_int_type(const char_type& __c) { return int_type(__c); }
+      to_int_type(const char_type& __c)
+      { return int_type(__c); }
 
       static bool
       eq_int_type(const int_type& __c1, const int_type& __c2)
       { return __c1 == __c2; }
 
       static int_type
 
       static bool
       eq_int_type(const int_type& __c1, const int_type& __c2)
       { return __c1 == __c2; }
 
       static int_type
-      eof() { return static_cast<int_type>(-1); }
+      eof()
+      { return static_cast<int_type>(-1); }
 
       static int_type
       not_eof(const int_type& __c)
 
       static int_type
       not_eof(const int_type& __c)
@@ -537,22 +545,26 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       static char_type*
       assign(char_type* __s, size_t __n, char_type __a)
       {
       static char_type*
       assign(char_type* __s, size_t __n, char_type __a)
       {
-       std::fill_n(__s, __n, __a);
+       for (size_t __i = 0; __i < __n; ++__i)
+         assign(__s[__i], __a);
        return __s;
       }
 
       static char_type
        return __s;
       }
 
       static char_type
-      to_char_type(const int_type& __c) { return char_type(__c); }
+      to_char_type(const int_type& __c)
+      { return char_type(__c); }
 
       static int_type
 
       static int_type
-      to_int_type(const char_type& __c) { return int_type(__c); }
+      to_int_type(const char_type& __c)
+      { return int_type(__c); }
 
       static bool
       eq_int_type(const int_type& __c1, const int_type& __c2)
       { return __c1 == __c2; }
 
       static int_type
 
       static bool
       eq_int_type(const int_type& __c1, const int_type& __c2)
       { return __c1 == __c2; }
 
       static int_type
-      eof() { return static_cast<int_type>(-1); }
+      eof()
+      { return static_cast<int_type>(-1); }
 
       static int_type
       not_eof(const int_type& __c)
 
       static int_type
       not_eof(const int_type& __c)