Skip to content

Commit

Permalink
allow cbuf as chain
Browse files Browse the repository at this point in the history
  • Loading branch information
Links2004 committed Jan 26, 2016
1 parent 46c096b commit fa38ce4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cores/esp8266/cbuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "c_types.h"

cbuf::cbuf(size_t size) :
_size(size), _buf(new char[size]), _bufend(_buf + size), _begin(_buf), _end(_begin) {
next(NULL), _size(size), _buf(new char[size]), _bufend(_buf + size), _begin(_buf), _end(_begin) {
}

cbuf::~cbuf() {
Expand Down
3 changes: 3 additions & 0 deletions cores/esp8266/cbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class cbuf {
void flush();
size_t remove(size_t size);

cbuf *next;

private:
inline char* wrap_if_bufend(char* ptr) const {
return (ptr == _bufend) ? _buf : ptr;
Expand All @@ -66,6 +68,7 @@ class cbuf {
const char* _bufend;
char* _begin;
char* _end;

};

#endif//__cbuf_h

0 comments on commit fa38ce4

Please sign in to comment.