From c786cacc291418d68b52636f951af778fefa214f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 5 Jan 2017 13:41:39 +0100 Subject: Automatic code reformatting. --- src/inlines.c | 96 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'src/inlines.c') diff --git a/src/inlines.c b/src/inlines.c index 7263c05..92e79c7 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -159,7 +159,7 @@ static void subject_from_buf(cmark_mem *mem, subject *e, cmark_strbuf *buffer, e->refmap = refmap; e->last_delim = NULL; e->last_bracket = NULL; - for (i=0; i <= MAXBACKTICKS; i++) { + for (i = 0; i <= MAXBACKTICKS; i++) { e->backticks[i] = 0; } e->scanned_for_backticks = false; @@ -516,9 +516,8 @@ static void process_emphasis(subject *subj, delimiter *stack_bottom) { delimiter *old_closer; bool opener_found; int openers_bottom_index; - delimiter *openers_bottom[6] = { stack_bottom, stack_bottom, - stack_bottom, stack_bottom, - stack_bottom, stack_bottom }; + delimiter *openers_bottom[6] = {stack_bottom, stack_bottom, stack_bottom, + stack_bottom, stack_bottom, stack_bottom}; // move back to first relevant delim. while (closer != NULL && closer->previous != stack_bottom) { @@ -528,37 +527,36 @@ static void process_emphasis(subject *subj, delimiter *stack_bottom) { // now move forward, looking for closers, and handling each while (closer != NULL) { if (closer->can_close) { - switch (closer->delim_char) { - case '"': - openers_bottom_index = 0; - break; - case '\'': - openers_bottom_index = 1; - break; - case '_': - openers_bottom_index = 2; - break; - case '*': - openers_bottom_index = 3 + (closer->length % 3); - break; - default: - assert(false); + switch (closer->delim_char) { + case '"': + openers_bottom_index = 0; + break; + case '\'': + openers_bottom_index = 1; + break; + case '_': + openers_bottom_index = 2; + break; + case '*': + openers_bottom_index = 3 + (closer->length % 3); + break; + default: + assert(false); } // Now look backwards for first matching opener: opener = closer->previous; opener_found = false; - while (opener != NULL && - opener != openers_bottom[openers_bottom_index]) { - if (opener->can_open && opener->delim_char == closer->delim_char) { + while (opener != NULL && opener != openers_bottom[openers_bottom_index]) { + if (opener->can_open && opener->delim_char == closer->delim_char) { // interior closer of size 2 can't match opener of size 1 // or of size 1 can't match 2 if (!(closer->can_open || opener->can_close) || - ((opener->length + closer->length) % 3) != 0) { + ((opener->length + closer->length) % 3) != 0) { opener_found = true; break; } - } + } opener = opener->previous; } old_closer = closer; @@ -852,11 +850,13 @@ static bufsize_t manual_scan_link_url(cmark_chunk *input, bufsize_t offset) { if (input->data[i] == '\\') i += 2; else if (input->data[i] == '(') { - ++nb_p; ++i; + ++nb_p; + ++i; } else if (input->data[i] == ')') { if (nb_p == 0) break; - --nb_p; ++i; + --nb_p; + ++i; } else if (cmark_isspace(input->data[i])) break; else @@ -1040,31 +1040,31 @@ static cmark_node *handle_newline(subject *subj) { static bufsize_t subject_find_special_char(subject *subj, int options) { // "\r\n\\`&_*[]pos + 1; -- cgit v1.2.3