Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
curioyang committed Apr 30, 2024
1 parent 4e500a8 commit 6f0ded7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/Native/include/nncase/runtime/char_array_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,36 @@ class char_array_buffer : public std::streambuf {
: begin_(data.begin()), end_(data.end()), current_(data.data()) {}

private:
int_type underflow() {
int_type underflow() override {
if (current_ == end_)
return traits_type::eof();

return traits_type::to_int_type(*current_);
}

int_type uflow() {
int_type uflow() override {
if (current_ == end_)
return traits_type::eof();

return traits_type::to_int_type(*current_++);
}

int_type pbackfail(int_type ch) {
int_type pbackfail(int_type ch) override {
if (current_ == begin_ ||
(ch != traits_type::eof() && ch != current_[-1]))
return traits_type::eof();

return traits_type::to_int_type(*--current_);
}

std::streamsize showmanyc() {
std::streamsize showmanyc() override {
assert(std::less_equal<const char *>()(current_, end_));
return end_ - current_;
}

std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way,
[[maybe_unused]] std::ios_base::openmode which) {
std::streampos
seekoff(std::streamoff off, std::ios_base::seekdir way,
[[maybe_unused]] std::ios_base::openmode which) override {
if (way == std::ios_base::beg) {
current_ = begin_ + off;
} else if (way == std::ios_base::cur) {
Expand All @@ -67,8 +68,9 @@ class char_array_buffer : public std::streambuf {
return current_ - begin_;
}

std::streampos seekpos(std::streampos sp,
[[maybe_unused]] std::ios_base::openmode which) {
std::streampos
seekpos(std::streampos sp,
[[maybe_unused]] std::ios_base::openmode which) override {
current_ = begin_ + sp;

if (current_ < begin_ || current_ > end_)
Expand Down

0 comments on commit 6f0ded7

Please sign in to comment.