memzap

replay memory writes
git clone git://git.2f30.org/memzap.git
Log | Files | Refs | README | LICENSE

commit 26da6b9bf2681ff171cfa661506f58996d677115
parent 20e255d7fbd44812f0a1e2853439f9d5dea4e851
Author: sin <sin@2f30.org>
Date:   Sun Mar  3 19:59:48 +0200

termbox/memstream.c: Fix a minor warning

Diffstat:
termbox/memstream.c | 6+++---
termbox/memstream.h | 2+-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/termbox/memstream.c b/termbox/memstream.c @@ -15,13 +15,13 @@ void memstream_flush(struct memstream *s) { s->pos = 0; } -void memstream_write(struct memstream *s, void* source, size_t len) { - unsigned char* data = source; +void memstream_write(struct memstream *s, const void* source, size_t len) { + const unsigned char* data = source; if(s->pos + len > s->capa) memstream_flush(s); memcpy(s->data + s->pos, data, len); s->pos += len; } void memstream_puts(struct memstream *s, const char* str) { - memstream_write(s, (void*) str, strlen(str)); + memstream_write(s, (const void*) str, strlen(str)); } diff --git a/termbox/memstream.h b/termbox/memstream.h @@ -13,7 +13,7 @@ struct memstream { void memstream_init(struct memstream *s, int fd, void* buffer, size_t len); void memstream_flush(struct memstream *s); -void memstream_write(struct memstream *s, void* source, size_t len); +void memstream_write(struct memstream *s, const void* source, size_t len); void memstream_puts(struct memstream *s, const char* str); #endif