Skip to content

Commit b1aa845

Browse files
authored
[libc++][NFC] Consistently qualify calls to C functions in <fstream> (#144539)
1 parent 667c786 commit b1aa845

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libcxx/include/fstream

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ basic_filebuf<_CharT, _Traits>* basic_filebuf<_CharT, _Traits>::open(const char*
696696
if (!__mdstr)
697697
return nullptr;
698698

699-
return __do_open(fopen(__s, __mdstr), __mode);
699+
return __do_open(std::fopen(__s, __mdstr), __mode);
700700
}
701701

702702
template <class _CharT, class _Traits>
@@ -761,7 +761,7 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>
761761
std::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));
762762
if (__always_noconv_) {
763763
size_t __nmemb = static_cast<size_t>(this->egptr() - this->eback() - __unget_sz);
764-
__nmemb = ::fread(this->eback() + __unget_sz, 1, __nmemb, __file_);
764+
__nmemb = std::fread(this->eback() + __unget_sz, 1, __nmemb, __file_);
765765
if (__nmemb != 0) {
766766
this->setg(this->eback(), this->eback() + __unget_sz, this->eback() + __unget_sz + __nmemb);
767767
__c = traits_type::to_int_type(*this->gptr());
@@ -778,7 +778,7 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>
778778
std::min(static_cast<size_t>(__ibs_ - __unget_sz), static_cast<size_t>(__extbufend_ - __extbufnext_));
779779
codecvt_base::result __r;
780780
__st_last_ = __st_;
781-
size_t __nr = fread((void*)const_cast<char*>(__extbufnext_), 1, __nmemb, __file_);
781+
size_t __nr = std::fread((void*)const_cast<char*>(__extbufnext_), 1, __nmemb, __file_);
782782
if (__nr != 0) {
783783
if (!__cv_)
784784
std::__throw_bad_cast();
@@ -855,7 +855,7 @@ typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>
855855
return traits_type::eof();
856856
} else if (__r == codecvt_base::ok || __r == codecvt_base::partial) {
857857
size_t __nmemb = static_cast<size_t>(__extbe - __extbuf_);
858-
if (fwrite(__extbuf_, 1, __nmemb, __file_) != __nmemb)
858+
if (std::fwrite(__extbuf_, 1, __nmemb, __file_) != __nmemb)
859859
return traits_type::eof();
860860
if (__r == codecvt_base::partial) {
861861
this->setp(const_cast<char_type*>(__e), this->pptr());
@@ -990,12 +990,12 @@ int basic_filebuf<_CharT, _Traits>::sync() {
990990
char* __extbe;
991991
__r = __cv_->unshift(__st_, __extbuf_, __extbuf_ + __ebs_, __extbe);
992992
size_t __nmemb = static_cast<size_t>(__extbe - __extbuf_);
993-
if (fwrite(__extbuf_, 1, __nmemb, __file_) != __nmemb)
993+
if (std::fwrite(__extbuf_, 1, __nmemb, __file_) != __nmemb)
994994
return -1;
995995
} while (__r == codecvt_base::partial);
996996
if (__r == codecvt_base::error)
997997
return -1;
998-
if (fflush(__file_))
998+
if (std::fflush(__file_))
999999
return -1;
10001000
} else if (__cm_ & ios_base::in) {
10011001
off_type __c;

0 commit comments

Comments
 (0)