Skip to content

Commit

Permalink
buffer: remove redundant function
Browse files Browse the repository at this point in the history
For some reason we ended up with two identical functions: buffer_{clear,terminate}.
  • Loading branch information
martanne committed Jan 7, 2017
1 parent c71760a commit b812d77
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ bool buffer_grow(Buffer *buf, size_t size) {
return true;
}

void buffer_truncate(Buffer *buf) {
buf->len = 0;
}

bool buffer_terminate(Buffer *buf) {
return !buf->data || buf->len == 0 || buf->data[buf->len-1] == '\0' ||
buffer_append(buf, "\0", 1);
Expand Down
2 changes: 0 additions & 2 deletions buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ void buffer_release(Buffer*);
void buffer_clear(Buffer*);
/* reserve space to store at least size bytes in this buffer.*/
bool buffer_grow(Buffer*, size_t size);
/* truncate buffer, but keep associated memory region for further data */
void buffer_truncate(Buffer*);
/* if buffer is not empty, make sure it is NUL terminated */
bool buffer_terminate(Buffer*);
/* replace buffer content with given data, growing the buffer if needed */
Expand Down
2 changes: 1 addition & 1 deletion vis-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ typedef struct {
typedef Buffer Macro;
#define macro_init buffer_init
#define macro_release buffer_release
#define macro_reset buffer_truncate
#define macro_reset buffer_clear
#define macro_append buffer_append0

typedef struct { /** collects all information until an operator is executed */
Expand Down

0 comments on commit b812d77

Please sign in to comment.