From 11977a4239feee970dee6a5a29e61bb8e36ff9a0 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Thu, 9 Nov 2000 02:57:23 +0000 Subject: [PATCH] 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 --- libstdc++-v3/ChangeLog | 5 +++++ 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 9991f0aa37a..55ca9e044a4 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2000-11-08 Mark Mitchell + + * include/bits/codecvt.h (codecvt::do_out): Make it const-correct. + (codecvt::do_in): Likewise. + 2000-11-08 David Edelsohn * 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 f39009a9ea5..1c0d4137436 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(__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(__int_bom); char_traits::copy(__cfixed + 1, __from, __size); - __cfrom = reinterpret_cast(__cfixed); + __cfrom = reinterpret_cast(__cfixed); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); } else { intern_type* __cfixed = const_cast(__from); - __cfrom = reinterpret_cast(__cfixed); + __cfrom = reinterpret_cast(__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(__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(__ext_bom); char_traits::copy(__cfixed + 1, __from, __size); - __cfrom = reinterpret_cast(__cfixed); + __cfrom = reinterpret_cast(__cfixed); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); } else { extern_type* __cfixed = const_cast(__from); - __cfrom = reinterpret_cast(__cfixed); + __cfrom = reinterpret_cast(__cfixed); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen); }