cmark

My personal build of CMark ✏️

Commit
67ec0eef4b448d32152897c8bbc20190f06d5b3e
Parent
b2378e459be775004af39bbe280846a98c8cbda6
Author
John MacFarlane <jgm@berkeley.edu>
Date

Add casts for MSVC10.

This is kivikakk's commit 62166fe3b6b07068ed4c4207113e3c4b060ad4a8 in cmark-gfm.

Diffstat

1 file changed, 3 insertions, 3 deletions

Status File Name N° Changes Insertions Deletions
Modified src/references.c 6 3 3
diff --git a/src/references.c b/src/references.c
@@ -82,14 +82,14 @@ refcmp(const void *p1, const void *p2) {
 static int
 refsearch(const void *label, const void *p2) {
   cmark_reference *ref = *(cmark_reference **)p2;
-  return labelcmp(label, ref->label);
+  return labelcmp((const unsigned char *)label, ref->label);
 }
 
 static void sort_references(cmark_reference_map *map) {
   unsigned int i = 0, last = 0, size = map->size;
   cmark_reference *r = map->refs, **sorted = NULL;
 
-  sorted = map->mem->calloc(size, sizeof(cmark_reference *));
+  sorted = (cmark_reference **)map->mem->calloc(size, sizeof(cmark_reference *));
   while (r) {
     sorted[i++] = r;
     r = r->next;
@@ -125,7 +125,7 @@ cmark_reference *cmark_reference_lookup(cmark_reference_map *map,
   if (!map->sorted)
     sort_references(map);
 
-  ref = bsearch(norm, map->sorted, map->size, sizeof(cmark_reference *),
+  ref = (cmark_reference **)bsearch(norm, map->sorted, map->size, sizeof(cmark_reference *),
                 refsearch);
   map->mem->free(norm);
   return ref ? ref[0] : NULL;