diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-11-09 02:57:23 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-11-09 02:57:23 +0000 |
commit | 11977a4239feee970dee6a5a29e61bb8e36ff9a0 (patch) | |
tree | fb7a8462d1b38e1dc7ade36e7601fce1f1d29927 | |
parent | ca68ea18621523e959e06361efd0e43abbe32dc9 (diff) | |
download | gcc-11977a4239feee970dee6a5a29e61bb8e36ff9a0.zip gcc-11977a4239feee970dee6a5a29e61bb8e36ff9a0.tar.gz gcc-11977a4239feee970dee6a5a29e61bb8e36ff9a0.tar.bz2 |
codecvt.h (codecvt::do_out): Make it const-correct.
* include/bits/codecvt.h (codecvt::do_out): Make it const-correct.
(codecvt::do_in): Likewise.
From-SVN: r37332
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/codecvt.h | 12 |
2 files changed, 11 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9991f0a..55ca9e0 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2000-11-08 Mark Mitchell <mark@codesourcery.com> + + * include/bits/codecvt.h (codecvt::do_out): Make it const-correct. + (codecvt::do_in): Likewise. + 2000-11-08 David Edelsohn <edelsohn@gnu.org> * src/locale-inst.cc: Add explicit instantiations of diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h index f39009a..1c0d413 100644 --- a/libstdc++-v3/include/bits/codecvt.h +++ b/libstdc++-v3/include/bits/codecvt.h @@ -393,7 +393,7 @@ namespace std // Argument list for iconv specifies a byte sequence. Thus, // all to/from arrays must be brutally casted to char*. char* __cto = reinterpret_cast<char*>(__to); - char* __cfrom; + const char* __cfrom; size_t __conv; // Some encodings need a byte order marker as the first item @@ -408,13 +408,13 @@ namespace std intern_type __cfixed[__size + 1]; __cfixed[0] = static_cast<intern_type>(__int_bom); char_traits<intern_type>::copy(__cfixed + 1, __from, __size); - __cfrom = reinterpret_cast<char*>(__cfixed); + __cfrom = reinterpret_cast<const char*>(__cfixed); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); } else { intern_type* __cfixed = const_cast<intern_type*>(__from); - __cfrom = reinterpret_cast<char*>(__cfixed); + __cfrom = reinterpret_cast<const char*>(__cfixed); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); } @@ -495,7 +495,7 @@ namespace std // Argument list for iconv specifies a byte sequence. Thus, // all to/from arrays must be brutally casted to char*. char* __cto = reinterpret_cast<char*>(__to); - char* __cfrom; + const char* __cfrom; size_t __conv; // Some encodings need a byte order marker as the first item @@ -510,13 +510,13 @@ namespace std extern_type __cfixed[__size + 1]; __cfixed[0] = static_cast<extern_type>(__ext_bom); char_traits<extern_type>::copy(__cfixed + 1, __from, __size); - __cfrom = reinterpret_cast<char*>(__cfixed); + __cfrom = reinterpret_cast<const char*>(__cfixed); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); } else { extern_type* __cfixed = const_cast<extern_type*>(__from); - __cfrom = reinterpret_cast<char*>(__cfixed); + __cfrom = reinterpret_cast<const char*>(__cfixed); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); } |