diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2017-06-14 20:00:36 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2017-06-14 20:00:36 +0000 |
commit | ff5f9b28baebd8c9a0ce36350fc46edabac52a8e (patch) | |
tree | 60a32aee280948820052d84e52494633231da729 /include/fstream | |
parent | 899f113f6c12fb633ef1707afbd0a215eaac320d (diff) |
Add some const_casts in places where we were implicitly casting away constness. No functional change, but now they're explicit
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305410 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/fstream')
-rw-r--r-- | include/fstream | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/fstream b/include/fstream index e41a53af4..ffd569839 100644 --- a/include/fstream +++ b/include/fstream @@ -617,7 +617,7 @@ basic_filebuf<_CharT, _Traits>::underflow() static_cast<size_t>(__extbufend_ - __extbufnext_)); codecvt_base::result __r; __st_last_ = __st_; - size_t __nr = fread((void*)__extbufnext_, 1, __nmemb, __file_); + size_t __nr = fread((void*) const_cast<char *>(__extbufnext_), 1, __nmemb, __file_); if (__nr != 0) { if (!__cv_) @@ -630,7 +630,8 @@ basic_filebuf<_CharT, _Traits>::underflow() this->eback() + __ibs_, __inext); if (__r == codecvt_base::noconv) { - this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, (char_type*)__extbufend_); + this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, + (char_type*)const_cast<char *>(__extbufend_)); __c = traits_type::to_int_type(*this->gptr()); } else if (__inext != this->eback() + __unget_sz) @@ -722,7 +723,7 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c) return traits_type::eof(); if (__r == codecvt_base::partial) { - this->setp((char_type*)__e, this->pptr()); + this->setp(const_cast<char_type*>(__e), this->pptr()); this->pbump(this->epptr() - this->pbase()); } } |