From fe80f7b35fc168e0d1bb142a52073c6f0e1e9ef8 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sat, 15 Nov 2014 19:38:09 +0100 Subject: Cast void pointers explicitly Needed for C++ compatibility. --- src/buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buffer.c') diff --git a/src/buffer.c b/src/buffer.c index 6bc403e..fd763d1 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -60,7 +60,7 @@ int cmark_strbuf_try_grow(strbuf *buf, int target_size, bool mark_oom) /* round allocation up to multiple of 8 */ new_size = (new_size + 7) & ~7; - new_ptr = realloc(new_ptr, new_size); + new_ptr = (unsigned char *)realloc(new_ptr, new_size); if (!new_ptr) { if (mark_oom) @@ -241,7 +241,7 @@ unsigned char *cmark_strbuf_detach(strbuf *buf) if (buf->asize == 0 || buf->ptr == cmark_strbuf__oom) { /* return an empty string */ - return calloc(1, 1); + return (unsigned char *)calloc(1, 1); } cmark_strbuf_init(buf, 0); @@ -273,7 +273,7 @@ int cmark_strbuf_cmp(const strbuf *a, const strbuf *b) int cmark_strbuf_strchr(const strbuf *buf, int c, int pos) { - const unsigned char *p = memchr(buf->ptr + pos, c, buf->size - pos); + const unsigned char *p = (unsigned char *)memchr(buf->ptr + pos, c, buf->size - pos); if (!p) return -1; -- cgit v1.2.3