- Commit
- 636d6018ea6bc6697b6491e0e47c4ae1ccad32fe
- Parent
- 85d47d07d676b8bca1d98efee45d25af011a813b
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
Ran 'make format' to reformat code.
My personal build of CMark ✏️
Ran 'make format' to reformat code.
3 files changed, 9 insertions, 8 deletions
Status | File Name | N° Changes | Insertions | Deletions |
Modified | api_test/main.c | 3 | 2 | 1 |
Modified | src/blocks.c | 6 | 3 | 3 |
Modified | src/chunk.h | 8 | 4 | 4 |
diff --git a/api_test/main.c b/api_test/main.c @@ -737,7 +737,8 @@ static void utf8(test_batch_runner *runner) { static const char string_with_nul_lf[] = "```\n\0\n```\n"; html = cmark_markdown_to_html( string_with_nul_lf, sizeof(string_with_nul_lf) - 1, CMARK_OPT_DEFAULT); - STR_EQ(runner, html, "<pre><code>\xef\xbf\xbd\n</code></pre>\n", "utf8 with \\0\\n"); + STR_EQ(runner, html, "<pre><code>\xef\xbf\xbd\n</code></pre>\n", + "utf8 with \\0\\n"); free(html); }
diff --git a/src/blocks.c b/src/blocks.c @@ -571,15 +571,15 @@ static void S_parser_feed(cmark_parser *parser, const unsigned char *buffer, buffer += chunk_len; if (buffer < end) { if (*buffer == '\0') { - // skip over NULL - buffer++; + // skip over NULL + buffer++; } else { // skip over line ending characters if (*buffer == '\r') { buffer++; if (buffer == end) parser->last_buffer_ended_with_cr = true; - } + } if (*buffer == '\n') buffer++; }
diff --git a/src/chunk.h b/src/chunk.h @@ -50,8 +50,8 @@ static CMARK_INLINE void cmark_chunk_trim(cmark_chunk *c) { cmark_chunk_rtrim(c); } -static CMARK_INLINE bufsize_t - cmark_chunk_strchr(cmark_chunk *ch, int c, bufsize_t offset) { +static CMARK_INLINE bufsize_t cmark_chunk_strchr(cmark_chunk *ch, int c, + bufsize_t offset) { const unsigned char *p = (unsigned char *)memchr(ch->data + offset, c, ch->len - offset); return p ? (bufsize_t)(p - ch->data) : ch->len; @@ -99,8 +99,8 @@ static CMARK_INLINE cmark_chunk cmark_chunk_literal(const char *data) { return c; } -static CMARK_INLINE cmark_chunk - cmark_chunk_dup(const cmark_chunk *ch, bufsize_t pos, bufsize_t len) { +static CMARK_INLINE cmark_chunk cmark_chunk_dup(const cmark_chunk *ch, + bufsize_t pos, bufsize_t len) { cmark_chunk c = {ch->data + pos, len, 0}; return c; }