Skip to content

Commit 5af77f3

Browse files
committed
Merge pull request commonmark#95 from kainjow/master
Fix warnings about dropping const qualifier
2 parents 6873b63 + df5236d commit 5af77f3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/commonmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,9 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
368368
if (entering) {
369369
LIT("<");
370370
if (strncmp(cmark_node_get_url(node), "mailto:", 7) == 0) {
371-
LIT((char *)cmark_node_get_url(node) + 7);
371+
LIT((const char *)cmark_node_get_url(node) + 7);
372372
} else {
373-
LIT((char *)cmark_node_get_url(node));
373+
LIT((const char *)cmark_node_get_url(node));
374374
}
375375
LIT(">");
376376
// return signal to skip contents of node...

src/houdini_html_u.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
/* Binary tree lookup code for entities added by JGM */
1111

12-
static unsigned char *S_lookup(int i, int low, int hi, const unsigned char *s,
12+
static const unsigned char *S_lookup(int i, int low, int hi, const unsigned char *s,
1313
int len) {
1414
int j;
15-
int cmp = strncmp((char *)s, (char *)cmark_entities[i].entity, len);
15+
int cmp = strncmp((const char *)s, (const char *)cmark_entities[i].entity, len);
1616
if (cmp == 0 && cmark_entities[i].entity[len] == 0) {
17-
return (unsigned char *)cmark_entities[i].bytes;
17+
return (const unsigned char *)cmark_entities[i].bytes;
1818
} else if (cmp < 0 && i > low) {
1919
j = i - ((i - low) / 2);
2020
if (j == i)
@@ -30,7 +30,7 @@ static unsigned char *S_lookup(int i, int low, int hi, const unsigned char *s,
3030
}
3131
}
3232

33-
static unsigned char *S_lookup_entity(const unsigned char *s, int len) {
33+
static const unsigned char *S_lookup_entity(const unsigned char *s, int len) {
3434
return S_lookup(CMARK_NUM_ENTITIES / 2, 0, CMARK_NUM_ENTITIES - 1, s, len);
3535
}
3636

0 commit comments

Comments
 (0)