]> granicus.if.org Git - multimarkdown/commitdiff
UPDATED: Tweak astyle settings
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 22 Jul 2017 14:22:46 +0000 (10:22 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 22 Jul 2017 14:22:46 +0000 (10:22 -0400)
16 files changed:
.astylerc
Sources/libMultiMarkdown/aho-corasick.c
Sources/libMultiMarkdown/d_string.c
Sources/libMultiMarkdown/epub.c
Sources/libMultiMarkdown/fodt.c
Sources/libMultiMarkdown/html.c
Sources/libMultiMarkdown/latex.c
Sources/libMultiMarkdown/mmd.c
Sources/libMultiMarkdown/opendocument-content.c
Sources/libMultiMarkdown/opendocument.c
Sources/libMultiMarkdown/rng.c
Sources/libMultiMarkdown/textbundle.c
Sources/libMultiMarkdown/transclude.c
Sources/libMultiMarkdown/uuid.c
Sources/libMultiMarkdown/writer.c
Sources/multimarkdown/main.c

index 9d6d34adeb5233a082e10729ab846fc8065400ea..e90f01d18108346b6c0f818b04599b47f13cbea6 100644 (file)
--- a/.astylerc
+++ b/.astylerc
@@ -1,3 +1,7 @@
+# astyle configuration file
+# http://astyle.sourceforge.net/astyle.html
+
+
 # Brace style
 --style=java
 
@@ -5,28 +9,40 @@
 # Indents
 --indent=tab=4
 
+
 # Switch statements
 --indent-switches
 
+
 # Break long conditionals
 --break-after-logical
 
+
 # Indent pre-processor directives
 --indent-preproc-block
 --indent-preproc-define
 --indent-preproc-cond
 
+
 # Line endings
 --lineend=linux
 
+
 # Add brackets to one-liners
 --add-brackets
 
+
 # Pad with blank lines
 --break-blocks
 
-# Pad around operators
+
+# Pad with spaces
 --pad-oper
+--pad-header
+
+
+# Pointers/References
+--align-reference=name
 
 
 # Excludes
index c08c2d922139e9d1ffdb4eafeeb2e586e94c8a2f..35744c2daeea2327280a2e2323a835d7f0b6fb73 100644 (file)
@@ -244,7 +244,7 @@ void Test_trie_search(CuTest* tc) {
        CuAssertIntEquals(tc, 40, trie_search_match_type(a, "food"));
 
        CuAssertIntEquals(tc, -1, trie_search(a, "foot"));
-       CuAssertIntEquals(tc, (unsigned short) -1, trie_search_match_type(a, "foot"));
+       CuAssertIntEquals(tc, (unsigned short) - 1, trie_search_match_type(a, "foot"));
 
        trie_free(a);
 }
index f40aca6aaede63e40ac407c1de73730c9d66257a..1dd17eb904a18b028972035c6915e6017685b653 100644 (file)
@@ -181,7 +181,7 @@ static void ensureStringBufferCanHold(DString * baseString, size_t newStringSize
 
                if (temp == NULL) {
                        /* realloc failed */
-                       fprintf(stderr, "Error reallocating memory for d_string. Current buffer size %lu.\n",baseString->currentStringBufferSize);
+                       fprintf(stderr, "Error reallocating memory for d_string. Current buffer size %lu.\n", baseString->currentStringBufferSize);
 
                        exit(1);
                }
@@ -223,7 +223,7 @@ void d_string_append_c_array(DString * baseString, const char * appendedChars, s
        size_t newSizeNeeded = baseString->currentStringLength + bytes;
        ensureStringBufferCanHold(baseString, newSizeNeeded);
 
-       memcpy(baseString->str + baseString->currentStringLength,appendedChars, bytes);
+       memcpy(baseString->str + baseString->currentStringLength, appendedChars, bytes);
 
        baseString->currentStringLength = newSizeNeeded;
        baseString->str[baseString->currentStringLength] = '\0';
index bb6c43b7f71733cc3e1db4f8dced008d47528bce..1dbf7ff26d0d0894e0921f5f18508fc65d78fca7 100644 (file)
@@ -169,7 +169,7 @@ char * epub_package_document(scratch_pad * scratch) {
                mmd_print_string_html(out, m->value, false);
                print_const("</dc:language>\n");
        } else {
-               switch(scratch->language) {
+               switch (scratch->language) {
                        case LC_ES:
                                print_const("<dc:language>es</dc:language>\n");
                                break;
@@ -547,7 +547,7 @@ DString * epub_create(const char * body, mmd_engine * e, const char * directory)
        // Finalize zip archive and extract data
        free(result->str);
 
-       status = mz_zip_writer_finalize_heap_archive(&zip, (void **) &(result->str), (size_t *) &(result->currentStringLength));
+       status = mz_zip_writer_finalize_heap_archive(&zip, (void **) & (result->str), (size_t *) & (result->currentStringLength));
 
        if (!status) {
                fprintf(stderr, "Error adding asset to zip.\n");
index a2791585350065dd0a549556c98163e112cfc8f6..54ffd7f4698aa41956bb8770a2455e721e84f6e9 100644 (file)
@@ -273,8 +273,8 @@ static char * correct_dimension_units(char *original) {
                result[i] = tolower(result[i]);
        }
 
-       if (strstr(&result[strlen(result)-2],"px")) {
-               result[strlen(result)-2] = '\0';
+       if (strstr(&result[strlen(result) - 2], "px")) {
+               result[strlen(result) - 2] = '\0';
                strcat(result, "pt");
        }
 
index 78db2b9441cee7b6f9732e33b52105a34d61313e..db1e365cc9cbe2bbf234a0b969128a8384cac901 100644 (file)
@@ -253,7 +253,7 @@ static char * strip_dimension_units(char *original) {
                result[i] = tolower(result[i]);
        }
 
-       if (strstr(&result[strlen(result)-2],"px")) {
+       if (strstr(&result[strlen(result) - 2], "px")) {
                // Leave 'px' alone
                return result;
        }
@@ -2131,7 +2131,7 @@ void mmd_start_complete_html(DString * out, const char * source, scratch_pad * s
        if (m) {
                printf(" lang=\"%s\"", m->value);
        } else {
-               switch(scratch->language) {
+               switch (scratch->language) {
                        case LC_ES:
                                print_const(" lang=\"es\"");
                                break;
@@ -2257,7 +2257,7 @@ void mmd_export_footnote_list_html(DString * out, const char * source, scratch_p
                        scratch->footnote_para_counter = 0;
 
                        // We need to know which block is the last one in the footnote
-                       while(content) {
+                       while (content) {
                                if (content->type == BLOCK_PARA) {
                                        scratch->footnote_para_counter++;
                                }
@@ -2310,7 +2310,7 @@ void mmd_export_glossary_list_html(DString * out, const char * source, scratch_p
                        scratch->footnote_para_counter = 0;
 
                        // We need to know which block is the last one in the footnote
-                       while(content) {
+                       while (content) {
                                if (content->type == BLOCK_PARA) {
                                        scratch->footnote_para_counter++;
                                }
@@ -2358,7 +2358,7 @@ void mmd_export_citation_list_html(DString * out, const char * source, scratch_p
                        scratch->footnote_para_counter = 0;
 
                        // We need to know which block is the last one in the footnote
-                       while(content) {
+                       while (content) {
                                if (content->type == BLOCK_PARA) {
                                        scratch->footnote_para_counter++;
                                }
index 9b1bdb9aea3d74fd3d1ba4e8d8280cd481a85886..efa32f24024702ce26ef135b22e6d997c028c642 100644 (file)
@@ -309,8 +309,8 @@ static char * correct_dimension_units(char *original) {
                result[i] = tolower(result[i]);
        }
 
-       if (strstr(&result[strlen(result)-2],"px")) {
-               result[strlen(result)-2] = '\0';
+       if (strstr(&result[strlen(result) - 2], "px")) {
+               result[strlen(result) - 2] = '\0';
                strcat(result, "pt");
        }
 
@@ -359,7 +359,7 @@ void mmd_export_image_latex(DString * out, const char * source, token * text, li
                                // specified as percent
                                width[strlen(width) - 1] = '\0';
                                temp_float = strtod(width, NULL);
-                               temp_float = temp_float/100.0f;
+                               temp_float = temp_float / 100.0f;
                                printf("width=%.4f\\textwidth,", temp_float);
                        } else {
                                printf("width=%s,", width);
@@ -377,7 +377,7 @@ void mmd_export_image_latex(DString * out, const char * source, token * text, li
                                // specified as percent
                                height[strlen(height) - 1] = '\0';
                                temp_float = strtod(height, NULL);
-                               temp_float = temp_float/100.0f;
+                               temp_float = temp_float / 100.0f;
                                printf("height=%.4f\\textheight", temp_float);
                        } else {
                                printf("height=%s", height);
@@ -1839,7 +1839,7 @@ parse_citation:
                case TABLE_CELL:
                        if (t->next && t->next->type == TABLE_DIVIDER) {
                                if (t->next->len > 1) {
-                                       printf("\\multicolumn{%lu}{",t->next->len);
+                                       printf("\\multicolumn{%lu}{", t->next->len);
 
                                        switch (scratch->table_alignment[scratch->table_cell_count]) {
                                                case 'l':
index 42510095d0978665ca7a955076866fa23f863c2a..634451c188c9a6fe598ba109cec5247f4b1b6359 100644 (file)
@@ -540,7 +540,7 @@ void mmd_assign_line_type(mmd_engine * e, token * line) {
                        break;
 
                case TEXT_NUMBER_POSS_LIST:
-                       switch(source[line->child->next->start]) {
+                       switch (source[line->child->next->start]) {
                                case ' ':
                                case '\t':
                                        line->type = LINE_LIST_ENUMERATED;
@@ -562,9 +562,9 @@ void mmd_assign_line_type(mmd_engine * e, token * line) {
                                                case NON_INDENT_SPACE:
                                                        t = line->child;
 
-                                                       while(t->next && ((t->next->type == INDENT_SPACE) ||
-                                                                         (t->next->type == INDENT_TAB) ||
-                                                                         (t->next->type == NON_INDENT_SPACE))) {
+                                                       while (t->next && ((t->next->type == INDENT_SPACE) ||
+                                                                          (t->next->type == INDENT_TAB) ||
+                                                                          (t->next->type == NON_INDENT_SPACE))) {
                                                                tokens_prune(t->next, t->next);
                                                        }
 
@@ -686,7 +686,7 @@ void mmd_assign_line_type(mmd_engine * e, token * line) {
                                // TODO: Should this be an empty list item instead??
                                line->type = LINE_PLAIN;
                        } else {
-                               switch(source[line->child->next->start]) {
+                               switch (source[line->child->next->start]) {
                                        case ' ':
                                        case '\t':
                                                line->type = LINE_LIST_BULLETED;
@@ -708,9 +708,9 @@ void mmd_assign_line_type(mmd_engine * e, token * line) {
                                                        case NON_INDENT_SPACE:
                                                                t = line->child;
 
-                                                               while(t->next && ((t->next->type == INDENT_SPACE) ||
-                                                                                 (t->next->type == INDENT_TAB) ||
-                                                                                 (t->next->type == NON_INDENT_SPACE))) {
+                                                               while (t->next && ((t->next->type == INDENT_SPACE) ||
+                                                                                  (t->next->type == INDENT_TAB) ||
+                                                                                  (t->next->type == NON_INDENT_SPACE))) {
                                                                        tokens_prune(t->next, t->next);
                                                                }
 
@@ -969,8 +969,8 @@ token * mmd_tokenize_string(mmd_engine * e, size_t start, size_t len, bool stop_
        int type;                                                               // TOKEN type
        token * t;                                                              // Create tokens for incorporation
 
-       token * root = token_new(0,start,0);            // Store the final parse tree here
-       token * line = token_new(0,start,0);            // Store current line here
+       token * root = token_new(0, start, 0);          // Store the final parse tree here
+       token * line = token_new(0, start, 0);          // Store current line here
 
        const char * last_stop = &e->dstr->str[start];  // Remember where last token ended
 
@@ -1039,7 +1039,7 @@ token * mmd_tokenize_string(mmd_engine * e, size_t start, size_t len, bool stop_
                                        }
                                }
 
-                               line = token_new(0,s.cur - e->dstr->str,0);
+                               line = token_new(0, s.cur - e->dstr->str, 0);
                                break;
 
                        default:
@@ -1572,7 +1572,7 @@ void mmd_assign_ambidextrous_tokens_in_block(mmd_engine * e, token * block, size
                                                        offset++;
                                                }
 
-                                               t->len = offset-t->start;
+                                               t->len = offset - t->start;
                                                t->can_close = 0;
 
                                                // Shift next token right and move those characters as child node
@@ -1618,7 +1618,7 @@ void pair_emphasis_tokens(token * t) {
                                                (t->next->mate == closer->prev) &&
                                                (t->type == t->next->type) &&
                                                (t->next->mate != t) &&
-                                               (t->start+t->len == t->next->start) &&
+                                               (t->start + t->len == t->next->start) &&
                                                (closer->start == closer->prev->start + closer->prev->len)) {
 
                                                // We have a strong pair
@@ -1647,7 +1647,7 @@ void pair_emphasis_tokens(token * t) {
                }
 
                if (t->child != NULL) {
-                       switch(t->type) {
+                       switch (t->type) {
                                case PAIR_BACKTICK:
                                case PAIR_MATH:
                                        break;
index 5017d0501a5e877c8d6b9716946491f468fa29ca..18ac45fda66676792c2580dfd4b15d146e2d6472 100644 (file)
@@ -398,8 +398,8 @@ static char * correct_dimension_units(char *original) {
                result[i] = tolower(result[i]);
        }
 
-       if (strstr(&result[strlen(result)-2],"px")) {
-               result[strlen(result)-2] = '\0';
+       if (strstr(&result[strlen(result) - 2], "px")) {
+               result[strlen(result) - 2] = '\0';
                strcat(result, "pt");
        }
 
index 0fe921f5fcaf85c4c1b4016af5222c21870d1787..c257175cf581bae055a0608e04e8b591d61d3c3d 100644 (file)
@@ -954,7 +954,7 @@ DString * opendocument_core_file_create(const char * body, mmd_engine * e, const
        // Clean up
        free(result->str);
 
-       status = mz_zip_writer_finalize_heap_archive(zip, (void **) &(result->str), (size_t *) &(result->currentStringLength));
+       status = mz_zip_writer_finalize_heap_archive(zip, (void **) & (result->str), (size_t *) & (result->currentStringLength));
 
        if (!status) {
                fprintf(stderr, "Error finalizing zip archive.\n");
index fb78581843fcd9d3d66d604dbbbefbfad6809b89..b725966ed591b6b714c8ac150a944d5f0e228408 100644 (file)
 long ran_x[KK];                    /* the generator state */
 
 #ifdef __STDC__
-       void ran_array(long aa[],int n)
+       void ran_array(long aa[], int n)
 #else
-       void ran_array(aa,n)    /* put n new random numbers in aa */
+       void ran_array(aa, n)   /* put n new random numbers in aa */
        long *aa;   /* destination */
        int n;      /* array length (must be at least KK) */
 #endif
 {
-       register int i,j;
+       register int i, j;
 
-       for (j=0; j<KK; j++) {
-               aa[j]=ran_x[j];
+       for (j = 0; j < KK; j++) {
+               aa[j] = ran_x[j];
        }
 
-       for (; j<n; j++) {
-               aa[j]=mod_diff(aa[j-KK],aa[j-LL]);
+       for (; j < n; j++) {
+               aa[j] = mod_diff(aa[j - KK], aa[j - LL]);
        }
 
-       for (i=0; i<LL; i++,j++) {
-               ran_x[i]=mod_diff(aa[j-KK],aa[j-LL]);
+       for (i = 0; i < LL; i++, j++) {
+               ran_x[i] = mod_diff(aa[j - KK], aa[j - LL]);
        }
 
-       for (; i<KK; i++,j++) {
-               ran_x[i]=mod_diff(aa[j-KK],ran_x[i-LL]);
+       for (; i < KK; i++, j++) {
+               ran_x[i] = mod_diff(aa[j - KK], ran_x[i - LL]);
        }
 }
 
@@ -57,8 +57,8 @@ long ran_x[KK];                    /* the generator state */
 
 #define QUALITY 1009 /* recommended quality level for high-res use */
 long ran_arr_buf[QUALITY];
-long ran_arr_dummy=-1, ran_arr_started=-1;
-long *ran_arr_ptr=&ran_arr_dummy; /* the next random number, or -1 */
+long ran_arr_dummy = -1, ran_arr_started = -1;
+long *ran_arr_ptr = &ran_arr_dummy; /* the next random number, or -1 */
 
 #define TT  70   /* guaranteed separation between streams */
 #define is_odd(x)  ((x)&1)          /* units bit of x */
@@ -70,70 +70,70 @@ long *ran_arr_ptr=&ran_arr_dummy; /* the next random number, or -1 */
        long seed;            /* selector for different streams */
 #endif
 {
-       register int t,j;
-       long x[KK+KK-1];              /* the preparation buffer */
-       register long ss=(seed+2)&(MM-2);
+       register int t, j;
+       long x[KK + KK - 1];          /* the preparation buffer */
+       register long ss = (seed + 2) & (MM - 2);
 
-       for (j=0; j<KK; j++) {
-               x[j]=ss;                      /* bootstrap the buffer */
-               ss<<=1;
+       for (j = 0; j < KK; j++) {
+               x[j] = ss;                    /* bootstrap the buffer */
+               ss <<= 1;
 
-               if (ss>=MM) {
-                       ss-=MM-2;    /* cyclic shift 29 bits */
+               if (ss >= MM) {
+                       ss -= MM - 2; /* cyclic shift 29 bits */
                }
        }
 
        x[1]++;              /* make x[1] (and only x[1]) odd */
 
-       for (ss=seed&(MM-1),t=TT-1; t; ) {
-               for (j=KK-1; j>0; j--) {
-                       x[j+j]=x[j], x[j+j-1]=0;    /* "square" */
+       for (ss = seed & (MM - 1), t = TT - 1; t; ) {
+               for (j = KK - 1; j > 0; j--) {
+                       x[j + j] = x[j], x[j + j - 1] = 0; /* "square" */
                }
 
-               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]);
+               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]);
 
                if (is_odd(ss)) {              /* "multiply by z" */
-                       for (j=KK; j>0; j--) {
-                               x[j]=x[j-1];
+                       for (j = KK; j > 0; j--) {
+                               x[j] = x[j - 1];
                        }
 
-                       x[0]=x[KK];            /* shift the buffer cyclically */
-                       x[LL]=mod_diff(x[LL],x[KK]);
+                       x[0] = x[KK];          /* shift the buffer cyclically */
+                       x[LL] = mod_diff(x[LL], x[KK]);
                }
 
                if (ss) {
-                       ss>>=1;
+                       ss >>= 1;
                } else {
                        t--;
                }
        }
 
-       for (j=0; j<LL; j++) {
-               ran_x[j+KK-LL]=x[j];
+       for (j = 0; j < LL; j++) {
+               ran_x[j + KK - LL] = x[j];
        }
 
-       for (; j<KK; j++) {
-               ran_x[j-LL]=x[j];
+       for (; j < KK; j++) {
+               ran_x[j - LL] = x[j];
        }
 
-       for (j=0; j<10; j++) {
-               ran_array(x,KK+KK-1);    /* warm things up */
+       for (j = 0; j < 10; j++) {
+               ran_array(x, KK + KK - 1); /* warm things up */
        }
 
-       ran_arr_ptr=&ran_arr_started;
+       ran_arr_ptr = &ran_arr_started;
 }
 
 #define ran_arr_next() (*ran_arr_ptr>=0? *ran_arr_ptr++: ran_arr_cycle())
 long ran_arr_cycle() {
-       if (ran_arr_ptr==&ran_arr_dummy) {
+       if (ran_arr_ptr == &ran_arr_dummy) {
                ran_start(314159L);    /* the user forgot to initialize */
        }
 
-       ran_array(ran_arr_buf,QUALITY);
-       ran_arr_buf[KK]=-1;
-       ran_arr_ptr=ran_arr_buf+1;
+       ran_array(ran_arr_buf, QUALITY);
+       ran_arr_buf[KK] = -1;
+       ran_arr_ptr = ran_arr_buf + 1;
        return ran_arr_buf[0];
 }
 
index 916f45db25b7d4ddd85bce368750085b645388c8..59adad1bdff39ec5f970821d9afdea1864a97c37 100644 (file)
@@ -268,7 +268,7 @@ void traverse_for_images(token * t, DString * text, mmd_engine * e, long * offse
        link * l;
 
        while (t) {
-               switch(t->type) {
+               switch (t->type) {
                        case PAIR_BRACKET_IMAGE:
                                if (t->next && t->next->type == PAIR_PAREN) {
                                        t = t->next;
@@ -426,7 +426,7 @@ DString * textbundle_create(const char * body, mmd_engine * e, const char * dire
        // Finalize zip archive and extract data
        free(result->str);
 
-       status = mz_zip_writer_finalize_heap_archive(&zip, (void **) &(result->str), (size_t *) &(result->currentStringLength));
+       status = mz_zip_writer_finalize_heap_archive(&zip, (void **) & (result->str), (size_t *) & (result->currentStringLength));
 
        if (!status) {
                fprintf(stderr, "Error finalizing zip.\n");
index c32cd8f31440495ff42965141e57fe830e8bc342..d92da7179d4e72cf41aa141d42ad645f8f3a38bf 100644 (file)
@@ -367,7 +367,7 @@ void mmd_transclude_source(DString * source, const char * search_path, const cha
                        text[stop - start - 2] = '\0';
 
                        // Is this just {{TOC}}
-                       if (strcmp("TOC",text) == 0) {
+                       if (strcmp("TOC", text) == 0) {
                                start = strstr(stop, "{{");
                                continue;
                        }
@@ -465,7 +465,7 @@ void mmd_transclude_source(DString * source, const char * search_path, const cha
                                        d_string_erase(buffer, 0, offset);
                                } else {
                                        // Do we need to strip BOM?
-                                       if (strncmp(buffer->str, "\xef\xbb\xbf",3) == 0) {
+                                       if (strncmp(buffer->str, "\xef\xbb\xbf", 3) == 0) {
                                                d_string_erase(buffer, 0, 3);
                                        }
                                }
index 5426f2b488c4ba92940028c6049a9a2586fec169..eed3cbe1cea7b26639dfdaf734a96238f76c7845 100644 (file)
@@ -113,33 +113,33 @@ char * uuid_string_from_bits(unsigned char * raw) {
 // http://stackoverflow.com/questions/322938/recommended-way-to-initialize-srand
 // http://www.concentric.net/~Ttwang/tech/inthash.htm
 unsigned long mix(unsigned long a, unsigned long b, unsigned long c) {
-       a=a-b;
-       a=a-c;
-       a=a^(c >> 13);
-       b=b-c;
-       b=b-a;
-       b=b^(a << 8);
-       c=c-a;
-       c=c-b;
-       c=c^(b >> 13);
-       a=a-b;
-       a=a-c;
-       a=a^(c >> 12);
-       b=b-c;
-       b=b-a;
-       b=b^(a << 16);
-       c=c-a;
-       c=c-b;
-       c=c^(b >> 5);
-       a=a-b;
-       a=a-c;
-       a=a^(c >> 3);
-       b=b-c;
-       b=b-a;
-       b=b^(a << 10);
-       c=c-a;
-       c=c-b;
-       c=c^(b >> 15);
+       a = a - b;
+       a = a - c;
+       a = a ^ (c >> 13);
+       b = b - c;
+       b = b - a;
+       b = b ^ (a << 8);
+       c = c - a;
+       c = c - b;
+       c = c ^ (b >> 13);
+       a = a - b;
+       a = a - c;
+       a = a ^ (c >> 12);
+       b = b - c;
+       b = b - a;
+       b = b ^ (a << 16);
+       c = c - a;
+       c = c - b;
+       c = c ^ (b >> 5);
+       a = a - b;
+       a = a - c;
+       a = a ^ (c >> 3);
+       b = b - c;
+       b = b - a;
+       b = b ^ (a << 10);
+       c = c - a;
+       c = c - b;
+       c = c ^ (b >> 15);
        return c;
 }
 
index 421fd6ea57051a7db60d492e047fab67d00962ed..701d9271d1b0ae692c4e51d38723c01951e97e19 100644 (file)
@@ -409,8 +409,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));
                }
@@ -1020,7 +1020,7 @@ void extract_from_paren(token * paren, const char * source, char ** url, char **
 
 /// Create a link from an explicit link `[foo](bar)`
 link * explicit_link(scratch_pad * scratch, token * bracket, token * paren, const char * source) {
-       char * url_char =NULL;
+       char * url_char = NULL;
        char * title_char = NULL;
        char * attr_char = NULL;
        link * l = NULL;
@@ -1346,10 +1346,10 @@ void process_definition_block(mmd_engine * e, token * block) {
                                        f = footnote_new(e->dstr->str, label, block->child, false);
 
                                        if (f && f->clean_text) {
-                                               memmove(f->clean_text, &(f->clean_text)[1],strlen(f->clean_text));
+                                               memmove(f->clean_text, &(f->clean_text)[1], strlen(f->clean_text));
 
                                                while (char_is_whitespace((f->clean_text)[0])) {
-                                                       memmove(f->clean_text, &(f->clean_text)[1],strlen(f->clean_text));
+                                                       memmove(f->clean_text, &(f->clean_text)[1], strlen(f->clean_text));
                                                }
                                        }
 
@@ -1383,7 +1383,7 @@ void process_definition_block(mmd_engine * e, token * block) {
                                        f = footnote_new(e->dstr->str, label, block->child, false);
 
                                        if (f && f->clean_text) {
-                                               memmove(f->clean_text, &(f->clean_text)[1],strlen(f->clean_text));
+                                               memmove(f->clean_text, &(f->clean_text)[1], strlen(f->clean_text));
                                        }
 
                                        //if (f && f->label_text)
@@ -1466,7 +1466,7 @@ token * manual_label_from_header(token * h, const char * source) {
                        case PAIR_BRACKET:
                                label = walker;
 
-                               while(walker && walker->type == PAIR_BRACKET) {
+                               while (walker && walker->type == PAIR_BRACKET) {
                                        walker = walker->prev;
                                        count++;
                                }
@@ -2579,7 +2579,7 @@ bool raw_filter_text_matches(char * pattern, short format) {
        } else if (strcmp("{=*}", pattern) == 0) {
                return true;
        } else {
-               switch(format) {
+               switch (format) {
                        case FORMAT_HTML:
                                if (strstr(pattern, "html")) {
                                        return true;
index 18216c19aceb84b7ef6100d6f9cce9d6c5c2d31c..f8ce39059d31124b032854eeb15a59ea47a3c8c4 100644 (file)
@@ -170,7 +170,7 @@ int main(int argc, char** argv) {
                a_format                = arg_str0("t", "to", "FORMAT", "convert to FORMAT, FORMAT = html|latex|beamer|memoir|mmd|odt|fodt|epub|bundle|bundlezip"),
                a_o                             = arg_file0("o", "output", "FILE", "send output to FILE"),
 
-               a_rem3                  = arg_rem("",""),
+               a_rem3                  = arg_rem("", ""),
 
                a_accept                = arg_lit0("a", "accept", "accept all CriticMarkup changes"),
                a_reject                = arg_lit0("r", "reject", "reject all CriticMarkup changes"),
@@ -186,7 +186,7 @@ int main(int argc, char** argv) {
 
                a_rem6                  = arg_rem("", ""),
 
-               a_file                  = arg_filen(NULL, NULL, "<FILE>", 0, argc+2, "read input from file(s) -- use stdin if no files given"),
+               a_file                  = arg_filen(NULL, NULL, "<FILE>", 0, argc + 2, "read input from file(s) -- use stdin if no files given"),
 
                a_end                   = arg_end(20),
        };