From: Fletcher T. Penney Date: Mon, 12 Nov 2018 23:01:02 +0000 (-0500) Subject: UPDATED: Apply astyle X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7077bd1afeb0e6dae42b4292ea39b160c0d09e5;p=multimarkdown UPDATED: Apply astyle --- diff --git a/Sources/libMultiMarkdown/epub.c b/Sources/libMultiMarkdown/epub.c index 406e793..1a47e76 100644 --- a/Sources/libMultiMarkdown/epub.c +++ b/Sources/libMultiMarkdown/epub.c @@ -255,7 +255,7 @@ void epub_export_nav_entry(DString * out, const char * source, scratch_pad * scr if (entry_level >= level) { // This entry is a direct descendant of the parent - scratch->label_counter = (int)*counter; + scratch->label_counter = (int) * counter; temp_char = label_from_header(source, entry, scratch); printf("
  • ", temp_char); mmd_export_token_tree_html(out, source, entry->child, scratch); diff --git a/Sources/libMultiMarkdown/html.c b/Sources/libMultiMarkdown/html.c index 8969544..9ad8121 100644 --- a/Sources/libMultiMarkdown/html.c +++ b/Sources/libMultiMarkdown/html.c @@ -120,6 +120,7 @@ void mmd_print_char_html(DString * out, char c, bool obfuscate, bool line_breaks } else { print_char(c); } + break; default: @@ -470,7 +471,7 @@ void mmd_export_toc_entry_html(DString * out, const char * source, scratch_pad * if (entry_level >= level) { // This entry is a direct descendant of the parent - scratch->label_counter = (int)*counter; + scratch->label_counter = (int) * counter; temp_char = label_from_header(source, entry, scratch); printf("
  • ", temp_char); mmd_export_token_tree_html(out, source, entry->child, scratch); diff --git a/Sources/libMultiMarkdown/latex.c b/Sources/libMultiMarkdown/latex.c index a708dce..bd0e0e3 100644 --- a/Sources/libMultiMarkdown/latex.c +++ b/Sources/libMultiMarkdown/latex.c @@ -447,7 +447,7 @@ void mmd_export_toc_entry_latex(DString * out, const char * source, scratch_pad if (entry_level >= level) { // This entry is a direct descendant of the parent - scratch->label_counter = (int)*counter; + scratch->label_counter = (int) * counter; temp_char = label_from_header(source, entry, scratch); print_const("\\item "); mmd_export_token_tree_latex(out, source, entry->child, scratch); diff --git a/Sources/libMultiMarkdown/mmd.c b/Sources/libMultiMarkdown/mmd.c index 6f5fb49..585ffa6 100644 --- a/Sources/libMultiMarkdown/mmd.c +++ b/Sources/libMultiMarkdown/mmd.c @@ -526,6 +526,7 @@ void mmd_assign_line_type(mmd_engine * e, token * line) { case TEXT_LINEBREAK_SP: t = t->prev; break; + case HASH1: case HASH2: case HASH3: @@ -536,6 +537,7 @@ void mmd_assign_line_type(mmd_engine * e, token * line) { t->type += MARKER_H1; t = NULL; break; + default: // Break out of loop t = NULL; diff --git a/Sources/libMultiMarkdown/opendocument-content.c b/Sources/libMultiMarkdown/opendocument-content.c index 5014e55..91965d5 100644 --- a/Sources/libMultiMarkdown/opendocument-content.c +++ b/Sources/libMultiMarkdown/opendocument-content.c @@ -161,6 +161,7 @@ void mmd_print_char_opendocument(DString * out, char c, bool line_breaks) { } else { print_char(c); } + break; case '\t': @@ -643,7 +644,7 @@ void mmd_export_toc_entry_opendocument(DString * out, const char * source, scrat if (entry_level >= level) { // This entry is a direct descendant of the parent - scratch->label_counter = (int)*counter; + scratch->label_counter = (int) * counter; temp_char = label_from_header(source, entry, scratch); printf("", temp_char); mmd_export_token_tree_opendocument(out, source, entry->child, scratch); @@ -905,6 +906,7 @@ void mmd_export_token_opendocument(DString * out, const char * source, token * t temp_size = out->currentStringLength; trim_trailing_whitespace_d_string(out); + if (strcmp(&(out->str[out->currentStringLength - 11]), "") == 0) { d_string_erase(out, out->currentStringLength - 11, 11); } diff --git a/Sources/libMultiMarkdown/writer.c b/Sources/libMultiMarkdown/writer.c index 3989726..8763557 100644 --- a/Sources/libMultiMarkdown/writer.c +++ b/Sources/libMultiMarkdown/writer.c @@ -1992,7 +1992,7 @@ void mmd_engine_export_token_tree(DString * out, mmd_engine * e, short format) { // Preserve random label seed e->random_seed_base_labels = scratch->random_seed_base_labels; - + scratch_pad_free(scratch); }