From: Fletcher T. Penney Date: Wed, 1 Nov 2017 19:14:01 +0000 (-0400) Subject: UPDATED: Fix issue with AStyle indent settings X-Git-Tag: 6.2.3^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a34c00d91c2e28f611629d4b1540b86b5f8bbea;p=multimarkdown UPDATED: Fix issue with AStyle indent settings --- diff --git a/.astylerc b/.astylerc index e90f01d..0ff809f 100644 --- a/.astylerc +++ b/.astylerc @@ -7,7 +7,7 @@ # Indents ---indent=tab=4 +--indent=force-tab=4 # Switch statements diff --git a/Makefile b/Makefile index 194da14..59e520d 100644 --- a/Makefile +++ b/Makefile @@ -128,4 +128,4 @@ CHANGELOG: # Use astyle .PHONY : astyle astyle: - astyle --options=.astylerc "Sources/libMultiMarkdown/*.c" "Sources/multimarkdown/*.c" "Sources/libMultiMarkdown/*.h" + astyle --options=.astylerc "Sources/libMultiMarkdown/*.c" "Sources/multimarkdown/*.c" "Sources/libMultiMarkdown/*.h" "Sources/libMultiMarkdown/include/*.h" diff --git a/Sources/libMultiMarkdown/aho-corasick.c b/Sources/libMultiMarkdown/aho-corasick.c index 35744c2..6ad2daf 100644 --- a/Sources/libMultiMarkdown/aho-corasick.c +++ b/Sources/libMultiMarkdown/aho-corasick.c @@ -285,7 +285,7 @@ void ac_trie_node_prepare(trie * a, size_t s, char * buffer, unsigned short dept // Prepare children for (int i = 0; i < 256; ++i) { if ((n->child[i] != 0) && - (n->child[i] != s)) { + (n->child[i] != s)) { buffer[depth] = i; ac_trie_node_prepare(a, n->child[i], buffer, depth + 1, last_match_state); @@ -403,7 +403,7 @@ match * ac_trie_search(trie * a, const char * source, size_t start, size_t len) } m = match_add(m, counter - a->node[temp_state].len, - a->node[temp_state].len, a->node[temp_state].match_type); + a->node[temp_state].len, a->node[temp_state].match_type); } // Iterate to find shorter matches @@ -445,7 +445,7 @@ int match_count(match * m) { void match_describe(match * m, const char * source) { fprintf(stderr, "'%.*s'(%d) at %lu:%lu\n", (int)m->len, &source[m->start], - m->match_type, m->start, m->start + m->len); + m->match_type, m->start, m->start + m->len); } @@ -475,14 +475,14 @@ void match_set_filter_leftmost_longest(match * header) { } while (m->next && - m->next->start > m->start && - m->next->start < m->start + m->len) { + m->next->start > m->start && + m->next->start < m->start + m->len) { // This match is "lefter" than next match_excise(m->next); } while (m->next && - m->next->start < m->start) { + m->next->start < m->start) { // Next match is "lefter" than us n = m; m = m->prev; @@ -491,8 +491,8 @@ void match_set_filter_leftmost_longest(match * header) { } while (m->prev && - m->prev->len && - m->prev->start >= m->start) { + m->prev->len && + m->prev->start >= m->start) { // We are "lefter" than previous n = m->prev; match_excise(n); diff --git a/Sources/libMultiMarkdown/d_string.c b/Sources/libMultiMarkdown/d_string.c index 366f9a9..697fab2 100644 --- a/Sources/libMultiMarkdown/d_string.c +++ b/Sources/libMultiMarkdown/d_string.c @@ -355,7 +355,7 @@ char * d_string_copy_substring(DString * d, size_t start, size_t len) { if (start + len > d->currentStringLength) { fprintf(stderr, "d_string: Asked to copy invalid substring range.\n"); fprintf(stderr, "start: %lu len: %lu string: %lu\n", start, len, - d->currentStringLength); + d->currentStringLength); return NULL; } } diff --git a/Sources/libMultiMarkdown/epub.c b/Sources/libMultiMarkdown/epub.c index d878599..4cb069b 100644 --- a/Sources/libMultiMarkdown/epub.c +++ b/Sources/libMultiMarkdown/epub.c @@ -211,7 +211,7 @@ char * epub_package_document(scratch_pad * scratch) { struct tm * today = localtime(&t); d_string_append_printf(out, "%d-%02d-%02d\n", - today->tm_year + 1900, today->tm_mon + 1, today->tm_mday); + today->tm_year + 1900, today->tm_mon + 1, today->tm_mday); } d_string_append(out, "\n"); diff --git a/Sources/libMultiMarkdown/fodt.c b/Sources/libMultiMarkdown/fodt.c index 5f3b61a..d98b164 100644 --- a/Sources/libMultiMarkdown/fodt.c +++ b/Sources/libMultiMarkdown/fodt.c @@ -777,7 +777,7 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch temp_token = t->next->child; if (temp_token->next && - temp_token->next->type == PAIR_BRACKET) { + temp_token->next->type == PAIR_BRACKET) { temp_token = temp_token->next; } @@ -949,7 +949,7 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch case ESCAPED_CHARACTER: if (!(scratch->extensions & EXT_COMPATIBILITY) && - (source[t->start + 1] == ' ')) { + (source[t->start + 1] == ' ')) { print_const(" "); // This is a non-breaking space character } else { mmd_print_char_odf(out, source[t->start + 1]); @@ -1171,7 +1171,7 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch case PAIR_BRACKET: if ((scratch->extensions & EXT_NOTES) && - (t->next && t->next->type == PAIR_BRACKET_CITATION)) { + (t->next && t->next->type == PAIR_BRACKET_CITATION)) { goto parse_citation; } @@ -1187,8 +1187,8 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch temp_token = t->next; if (temp_token && - ((temp_token->type == PAIR_BRACKET) || - (temp_token->type == PAIR_PAREN))) { + ((temp_token->type == PAIR_BRACKET) || + (temp_token->type == PAIR_PAREN))) { temp_token = temp_token->next; } @@ -1555,7 +1555,7 @@ parse_citation: // Ignore if we're rejecting or accepting if ((scratch->extensions & EXT_CRITIC_REJECT) || - (scratch->extensions & EXT_CRITIC_ACCEPT)) { + (scratch->extensions & EXT_CRITIC_ACCEPT)) { break; } @@ -1575,7 +1575,7 @@ parse_citation: // Ignore if we're rejecting or accepting if ((scratch->extensions & EXT_CRITIC_REJECT) || - (scratch->extensions & EXT_CRITIC_ACCEPT)) { + (scratch->extensions & EXT_CRITIC_ACCEPT)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; mmd_export_token_tree_odf(out, source, t->child, scratch); @@ -1604,8 +1604,8 @@ parse_citation: case PAIR_CRITIC_SUB_DEL: if ((scratch->extensions & EXT_CRITIC) && - (t->next) && - (t->next->type == PAIR_CRITIC_SUB_ADD)) { + (t->next) && + (t->next->type == PAIR_CRITIC_SUB_ADD)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; @@ -1626,8 +1626,8 @@ parse_citation: case PAIR_CRITIC_SUB_ADD: if ((scratch->extensions & EXT_CRITIC) && - (t->prev) && - (t->prev->type == PAIR_CRITIC_SUB_DEL)) { + (t->prev) && + (t->prev->type == PAIR_CRITIC_SUB_DEL)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; @@ -1945,291 +1945,291 @@ void mmd_export_token_tree_odf_raw(DString * out, const char * source, token * t void mmd_start_complete_odf(DString * out, const char * source, scratch_pad * scratch) { print_const("\n" \ - "\n"); + "\n"); /* Font Declarations */ print_const("\n" \ - " \n" \ - "\n"); + " \n" \ + "\n"); /* Append basic style information */ print_const("\n" \ - "\n" \ - " \n" \ - " \n" \ - "\n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - "\n" \ - "" \ - " " \ - " \n" \ - "\n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - "\n" \ - " \n" \ - " \n" \ - "\n"); + "\n" \ + " \n" \ + " \n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "" \ + " " \ + " \n" \ + "\n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "\n" \ + " \n" \ + " \n" \ + "\n"); /* Automatic style information */ print_const("" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - "\n" \ - "\n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - " Bibliography\n" \ - " \n" \ - " \n"); + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + " Bibliography\n" \ + " \n" \ + " \n"); // Iterate over metadata keys meta * m; diff --git a/Sources/libMultiMarkdown/html.c b/Sources/libMultiMarkdown/html.c index 9dbd56e..6987369 100644 --- a/Sources/libMultiMarkdown/html.c +++ b/Sources/libMultiMarkdown/html.c @@ -883,7 +883,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc temp_token = t->next->child; if (temp_token->next && - temp_token->next->type == PAIR_BRACKET) { + temp_token->next->type == PAIR_BRACKET) { temp_token = temp_token->next; } @@ -1125,7 +1125,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc case ESCAPED_CHARACTER: if (!(scratch->extensions & EXT_COMPATIBILITY) && - (source[t->start + 1] == ' ')) { + (source[t->start + 1] == ' ')) { print_const(" "); } else { mmd_print_char_html(out, source[t->start + 1], false); @@ -1344,7 +1344,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc case PAIR_BRACKET: if ((scratch->extensions & EXT_NOTES) && - (t->next && t->next->type == PAIR_BRACKET_CITATION)) { + (t->next && t->next->type == PAIR_BRACKET_CITATION)) { goto parse_citation; } @@ -1360,8 +1360,8 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc temp_token = t->next; if (temp_token && - ((temp_token->type == PAIR_BRACKET) || - (temp_token->type == PAIR_PAREN))) { + ((temp_token->type == PAIR_BRACKET) || + (temp_token->type == PAIR_PAREN))) { temp_token = temp_token->next; } @@ -1519,11 +1519,11 @@ parse_citation: if (temp_short2 == scratch->used_citations->size) { // This is a re-use of a previously used note printf("(%d)", - temp_short, LC("see citation"), temp_short); + temp_short, LC("see citation"), temp_short); } else { // This is the first time this note was used printf("(%d)", - temp_short, temp_short, LC("see citation"), temp_short); + temp_short, temp_short, LC("see citation"), temp_short); } } else { // Locator present @@ -1531,11 +1531,11 @@ parse_citation: if (temp_short2 == scratch->used_citations->size) { // This is a re-use of a previously used note printf("(%s, %d)", - temp_short, LC("see citation"), temp_char, temp_short); + temp_short, LC("see citation"), temp_char, temp_short); } else { // This is the first time this note was used printf("(%s, %d)", - temp_short, temp_short, LC("see citation"), temp_char, temp_short); + temp_short, temp_short, LC("see citation"), temp_char, temp_short); } } } else { @@ -1582,7 +1582,7 @@ parse_citation: } printf("%d", - temp_short3, LC("see footnote"), temp_short); + temp_short3, LC("see footnote"), temp_short); } else { // This is the first time this note was used @@ -1594,7 +1594,7 @@ parse_citation: } printf("%d", - temp_short3, temp_short3, LC("see footnote"), temp_short); + temp_short3, temp_short3, LC("see footnote"), temp_short); } } else { // Note-based syntax disabled @@ -1634,7 +1634,7 @@ parse_citation: // This is a re-use of a previously used note printf("", - temp_short, LC("see glossary")); + temp_short, LC("see glossary")); mmd_print_string_html(out, temp_note->clean_text, false); print_const(""); } else { @@ -1642,7 +1642,7 @@ parse_citation: printf("", - temp_short, temp_short, LC("see glossary")); + temp_short, temp_short, LC("see glossary")); mmd_print_string_html(out, temp_note->clean_text, false); print_const(""); } @@ -1719,7 +1719,7 @@ parse_citation: // Ignore if we're rejecting or accepting if ((scratch->extensions & EXT_CRITIC_REJECT) || - (scratch->extensions & EXT_CRITIC_ACCEPT)) { + (scratch->extensions & EXT_CRITIC_ACCEPT)) { break; } @@ -1739,7 +1739,7 @@ parse_citation: // Ignore if we're rejecting or accepting if ((scratch->extensions & EXT_CRITIC_REJECT) || - (scratch->extensions & EXT_CRITIC_ACCEPT)) { + (scratch->extensions & EXT_CRITIC_ACCEPT)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; mmd_export_token_tree_html(out, source, t->child, scratch); @@ -1768,8 +1768,8 @@ parse_citation: case PAIR_CRITIC_SUB_DEL: if ((scratch->extensions & EXT_CRITIC) && - (t->next) && - (t->next->type == PAIR_CRITIC_SUB_ADD)) { + (t->next) && + (t->next->type == PAIR_CRITIC_SUB_ADD)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; @@ -1790,8 +1790,8 @@ parse_citation: case PAIR_CRITIC_SUB_ADD: if ((scratch->extensions & EXT_CRITIC) && - (t->prev) && - (t->prev->type == PAIR_CRITIC_SUB_DEL)) { + (t->prev) && + (t->prev->type == PAIR_CRITIC_SUB_DEL)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; diff --git a/Sources/libMultiMarkdown/latex.c b/Sources/libMultiMarkdown/latex.c index f8728bb..4795fc5 100644 --- a/Sources/libMultiMarkdown/latex.c +++ b/Sources/libMultiMarkdown/latex.c @@ -800,7 +800,7 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat temp_token = t->next->child; if (temp_token->next && - temp_token->next->type == PAIR_BRACKET) { + temp_token->next->type == PAIR_BRACKET) { temp_token = temp_token->next; } @@ -1028,7 +1028,7 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat case ESCAPED_CHARACTER: if (!(scratch->extensions & EXT_COMPATIBILITY) && - (source[t->start + 1] == ' ')) { + (source[t->start + 1] == ' ')) { print_const("~"); } else { mmd_print_char_latex(out, source[t->start + 1]); @@ -1240,7 +1240,7 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat case PAIR_BRACKET: if ((scratch->extensions & EXT_NOTES) && - (t->next && t->next->type == PAIR_BRACKET_CITATION)) { + (t->next && t->next->type == PAIR_BRACKET_CITATION)) { goto parse_citation; } @@ -1256,8 +1256,8 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat temp_token = t->next; if (temp_token && - ((temp_token->type == PAIR_BRACKET) || - (temp_token->type == PAIR_PAREN))) { + ((temp_token->type == PAIR_BRACKET) || + (temp_token->type == PAIR_PAREN))) { temp_token = temp_token->next; } @@ -1636,7 +1636,7 @@ parse_citation: // Ignore if we're rejecting or accepting if ((scratch->extensions & EXT_CRITIC_REJECT) || - (scratch->extensions & EXT_CRITIC_ACCEPT)) { + (scratch->extensions & EXT_CRITIC_ACCEPT)) { break; } @@ -1656,7 +1656,7 @@ parse_citation: // Ignore if we're rejecting or accepting if ((scratch->extensions & EXT_CRITIC_REJECT) || - (scratch->extensions & EXT_CRITIC_ACCEPT)) { + (scratch->extensions & EXT_CRITIC_ACCEPT)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; mmd_export_token_tree_latex(out, source, t->child, scratch); @@ -1686,8 +1686,8 @@ parse_citation: case PAIR_CRITIC_SUB_DEL: if ((scratch->extensions & EXT_CRITIC) && - (t->next) && - (t->next->type == PAIR_CRITIC_SUB_ADD)) { + (t->next) && + (t->next->type == PAIR_CRITIC_SUB_ADD)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; @@ -1708,8 +1708,8 @@ parse_citation: case PAIR_CRITIC_SUB_ADD: if ((scratch->extensions & EXT_CRITIC) && - (t->prev) && - (t->prev->type == PAIR_CRITIC_SUB_DEL)) { + (t->prev) && + (t->prev->type == PAIR_CRITIC_SUB_DEL)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; diff --git a/Sources/libMultiMarkdown/lexer.h b/Sources/libMultiMarkdown/lexer.h index 4c65139..6a44cb9 100644 --- a/Sources/libMultiMarkdown/lexer.h +++ b/Sources/libMultiMarkdown/lexer.h @@ -69,7 +69,7 @@ typedef struct Scanner Scanner; /// Scan for the next token int scan( - Scanner * s, //!< Pointer to Scanner state structure - const char * stop //!< Pointer to position in string at which to stop parsing + Scanner * s, //!< Pointer to Scanner state structure + const char * stop //!< Pointer to position in string at which to stop parsing ); diff --git a/Sources/libMultiMarkdown/mmd.c b/Sources/libMultiMarkdown/mmd.c index c1e8259..ce5c6b7 100644 --- a/Sources/libMultiMarkdown/mmd.c +++ b/Sources/libMultiMarkdown/mmd.c @@ -512,13 +512,13 @@ void mmd_assign_line_type(mmd_engine * e, token * line) { // Strip trailing '#' sequence if present if (line->child->tail->type == TEXT_NL) { if ((line->child->tail->prev->type >= HASH1) && - (line->child->tail->prev->type <= HASH6)) { + (line->child->tail->prev->type <= HASH6)) { line->child->tail->prev->type -= HASH1; line->child->tail->prev->type += MARKER_H1; } } else { if ((line->child->tail->type >= HASH1) && - (line->child->tail->type <= HASH6)) { + (line->child->tail->type <= HASH6)) { line->child->tail->type -= TEXT_EMPTY; line->child->tail->type += MARKER_H1; } @@ -572,8 +572,8 @@ void mmd_assign_line_type(mmd_engine * e, token * line) { t = first_child; while (t->next && ((t->next->type == INDENT_SPACE) || - (t->next->type == INDENT_TAB) || - (t->next->type == NON_INDENT_SPACE))) { + (t->next->type == INDENT_TAB) || + (t->next->type == NON_INDENT_SPACE))) { tokens_prune(t->next, t->next); } @@ -722,8 +722,8 @@ void mmd_assign_line_type(mmd_engine * e, token * line) { t = first_child; while (t->next && ((t->next->type == INDENT_SPACE) || - (t->next->type == INDENT_TAB) || - (t->next->type == NON_INDENT_SPACE))) { + (t->next->type == INDENT_TAB) || + (t->next->type == NON_INDENT_SPACE))) { tokens_prune(t->next, t->next); } @@ -832,7 +832,7 @@ void mmd_assign_line_type(mmd_engine * e, token * line) { } if ((line->type == LINE_PLAIN) && - !(e->extensions & EXT_COMPATIBILITY)) { + !(e->extensions & EXT_COMPATIBILITY)) { // Check if this is a potential table line token * walker = first_child; @@ -1253,7 +1253,7 @@ void mmd_assign_ambidextrous_tokens_in_block(mmd_engine * e, token * block, size // Do we treat this like metadata? if (!(e->extensions & EXT_COMPATIBILITY) && - !(e->extensions & EXT_NO_METADATA)) { + !(e->extensions & EXT_NO_METADATA)) { break; } @@ -1478,14 +1478,14 @@ void mmd_assign_ambidextrous_tokens_in_block(mmd_engine * e, token * block, size offset = t->start; if (!((offset == 0) || - (char_is_whitespace_or_line_ending_or_punctuation(str[offset - 1])) || - (char_is_whitespace_or_line_ending_or_punctuation(str[offset + 1])))) { + (char_is_whitespace_or_line_ending_or_punctuation(str[offset - 1])) || + (char_is_whitespace_or_line_ending_or_punctuation(str[offset + 1])))) { t->type = APOSTROPHE; break; } if (offset && (char_is_punctuation(str[offset - 1])) && - (char_is_alphanumeric(str[offset + 1]))) { + (char_is_alphanumeric(str[offset + 1]))) { // If possessive apostrophe, e.g. `x`'s if (str[offset + 1] == 's' || str[offset + 1] == 'S') { if (char_is_whitespace_or_line_ending_or_punctuation(str[offset + 2])) { @@ -1520,7 +1520,7 @@ void mmd_assign_ambidextrous_tokens_in_block(mmd_engine * e, token * block, size if (t->len == 1) { // Check whether we have '1-2' if ((offset == 0) || (!char_is_digit(str[offset - 1])) || - (!char_is_digit(str[offset + 1]))) { + (!char_is_digit(str[offset + 1]))) { t->type = TEXT_PLAIN; } } @@ -1661,11 +1661,11 @@ void pair_emphasis_tokens(token * t) { closer = t->mate; if (t->next && - (t->next->mate == closer->prev) && - (t->type == t->next->type) && - (t->next->mate != t) && - (t->start + t->len == t->next->start) && - (closer->start == closer->prev->start + closer->prev->len)) { + (t->next->mate == closer->prev) && + (t->type == t->next->type) && + (t->next->mate != t) && + (t->start + t->len == t->next->start) && + (closer->start == closer->prev->start + closer->prev->len)) { // We have a strong pair t->type = STRONG_START; @@ -1788,8 +1788,8 @@ void is_list_loose(token * list) { /// Is this actually an HTML block? void is_para_html(mmd_engine * e, token * block) { if ((block == NULL) || - (block->child == NULL) || - (block->child->type != LINE_PLAIN)) { + (block->child == NULL) || + (block->child->type != LINE_PLAIN)) { return; } @@ -2043,7 +2043,7 @@ void strip_line_tokens_from_block(mmd_engine * e, token * block) { case LINE_SETEXT_1: case LINE_SETEXT_2: if ((block->type == BLOCK_SETEXT_1) || - (block->type == BLOCK_SETEXT_2)) { + (block->type == BLOCK_SETEXT_2)) { temp = l->next; tokens_prune(l, l); l = temp; @@ -2088,7 +2088,7 @@ handle_line: // If we're not a code block, strip additional indents if ((block->type != BLOCK_CODE_INDENTED) && - (block->type != BLOCK_CODE_FENCED)) { + (block->type != BLOCK_CODE_FENCED)) { while (l->child && ((l->child->type == INDENT_SPACE) || (l->child->type == INDENT_TAB))) { token_remove_first_child(l); } diff --git a/Sources/libMultiMarkdown/object_pool.h b/Sources/libMultiMarkdown/object_pool.h index 3dcaca7..ba0c133 100644 --- a/Sources/libMultiMarkdown/object_pool.h +++ b/Sources/libMultiMarkdown/object_pool.h @@ -76,25 +76,25 @@ typedef struct pool pool; /// Allocate a new object pool pool * pool_new( - short size //!< How big are the objects to be allocated + short size //!< How big are the objects to be allocated ); /// Free object pool void pool_free( - pool * p //!< Pool to be freed + pool * p //!< Pool to be freed ); /// Drain pool -- free slabs previously allocated void pool_drain( - pool * p //!< Pool to be drained + pool * p //!< Pool to be drained ); /// Request memory for a new object from the pool void * pool_allocate_object( - pool * p //!< Pool to be used for allocation + pool * p //!< Pool to be used for allocation ); diff --git a/Sources/libMultiMarkdown/opendocument-content.c b/Sources/libMultiMarkdown/opendocument-content.c index 964e26e..27ecbf0 100644 --- a/Sources/libMultiMarkdown/opendocument-content.c +++ b/Sources/libMultiMarkdown/opendocument-content.c @@ -976,7 +976,7 @@ void mmd_export_token_opendocument(DString * out, const char * source, token * t temp_token = t->next->child; if (temp_token->next && - temp_token->next->type == PAIR_BRACKET) { + temp_token->next->type == PAIR_BRACKET) { temp_token = temp_token->next; } @@ -1148,7 +1148,7 @@ void mmd_export_token_opendocument(DString * out, const char * source, token * t case ESCAPED_CHARACTER: if (!(scratch->extensions & EXT_COMPATIBILITY) && - (source[t->start + 1] == ' ')) { + (source[t->start + 1] == ' ')) { print_const(" "); // This is a non-breaking space character } else { mmd_print_char_opendocument(out, source[t->start + 1]); @@ -1370,7 +1370,7 @@ void mmd_export_token_opendocument(DString * out, const char * source, token * t case PAIR_BRACKET: if ((scratch->extensions & EXT_NOTES) && - (t->next && t->next->type == PAIR_BRACKET_CITATION)) { + (t->next && t->next->type == PAIR_BRACKET_CITATION)) { goto parse_citation; } @@ -1386,8 +1386,8 @@ void mmd_export_token_opendocument(DString * out, const char * source, token * t temp_token = t->next; if (temp_token && - ((temp_token->type == PAIR_BRACKET) || - (temp_token->type == PAIR_PAREN))) { + ((temp_token->type == PAIR_BRACKET) || + (temp_token->type == PAIR_PAREN))) { temp_token = temp_token->next; } @@ -1754,7 +1754,7 @@ parse_citation: // Ignore if we're rejecting or accepting if ((scratch->extensions & EXT_CRITIC_REJECT) || - (scratch->extensions & EXT_CRITIC_ACCEPT)) { + (scratch->extensions & EXT_CRITIC_ACCEPT)) { break; } @@ -1774,7 +1774,7 @@ parse_citation: // Ignore if we're rejecting or accepting if ((scratch->extensions & EXT_CRITIC_REJECT) || - (scratch->extensions & EXT_CRITIC_ACCEPT)) { + (scratch->extensions & EXT_CRITIC_ACCEPT)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; mmd_export_token_tree_opendocument(out, source, t->child, scratch); @@ -1803,8 +1803,8 @@ parse_citation: case PAIR_CRITIC_SUB_DEL: if ((scratch->extensions & EXT_CRITIC) && - (t->next) && - (t->next->type == PAIR_CRITIC_SUB_ADD)) { + (t->next) && + (t->next->type == PAIR_CRITIC_SUB_ADD)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; @@ -1825,8 +1825,8 @@ parse_citation: case PAIR_CRITIC_SUB_ADD: if ((scratch->extensions & EXT_CRITIC) && - (t->prev) && - (t->prev->type == PAIR_CRITIC_SUB_DEL)) { + (t->prev) && + (t->prev->type == PAIR_CRITIC_SUB_DEL)) { t->child->type = TEXT_EMPTY; t->child->mate->type = TEXT_EMPTY; diff --git a/Sources/libMultiMarkdown/opendocument.c b/Sources/libMultiMarkdown/opendocument.c index 5ea74af..0aca6ff 100644 --- a/Sources/libMultiMarkdown/opendocument.c +++ b/Sources/libMultiMarkdown/opendocument.c @@ -249,253 +249,253 @@ char * opendocument_style(int format) { /* Font Declarations */ print_const("\n" \ - " \n" \ - "\n"); + " \n" \ + "\n"); /* Append basic style information */ print_const("\n" \ - "\n" \ - " \n" \ - " \n" \ - "\n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - "\n" \ - "" \ - " " \ - " \n" \ - "\n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - "\n" \ - " \n" \ - " \n" \ - "\n"); + "\n" \ + " \n" \ + " \n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "" \ + " " \ + " \n" \ + "\n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "\n" \ + " \n" \ + " \n" \ + "\n"); /* Automatic style information */ print_const("" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - "\n" \ - "\n" \ - "\n" \ - " \n" \ - "\n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - "\n" \ - "\n" \ - " \n" \ - " \n" \ - " Bibliography\n" \ - " \n" \ - " \n"); + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + " Bibliography\n" \ + " \n" \ + " \n"); char * result = out->str; d_string_free(out, false); @@ -513,41 +513,41 @@ char * opendocument_style_file(int format) { d_string_append(out, "\n"); print_const("\n"); + "xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\"\n" \ + "xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\"\n" \ + "xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\"\n" \ + "xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\"\n" \ + "xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\"\n" \ + "xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n" \ + "xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n" \ + "xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\"\n" \ + "xmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\"\n" \ + "xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\"\n" \ + "xmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\"\n" \ + "xmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\"\n" \ + "xmlns:math=\"http://www.w3.org/1998/Math/MathML\"\n" \ + "xmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\"\n" \ + "xmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\"\n" \ + "xmlns:ooo=\"http://openoffice.org/2004/office\"\n" \ + "xmlns:ooow=\"http://openoffice.org/2004/writer\"\n" \ + "xmlns:oooc=\"http://openoffice.org/2004/calc\"\n" \ + "xmlns:dom=\"http://www.w3.org/2001/xml-events\"\n" \ + "xmlns:xforms=\"http://www.w3.org/2002/xforms\"\n" \ + "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" \ + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" \ + "xmlns:rpt=\"http://openoffice.org/2005/report\"\n" \ + "xmlns:of=\"urn:oasis:names:tc:opendocument:xmlns:of:1.2\"\n" \ + "xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"\n" \ + "xmlns:grddl=\"http://www.w3.org/2003/g/data-view#\"\n" \ + "xmlns:officeooo=\"http://openoffice.org/2009/office\"\n" \ + "xmlns:tableooo=\"http://openoffice.org/2009/table\"\n" \ + "xmlns:drawooo=\"http://openoffice.org/2010/draw\"\n" \ + "xmlns:calcext=\"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0\"\n" \ + "xmlns:loext=\"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0\"\n" \ + "xmlns:field=\"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0\"\n" \ + "xmlns:formx=\"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0\"\n" \ + "xmlns:css3t=\"http://www.w3.org/TR/css3-text/\"\n" \ + "office:version=\"1.2\">\n"); // Styles d_string_append(out, style); @@ -813,41 +813,41 @@ mz_zip_archive * opendocument_core_zip(mmd_engine * e, int format) { /// Add shared office:document config void opendocument_document_attr(DString * out) { print_const("xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\"\n" \ - "xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\"\n" \ - "xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\"\n" \ - "xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\"\n" \ - "xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\"\n" \ - "xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\"\n" \ - "xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n" \ - "xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n" \ - "xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\"\n" \ - "xmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\"\n" \ - "xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\"\n" \ - "xmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\"\n" \ - "xmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\"\n" \ - "xmlns:math=\"http://www.w3.org/1998/Math/MathML\"\n" \ - "xmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\"\n" \ - "xmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\"\n" \ - "xmlns:ooo=\"http://openoffice.org/2004/office\"\n" \ - "xmlns:ooow=\"http://openoffice.org/2004/writer\"\n" \ - "xmlns:oooc=\"http://openoffice.org/2004/calc\"\n" \ - "xmlns:dom=\"http://www.w3.org/2001/xml-events\"\n" \ - "xmlns:xforms=\"http://www.w3.org/2002/xforms\"\n" \ - "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" \ - "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" \ - "xmlns:rpt=\"http://openoffice.org/2005/report\"\n" \ - "xmlns:of=\"urn:oasis:names:tc:opendocument:xmlns:of:1.2\"\n" \ - "xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"\n" \ - "xmlns:grddl=\"http://www.w3.org/2003/g/data-view#\"\n" \ - "xmlns:officeooo=\"http://openoffice.org/2009/office\"\n" \ - "xmlns:tableooo=\"http://openoffice.org/2009/table\"\n" \ - "xmlns:drawooo=\"http://openoffice.org/2010/draw\"\n" \ - "xmlns:calcext=\"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0\"\n" \ - "xmlns:loext=\"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0\"\n" \ - "xmlns:field=\"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0\"\n" \ - "xmlns:formx=\"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0\"\n" \ - "xmlns:css3t=\"http://www.w3.org/TR/css3-text/\"\n" \ - "office:version=\"1.2\""); + "xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\"\n" \ + "xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\"\n" \ + "xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\"\n" \ + "xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\"\n" \ + "xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\"\n" \ + "xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n" \ + "xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n" \ + "xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\"\n" \ + "xmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\"\n" \ + "xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\"\n" \ + "xmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\"\n" \ + "xmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\"\n" \ + "xmlns:math=\"http://www.w3.org/1998/Math/MathML\"\n" \ + "xmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\"\n" \ + "xmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\"\n" \ + "xmlns:ooo=\"http://openoffice.org/2004/office\"\n" \ + "xmlns:ooow=\"http://openoffice.org/2004/writer\"\n" \ + "xmlns:oooc=\"http://openoffice.org/2004/calc\"\n" \ + "xmlns:dom=\"http://www.w3.org/2001/xml-events\"\n" \ + "xmlns:xforms=\"http://www.w3.org/2002/xforms\"\n" \ + "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" \ + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" \ + "xmlns:rpt=\"http://openoffice.org/2005/report\"\n" \ + "xmlns:of=\"urn:oasis:names:tc:opendocument:xmlns:of:1.2\"\n" \ + "xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"\n" \ + "xmlns:grddl=\"http://www.w3.org/2003/g/data-view#\"\n" \ + "xmlns:officeooo=\"http://openoffice.org/2009/office\"\n" \ + "xmlns:tableooo=\"http://openoffice.org/2009/table\"\n" \ + "xmlns:drawooo=\"http://openoffice.org/2010/draw\"\n" \ + "xmlns:calcext=\"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0\"\n" \ + "xmlns:loext=\"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0\"\n" \ + "xmlns:field=\"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0\"\n" \ + "xmlns:formx=\"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0\"\n" \ + "xmlns:css3t=\"http://www.w3.org/TR/css3-text/\"\n" \ + "office:version=\"1.2\""); } diff --git a/Sources/libMultiMarkdown/rng.c b/Sources/libMultiMarkdown/rng.c index b725966..c609100 100644 --- a/Sources/libMultiMarkdown/rng.c +++ b/Sources/libMultiMarkdown/rng.c @@ -92,7 +92,7 @@ long *ran_arr_ptr = &ran_arr_dummy; /* the next random number, or -1 */ for (j = KK + KK - 2; j >= KK; j--) x[j - (KK - LL)] = mod_diff(x[j - (KK - LL)], x[j]), - x[j - KK] = mod_diff(x[j - KK], x[j]); + x[j - KK] = mod_diff(x[j - KK], x[j]); if (is_odd(ss)) { /* "multiply by z" */ for (j = KK; j > 0; j--) { diff --git a/Sources/libMultiMarkdown/stack.h b/Sources/libMultiMarkdown/stack.h index e63b027..497713f 100644 --- a/Sources/libMultiMarkdown/stack.h +++ b/Sources/libMultiMarkdown/stack.h @@ -71,39 +71,39 @@ typedef struct stack stack; /// Create a new stack with dynamic storage with an /// initial capacity (0 to use default capacity) stack * stack_new( - int startingSize //!< Default capacity for stack + int startingSize //!< Default capacity for stack ); /// Free the stack void stack_free( - stack * s //!< Stack to be freed + stack * s //!< Stack to be freed ); /// Add a new pointer to the stack void stack_push( - stack * s, //!< Stack to use - void * element //!< Pointer to push onto stack + stack * s, //!< Stack to use + void * element //!< Pointer to push onto stack ); /// Pop the top pointer off the stack and return it void * stack_pop( - stack * s //!< Stack to examine + stack * s //!< Stack to examine ); /// Peek at the top pointer on the stack (but don't remove it from stack) void * stack_peek( - stack * s //!< Stack to examine + stack * s //!< Stack to examine ); /// Peek at a specific index in the stack void * stack_peek_index( - stack * s, //!< Stack to examine - size_t index //!< Index to peek at (0 is first pointer on stack) + stack * s, //!< Stack to examine + size_t index //!< Index to peek at (0 is first pointer on stack) ); diff --git a/Sources/libMultiMarkdown/token.c b/Sources/libMultiMarkdown/token.c index f023a04..b71dc1e 100644 --- a/Sources/libMultiMarkdown/token.c +++ b/Sources/libMultiMarkdown/token.c @@ -190,7 +190,7 @@ token * token_new_parent(token * child, unsigned short type) { /// may or may not also be the start of a chain void token_chain_append(token * chain_start, token * t) { if ((chain_start == NULL) || - (t == NULL)) { + (t == NULL)) { return; } @@ -465,15 +465,15 @@ void token_tree_describe(token * t, const char * string) { /// Find the child node of a given parent that contains the specified /// offset position. token * token_child_for_offset( - token * parent, //!< Pointer to parent token - size_t offset //!< Search position + token * parent, //!< Pointer to parent token + size_t offset //!< Search position ) { if (parent == NULL) { return NULL; } if ((parent->start > offset) || - (parent->start + parent->len < offset)) { + (parent->start + parent->len < offset)) { return NULL; } @@ -505,16 +505,16 @@ static bool ranges_intersect(size_t start1, size_t len1, size_t start2, size_t l /// Find first child node of a given parent that intersects the specified /// offset range. token * token_first_child_in_range( - token * parent, //!< Pointer to parent token - size_t start, //!< Start search position - size_t len //!< Search length + token * parent, //!< Pointer to parent token + size_t start, //!< Start search position + size_t len //!< Search length ) { if (parent == NULL) { return NULL; } if ((parent->start > start + len) || - (parent->start + parent->len < start)) { + (parent->start + parent->len < start)) { return NULL; } @@ -539,16 +539,16 @@ token * token_first_child_in_range( /// Find last child node of a given parent that intersects the specified /// offset range. token * token_last_child_in_range( - token * parent, //!< Pointer to parent token - size_t start, //!< Start search position - size_t len //!< Search length + token * parent, //!< Pointer to parent token + size_t start, //!< Start search position + size_t len //!< Search length ) { if (parent == NULL) { return NULL; } if ((parent->start > start + len) || - (parent->start + parent->len < start)) { + (parent->start + parent->len < start)) { return NULL; } diff --git a/Sources/libMultiMarkdown/token_pairs.c b/Sources/libMultiMarkdown/token_pairs.c index 712f7de..9100e93 100644 --- a/Sources/libMultiMarkdown/token_pairs.c +++ b/Sources/libMultiMarkdown/token_pairs.c @@ -97,7 +97,7 @@ void token_pair_engine_free(token_pair_engine * e) { /// Add a new pairing configuration to a token pair engine void token_pair_engine_add_pairing(token_pair_engine * e, unsigned short open_type, unsigned short close_type, - unsigned short pair_type, int options) { + unsigned short pair_type, int options) { // \todo: This needs to be more sophisticated e->can_open_pair[open_type] = 1; e->can_close_pair[close_type] = 1; @@ -189,7 +189,7 @@ close: if (!e->empty_allowed[pair_type]) { // Make sure they aren't consecutive tokens if ((peek->next == walker) && - (peek->start + peek->len == walker->start)) { + (peek->start + peek->len == walker->start)) { // i--; i = start_counter; // In this situation, we can't use this token as a closer continue; diff --git a/Sources/libMultiMarkdown/token_pairs.h b/Sources/libMultiMarkdown/token_pairs.h index 6e4001e..548d5c5 100644 --- a/Sources/libMultiMarkdown/token_pairs.h +++ b/Sources/libMultiMarkdown/token_pairs.h @@ -99,24 +99,24 @@ token_pair_engine * token_pair_engine_new(void); /// Free existing token pair engine void token_pair_engine_free( - token_pair_engine * e //!< Token pair engine to be freed + token_pair_engine * e //!< Token pair engine to be freed ); /// Add a new pairing configuration to a token pair engine void token_pair_engine_add_pairing( - token_pair_engine * e, //!< Token pair engine to add to - unsigned short open_type, //!< Token type for opener - unsigned short close_type, //!< Token type for closer - unsigned short pair_type, //!< Token type for pairing - int options //!< Token pair options to use + token_pair_engine * e, //!< Token pair engine to add to + unsigned short open_type, //!< Token type for opener + unsigned short close_type, //!< Token type for closer + unsigned short pair_type, //!< Token type for pairing + int options //!< Token pair options to use ); /// Search a token's childen for matching pairs void token_pairs_match_pairs_inside_token( - token * parent, //!< Which tokens should we search for pairs - token_pair_engine * e, //!< Token pair engine to be used for matching - stack * s, //!< Pointer to a stack to use for pairing tokens - unsigned short depth //!< Keep track of recursion depth + token * parent, //!< Which tokens should we search for pairs + token_pair_engine * e, //!< Token pair engine to be used for matching + stack * s, //!< Pointer to a stack to use for pairing tokens + unsigned short depth //!< Keep track of recursion depth ); diff --git a/Sources/libMultiMarkdown/uuid.c b/Sources/libMultiMarkdown/uuid.c index eed3cbe..2c91c9f 100644 --- a/Sources/libMultiMarkdown/uuid.c +++ b/Sources/libMultiMarkdown/uuid.c @@ -102,8 +102,8 @@ char * uuid_string_from_bits(unsigned char * raw) { char * result = malloc(37); sprintf(result, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", - raw[0], raw[1], raw[2], raw[3], raw[4], raw[5], raw[6], raw[7], - raw[8], raw[9], raw[10], raw[11], raw[12], raw[13], raw[14], raw[15] ); + raw[0], raw[1], raw[2], raw[3], raw[4], raw[5], raw[6], raw[7], + raw[8], raw[9], raw[10], raw[11], raw[12], raw[13], raw[14], raw[15] ); return result; } diff --git a/Sources/libMultiMarkdown/writer.c b/Sources/libMultiMarkdown/writer.c index d1087f6..536c97f 100644 --- a/Sources/libMultiMarkdown/writer.c +++ b/Sources/libMultiMarkdown/writer.c @@ -418,8 +418,8 @@ char * label_from_string(const char * str) { next_char++; } } else if ((*str >= '0' && *str <= '9') || (*str >= 'A' && *str <= 'Z') - || (*str >= 'a' && *str <= 'z') || (*str == '.') || (*str == '_') - || (*str == '-') || (*str == ':')) { + || (*str >= 'a' && *str <= 'z') || (*str == '.') || (*str == '_') + || (*str == '-') || (*str == ':')) { // Allow 0-9, A-Z, a-z, ., _, -, : d_string_append_c(out, tolower(*str)); } @@ -909,7 +909,7 @@ char * destination_accept(const char * source, token ** remainder, bool validate // Advance remainder to end of destination while ((*remainder)->next && - (*remainder)->next->start < start + scan_len) { + (*remainder)->next->start < start + scan_len) { *remainder = (*remainder)->next; } @@ -962,7 +962,7 @@ char * url_accept(const char * source, size_t start, size_t max_len, size_t * en // Is this ? if ((source[start] == '<') && - (source[start + scan_len - 1] == '>')) { + (source[start + scan_len - 1] == '>')) { // Strip '<' and '>' start++; scan_len -= 2; @@ -1367,8 +1367,8 @@ void process_definition_block(mmd_engine * e, token * block) { f->label_text = f->clean_text; if (f->content->child && - f->content->child->next && - f->content->child->next->next) { + f->content->child->next && + f->content->child->next->next) { f->clean_text = clean_string_from_range(e->dstr->str, f->content->child->next->next->start, block->start + block->len - f->content->child->next->next->start, false); } else { f->clean_text = NULL; @@ -1542,7 +1542,7 @@ void process_table_to_link(mmd_engine * e, token * t) { token * temp_token = t->next->child; if (temp_token->next && - temp_token->next->type == PAIR_BRACKET) { + temp_token->next->type == PAIR_BRACKET) { temp_token = temp_token->next; } @@ -1571,7 +1571,7 @@ void process_table_stack(mmd_engine * e) { /// Parse metadata void process_metadata_stack(mmd_engine * e, scratch_pad * scratch) { if ((scratch->extensions & EXT_NO_METADATA) || - (scratch->extensions & EXT_COMPATIBILITY)) { + (scratch->extensions & EXT_COMPATIBILITY)) { return; } @@ -1601,13 +1601,13 @@ void process_metadata_stack(mmd_engine * e, scratch_pad * scratch) { } } else if (strcmp(m->key, "latexheaderlevel") == 0) { if ((scratch->output_format == FORMAT_LATEX) || - (scratch->output_format == FORMAT_BEAMER) || - (scratch->output_format == FORMAT_MEMOIR)) { + (scratch->output_format == FORMAT_BEAMER) || + (scratch->output_format == FORMAT_MEMOIR)) { header_level = atoi(m->value); } } else if (strcmp(m->key, "odfheaderlevel") == 0) { if ((scratch->output_format == FORMAT_ODT) || - (scratch->output_format == FORMAT_FODT)) { + (scratch->output_format == FORMAT_FODT)) { header_level = atoi(m->value); } } else if (strcmp(m->key, "language") == 0) { @@ -1650,18 +1650,18 @@ void process_metadata_stack(mmd_engine * e, scratch_pad * scratch) { temp_char = label_from_string(m->value); if ((strcmp(temp_char, "dutch") == 0) || - (strcmp(temp_char, "nl") == 0)) { + (strcmp(temp_char, "nl") == 0)) { scratch->quotes_lang = DUTCH; } else if ((strcmp(temp_char, "french") == 0) || - (strcmp(temp_char, "fr") == 0)) { + (strcmp(temp_char, "fr") == 0)) { scratch->quotes_lang = FRENCH; } else if ((strcmp(temp_char, "german") == 0) || - (strcmp(temp_char, "de") == 0)) { + (strcmp(temp_char, "de") == 0)) { scratch->quotes_lang = GERMAN; } else if (strcmp(temp_char, "germanguillemets") == 0) { scratch->quotes_lang = GERMANGUILL; } else if ((strcmp(temp_char, "swedish") == 0) || - (strcmp(temp_char, "sv") == 0)) { + (strcmp(temp_char, "sv") == 0)) { scratch->quotes_lang = SWEDISH; } else { scratch->quotes_lang = ENGLISH; @@ -2468,13 +2468,13 @@ bool table_has_caption(token * t) { t = t->next; if (t && t->next && - t->next->type == PAIR_BRACKET) { + t->next->type == PAIR_BRACKET) { t = t->next; } if (t && t->next && - ((t->next->type == TEXT_NL) || - (t->next->type == TEXT_LINEBREAK))) { + ((t->next->type == TEXT_NL) || + (t->next->type == TEXT_LINEBREAK))) { t = t->next; } diff --git a/Sources/multimarkdown/main.c b/Sources/multimarkdown/main.c index 9797ec4..291c670 100644 --- a/Sources/multimarkdown/main.c +++ b/Sources/multimarkdown/main.c @@ -74,8 +74,8 @@ // argtable structs struct arg_lit *a_help, *a_version, *a_compatibility, *a_nolabels, *a_batch, - *a_accept, *a_reject, *a_full, *a_snippet, *a_random, *a_meta, - *a_notransclude, *a_nosmart; + *a_accept, *a_reject, *a_full, *a_snippet, *a_random, *a_meta, + *a_notransclude, *a_nosmart; struct arg_str *a_format, *a_lang, *a_extract; struct arg_file *a_file, *a_o; struct arg_end *a_end;