summaryrefslogtreecommitdiff
path: root/src/references.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-02-16 08:54:19 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2020-02-16 08:54:19 -0800
commit67ec0eef4b448d32152897c8bbc20190f06d5b3e (patch)
tree9f43b64aeaa421f2b567b4f43183b9c128f11956 /src/references.c
parentb2378e459be775004af39bbe280846a98c8cbda6 (diff)
Add casts for MSVC10.
This is kivikakk's commit 62166fe3b6b07068ed4c4207113e3c4b060ad4a8 in cmark-gfm.
Diffstat (limited to 'src/references.c')
-rw-r--r--src/references.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/references.c b/src/references.c
index 4830689..623006a 100644
--- 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;