diff --git a/marisa/marisa.cc b/marisa/marisa.cc index b2f9683..0f3810e 100644 --- a/marisa/marisa.cc +++ b/marisa/marisa.cc @@ -1,6 +1,5 @@ #include #include -#include #include #include diff --git a/marisa/shim.h b/marisa/shim.h index 8a78a46..3f8bff8 100644 --- a/marisa/shim.h +++ b/marisa/shim.h @@ -96,8 +96,8 @@ class iopbuf : public std::basic_streambuf { this->setg(&this->rbuf_, &this->rbuf_, &this->rbuf_ + (n>0 ? n : 0)); // Update the current byte. return this->gptr() == this->egptr() // If the new current pos == past end of buffer, no byte was read (n<=0). - ? iopbuf::traits_type::eof() // If no byte was read (and no error was thrown earlier), it's an EOF. - : iopbuf::traits_type::to_int_type(this->rbuf_); // Otherwise, return the byte we just read (note: without to_int_type, 0xFF would be sign extended to -1/eof). + ? iopbuf::traits_type::eof() // If no byte was read (and no error was thrown earlier), it's an EOF. + : iopbuf::traits_type::to_int_type(this->rbuf_); // Otherwise, return the byte we just read (note: without to_int_type, 0xFF would be sign extended to -1/eof). } std::streamsize xsgetn(iopbuf::char_type* buf, std::streamsize buf_n) override { @@ -113,7 +113,7 @@ class iopbuf : public std::basic_streambuf { this->rbuf_ = n>0 ? buf[n-1] : 0; // Set the current byte to the last one read, if any. this->setg(&this->rbuf_, &this->rbuf_, &this->rbuf_ + (n>0 ? 1 : 0)); // Update the current byte. return this->gptr() == this->egptr() // If the new current pos == past end of buffer, no byte was read (n<=0). - ? iopbuf::traits_type::eof() // If no byte was read (and no error was thrown earlier), it's an EOF + ? iopbuf::traits_type::eof() // If no byte was read (and no error was thrown earlier), it's an EOF : n; // Otherwise, return the number of bytes read. }