From 511e92f39fe9bdca51bea3ee0add95a6eca880f5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 24 Oct 2014 19:09:59 -0700 Subject: Use unsigned char, not char, throughout. Closes #43. --- src/inlines.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/inlines.c') diff --git a/src/inlines.c b/src/inlines.c index 07a75f9..c95b46b 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -14,7 +14,7 @@ typedef struct InlineStack { struct InlineStack *previous; node_inl *first_inline; int delim_count; - char delim_char; + unsigned char delim_char; } inline_stack; typedef struct Subject { @@ -231,7 +231,7 @@ inline static chunk take_while(subject* subj, int (*f)(int)) static int scan_to_closing_backticks(subject* subj, int openticklength) { // read non backticks - char c; + unsigned char c; while ((c = peek_char(subj)) && c != '`') { advance(subj); } @@ -273,10 +273,10 @@ static node_inl* handle_backticks(subject *subj) // Scan ***, **, or * and return number scanned, or 0. // Advances position. -static int scan_delims(subject* subj, char c, bool * can_open, bool * can_close) +static int scan_delims(subject* subj, unsigned char c, bool * can_open, bool * can_close) { int numdelims = 0; - char char_before, char_after; + unsigned char char_before, char_after; char_before = subj->pos == 0 ? '\n' : peek_at(subj, subj->pos - 1); while (peek_char(subj) == c) { @@ -305,7 +305,7 @@ static void free_openers(subject* subj, inline_stack* istack) // Parse strong/emph or a fallback. // Assumes the subject has '_' or '*' at the current position. -static node_inl* handle_strong_emph(subject* subj, char c, node_inl **last) +static node_inl* handle_strong_emph(subject* subj, unsigned char c, node_inl **last) { bool can_open, can_close; int numdelims; @@ -575,7 +575,7 @@ static int link_label(subject* subj, chunk *raw_label) } advance(subj); // advance past [ - char c; + unsigned char c; while ((c = peek_char(subj)) && (c != ']' || nestlevel > 0)) { switch (c) { case '`': -- cgit v1.2.3