diff options
author | Richard Braun <rbraun@sceen.net> | 2017-06-18 20:44:35 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-06-18 20:44:35 +0200 |
commit | 106bb2e3f3e658fcb6af72414f73cc49b32f836d (patch) | |
tree | e7ae2dc89106b3e728ad010edb82a90364ff3205 | |
parent | cf1c3901ead1182129c65c63b2035febecc36f64 (diff) |
kern/cbuf: use void pointers with cbuf_read and cbuf_write
-rw-r--r-- | kern/cbuf.c | 4 | ||||
-rw-r--r-- | kern/cbuf.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/kern/cbuf.c b/kern/cbuf.c index 83032e50..c38cc1dc 100644 --- a/kern/cbuf.c +++ b/kern/cbuf.c @@ -73,7 +73,7 @@ cbuf_pop(struct cbuf *cbuf, char *bytep) } int -cbuf_write(struct cbuf *cbuf, size_t index, const char *buf, size_t size) +cbuf_write(struct cbuf *cbuf, size_t index, const void *buf, size_t size) { char *start, *end, *buf_end; size_t new_end, skip; @@ -113,7 +113,7 @@ cbuf_write(struct cbuf *cbuf, size_t index, const char *buf, size_t size) } int -cbuf_read(const struct cbuf *cbuf, size_t index, char *buf, size_t *sizep) +cbuf_read(const struct cbuf *cbuf, size_t index, void *buf, size_t *sizep) { const char *start, *end, *buf_end; size_t size; diff --git a/kern/cbuf.h b/kern/cbuf.h index 0cac54ab..3566ac49 100644 --- a/kern/cbuf.h +++ b/kern/cbuf.h @@ -100,17 +100,17 @@ int cbuf_pop(struct cbuf *cbuf, char *bytep); * appropriate. If the buffer is full when extending its end, the oldest * bytes are overwritten and the start index is updated accordingly. */ -int cbuf_write(struct cbuf *cbuf, size_t index, const char *buf, size_t size); +int cbuf_write(struct cbuf *cbuf, size_t index, const void *buf, size_t size); /* * Read from a circular buffer at a specific location. * * If the given index is outside buffer boundaries, ERROR_INVAL is returned. - * Otherwise at most *sizep bytes are copied into the given character buffer, + * Otherwise at most *sizep bytes are copied into the given byte buffer, * and *sizep is updated to the number of bytes actually copied. * * The circular buffer isn't changed by this operation. */ -int cbuf_read(const struct cbuf *cbuf, size_t index, char *buf, size_t *sizep); +int cbuf_read(const struct cbuf *cbuf, size_t index, void *buf, size_t *sizep); #endif /* _KERN_CBUF_H */ |