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
This commit is contained in:
Mark Mitchell 2000-11-09 02:57:23 +00:00 committed by Mark Mitchell
parent ca68ea1862
commit 11977a4239
2 changed files with 11 additions and 6 deletions

View File

@ -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

View File

@ -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);
}