summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-06-16 13:18:31 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-06-16 13:18:31 -0700
commit9ae4975fc049de433ad8e2399c391d207208233a (patch)
tree930bb6f38b8d3bba16dc4ced81406a9271f81f54 /src
parent0c439ac3ab8c59a90277daad0c2ece5e937a6528 (diff)
astyle formatting changes.
Diffstat (limited to 'src')
-rw-r--r--src/blocks.c2
-rw-r--r--src/buffer.c20
-rw-r--r--src/houdini_html_u.c2
-rw-r--r--src/html.c4
-rw-r--r--src/utf8.c6
5 files changed, 17 insertions, 17 deletions
diff --git a/src/blocks.c b/src/blocks.c
index 2a68f75..8c3e18c 100644
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -613,7 +613,7 @@ S_process_line(cmark_parser *parser, const unsigned char *buffer, bufsize_t byte
if (parser->indent >= container->as.list.marker_offset +
container->as.list.padding) {
parser->offset += container->as.list.marker_offset +
- container->as.list.padding;
+ container->as.list.padding;
} else if (parser->blank) {
parser->offset = parser->first_nonspace;
} else {
diff --git a/src/buffer.c b/src/buffer.c
index 7d16af8..e07fba6 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -29,18 +29,20 @@ void cmark_strbuf_init(cmark_strbuf *buf, bufsize_t initial_size)
cmark_strbuf_grow(buf, initial_size);
}
-void cmark_strbuf_overflow_err() {
+void cmark_strbuf_overflow_err()
+{
fprintf(stderr, "String buffer overflow");
abort();
}
static inline void
-S_strbuf_grow_by(cmark_strbuf *buf, size_t add) {
+S_strbuf_grow_by(cmark_strbuf *buf, size_t add)
+{
size_t target_size = (size_t)buf->size + add;
if (target_size < add /* Integer overflow. */
|| target_size > BUFSIZE_MAX /* Truncation overflow. */
- ) {
+ ) {
cmark_strbuf_overflow_err();
return; /* unreachable */
}
@@ -74,7 +76,7 @@ void cmark_strbuf_grow(cmark_strbuf *buf, bufsize_t target_size)
if (new_size < (size_t)target_size /* Integer overflow. */
|| new_size > BUFSIZE_MAX /* Truncation overflow. */
- ) {
+ ) {
if (target_size >= BUFSIZE_MAX) {
/* No space for terminating null byte. */
cmark_strbuf_overflow_err();
@@ -160,7 +162,7 @@ void cmark_strbuf_put(cmark_strbuf *buf, const unsigned char *data, bufsize_t le
void cmark_strbuf_puts(cmark_strbuf *buf, const char *string)
{
cmark_strbuf_put(buf, (const unsigned char *)string,
- cmark_strbuf_safe_strlen(string));
+ cmark_strbuf_safe_strlen(string));
}
void cmark_strbuf_vprintf(cmark_strbuf *buf, const char *format, va_list ap)
@@ -175,10 +177,10 @@ void cmark_strbuf_vprintf(cmark_strbuf *buf, const char *format, va_list ap)
va_copy(args, ap);
int len = vsnprintf(
- (char *)buf->ptr + buf->size,
- buf->asize - buf->size,
- format, args
- );
+ (char *)buf->ptr + buf->size,
+ buf->asize - buf->size,
+ format, args
+ );
#ifndef HAVE_C99_SNPRINTF
// Assume we're on Windows.
if (len < 0) {
diff --git a/src/houdini_html_u.c b/src/houdini_html_u.c
index 6f94c23..c8e4b93 100644
--- a/src/houdini_html_u.c
+++ b/src/houdini_html_u.c
@@ -29,7 +29,7 @@ S_lookup(int i, unsigned long key)
return cmark_entities[i].bytes;
} else {
int next = key < cmark_entities[i].value ?
- cmark_entities[i].less : cmark_entities[i].greater;
+ cmark_entities[i].less : cmark_entities[i].greater;
if (next == 0) {
return NULL;
} else {
diff --git a/src/html.c b/src/html.c
index a30bbca..69e2d23 100644
--- a/src/html.c
+++ b/src/html.c
@@ -251,7 +251,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
if (entering) {
cmark_strbuf_puts(html, "<a href=\"");
houdini_escape_href(html, node->as.link.url.data,
- node->as.link.url.len);
+ node->as.link.url.len);
if (node->as.link.title.len) {
cmark_strbuf_puts(html, "\" title=\"");
@@ -269,7 +269,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
if (entering) {
cmark_strbuf_puts(html, "<img src=\"");
houdini_escape_href(html, node->as.link.url.data,
- node->as.link.url.len);
+ node->as.link.url.len);
cmark_strbuf_puts(html, "\" alt=\"");
state->plain = node;
diff --git a/src/utf8.c b/src/utf8.c
index a4449dd..f572042 100644
--- a/src/utf8.c
+++ b/src/utf8.c
@@ -134,14 +134,12 @@ void utf8proc_detab(cmark_strbuf *ob, const uint8_t *line, bufsize_t size)
break;
}
i += charlen;
- }
- else if (line[i] == '\0') {
+ } else if (line[i] == '\0') {
// ASCII NUL is technically valid but rejected
// for security reasons.
charlen = 1;
break;
- }
- else {
+ } else {
i++;
}