summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2014-11-15 19:38:09 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2014-11-16 21:15:08 +0100
commitfe80f7b35fc168e0d1bb142a52073c6f0e1e9ef8 (patch)
tree3973294c8465adab8f74d9f004a4dbae638f6b97 /src/buffer.c
parent6403a37913828f69de52ebabf33499ced848641d (diff)
Cast void pointers explicitly
Needed for C++ compatibility.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c6
1 files changed, 3 insertions, 3 deletions
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;