Commit 11977a42 by Mark Mitchell Committed by Mark Mitchell

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
parent ca68ea18
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> 2000-11-08 David Edelsohn <edelsohn@gnu.org>
* src/locale-inst.cc: Add explicit instantiations of * src/locale-inst.cc: Add explicit instantiations of
......
...@@ -393,7 +393,7 @@ namespace std ...@@ -393,7 +393,7 @@ namespace std
// Argument list for iconv specifies a byte sequence. Thus, // Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*. // all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to); char* __cto = reinterpret_cast<char*>(__to);
char* __cfrom; const char* __cfrom;
size_t __conv; size_t __conv;
// Some encodings need a byte order marker as the first item // Some encodings need a byte order marker as the first item
...@@ -408,13 +408,13 @@ namespace std ...@@ -408,13 +408,13 @@ namespace std
intern_type __cfixed[__size + 1]; intern_type __cfixed[__size + 1];
__cfixed[0] = static_cast<intern_type>(__int_bom); __cfixed[0] = static_cast<intern_type>(__int_bom);
char_traits<intern_type>::copy(__cfixed + 1, __from, __size); 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); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen);
} }
else else
{ {
intern_type* __cfixed = const_cast<intern_type*>(__from); 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); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen);
} }
...@@ -495,7 +495,7 @@ namespace std ...@@ -495,7 +495,7 @@ namespace std
// Argument list for iconv specifies a byte sequence. Thus, // Argument list for iconv specifies a byte sequence. Thus,
// all to/from arrays must be brutally casted to char*. // all to/from arrays must be brutally casted to char*.
char* __cto = reinterpret_cast<char*>(__to); char* __cto = reinterpret_cast<char*>(__to);
char* __cfrom; const char* __cfrom;
size_t __conv; size_t __conv;
// Some encodings need a byte order marker as the first item // Some encodings need a byte order marker as the first item
...@@ -510,13 +510,13 @@ namespace std ...@@ -510,13 +510,13 @@ namespace std
extern_type __cfixed[__size + 1]; extern_type __cfixed[__size + 1];
__cfixed[0] = static_cast<extern_type>(__ext_bom); __cfixed[0] = static_cast<extern_type>(__ext_bom);
char_traits<extern_type>::copy(__cfixed + 1, __from, __size); 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); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen);
} }
else else
{ {
extern_type* __cfixed = const_cast<extern_type*>(__from); 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); __conv = iconv(*__desc, &__cfrom, &__flen, &__cto, &__tlen);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment