summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-12-28 16:05:42 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-12-28 16:05:42 -0800
commit11a29f6219ab9c72c0863e47ba386d7b3e1162d5 (patch)
tree7811d042876a5e6061e5543e48ec2e42f75e8aa5 /src
parentc22b173c1fee932a9469f95c71f74a9ec0ca1784 (diff)
Reformat sources.
Diffstat (limited to 'src')
-rw-r--r--src/blocks.c6
-rw-r--r--src/chunk.h8
-rw-r--r--src/latex.c13
-rw-r--r--src/scanners.h3
-rw-r--r--src/xml.c6
5 files changed, 21 insertions, 15 deletions
diff --git a/src/blocks.c b/src/blocks.c
index 75d005d..773179e 100644
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -336,7 +336,8 @@ static void process_inlines(cmark_node *root, cmark_reference_map *refmap,
while ((ev_type = cmark_iter_next(iter)) != CMARK_EVENT_DONE) {
cur = cmark_iter_get_node(iter);
if (ev_type == CMARK_EVENT_ENTER) {
- if (cur->type == CMARK_NODE_PARAGRAPH || cur->type == CMARK_NODE_HEADING) {
+ if (cur->type == CMARK_NODE_PARAGRAPH ||
+ cur->type == CMARK_NODE_HEADING) {
cmark_parse_inlines(cur, refmap, options);
}
}
@@ -812,7 +813,8 @@ static void S_process_line(cmark_parser *parser, const unsigned char *buffer,
} else if (!indented &&
!(container->type == CMARK_NODE_PARAGRAPH && !all_matched) &&
- (matched = scan_thematic_break(&input, parser->first_nonspace))) {
+ (matched =
+ scan_thematic_break(&input, parser->first_nonspace))) {
// it's only now that we know the line is not part of a setext heading:
container = add_child(parser, container, CMARK_NODE_THEMATIC_BREAK,
diff --git a/src/chunk.h b/src/chunk.h
index b25831b..7007492 100644
--- a/src/chunk.h
+++ b/src/chunk.h
@@ -48,8 +48,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;
@@ -96,8 +96,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;
}
diff --git a/src/latex.c b/src/latex.c
index c961a08..57d474c 100644
--- a/src/latex.c
+++ b/src/latex.c
@@ -142,12 +142,13 @@ static inline void outc(cmark_renderer *renderer, cmark_escaping escape,
}
}
-typedef enum { NO_LINK,
- URL_AUTOLINK,
- EMAIL_AUTOLINK,
- NORMAL_LINK,
- INTERNAL_LINK
- } link_type;
+typedef enum {
+ NO_LINK,
+ URL_AUTOLINK,
+ EMAIL_AUTOLINK,
+ NORMAL_LINK,
+ INTERNAL_LINK
+} link_type;
static link_type get_link_type(cmark_node *node) {
size_t title_len, url_len;
diff --git a/src/scanners.h b/src/scanners.h
index c2c03eb..5e3cbe7 100644
--- a/src/scanners.h
+++ b/src/scanners.h
@@ -44,7 +44,8 @@ bufsize_t _scan_dangerous_url(const unsigned char *p);
#define scan_link_title(c, n) _scan_at(&_scan_link_title, c, n)
#define scan_spacechars(c, n) _scan_at(&_scan_spacechars, c, n)
#define scan_atx_heading_start(c, n) _scan_at(&_scan_atx_heading_start, c, n)
-#define scan_setext_heading_line(c, n) _scan_at(&_scan_setext_heading_line, c, n)
+#define scan_setext_heading_line(c, n) \
+ _scan_at(&_scan_setext_heading_line, c, n)
#define scan_thematic_break(c, n) _scan_at(&_scan_thematic_break, c, n)
#define scan_open_code_fence(c, n) _scan_at(&_scan_open_code_fence, c, n)
#define scan_close_code_fence(c, n) _scan_at(&_scan_close_code_fence, c, n)
diff --git a/src/xml.c b/src/xml.c
index df3e9a7..a06cdd3 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -105,10 +105,12 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type,
case CMARK_NODE_CUSTOM_BLOCK:
case CMARK_NODE_CUSTOM_INLINE:
cmark_strbuf_puts(xml, " on_enter=\"");
- escape_xml(xml, node->as.custom.on_enter.data, node->as.custom.on_enter.len);
+ escape_xml(xml, node->as.custom.on_enter.data,
+ node->as.custom.on_enter.len);
cmark_strbuf_putc(xml, '"');
cmark_strbuf_puts(xml, " on_exit=\"");
- escape_xml(xml, node->as.custom.on_exit.data, node->as.custom.on_exit.len);
+ escape_xml(xml, node->as.custom.on_exit.data,
+ node->as.custom.on_exit.len);
cmark_strbuf_putc(xml, '"');
break;
case CMARK_NODE_LINK: