summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commonmark.c4
-rw-r--r--src/html.c4
-rw-r--r--src/latex.c2
-rw-r--r--src/man.c2
-rw-r--r--src/xml.c3
5 files changed, 8 insertions, 7 deletions
diff --git a/src/commonmark.c b/src/commonmark.c
index 95f5a80..f5a352d 100644
--- a/src/commonmark.c
+++ b/src/commonmark.c
@@ -17,6 +17,8 @@
#define LIT(s) renderer->out(renderer, s, false, LITERAL)
#define CR() renderer->cr(renderer)
#define BLANKLINE() renderer->blankline(renderer)
+#define ENCODED_SIZE 20
+#define LISTMARKER_SIZE 20
// Functions to convert cmark_nodes to commonmark strings.
@@ -26,7 +28,6 @@ static CMARK_INLINE void outc(cmark_renderer *renderer, cmark_escaping escape,
bool follows_digit =
renderer->buffer->size > 0 &&
cmark_isdigit(renderer->buffer->ptr[renderer->buffer->size - 1]);
- const size_t ENCODED_SIZE = 20;
char encoded[ENCODED_SIZE];
needs_escaping =
@@ -168,7 +169,6 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
bool entering = (ev_type == CMARK_EVENT_ENTER);
const char *info, *code, *title;
size_t info_len, code_len;
- const size_t LISTMARKER_SIZE = 20;
char listmarker[LISTMARKER_SIZE];
char *emph_delim;
bufsize_t marker_width;
diff --git a/src/html.c b/src/html.c
index 753e5e2..9ffa08a 100644
--- a/src/html.c
+++ b/src/html.c
@@ -10,6 +10,8 @@
#include "houdini.h"
#include "scanners.h"
+#define BUFFER_SIZE 100
+
// Functions to convert cmark_nodes to HTML strings.
static void escape_html(cmark_strbuf *dest, const unsigned char *source,
@@ -29,7 +31,6 @@ struct render_state {
static void S_render_sourcepos(cmark_node *node, cmark_strbuf *html,
int options) {
- const size_t BUFFER_SIZE = 100;
char buffer[BUFFER_SIZE];
if (CMARK_OPT_SOURCEPOS & options) {
snprintf(buffer, BUFFER_SIZE, " data-sourcepos=\"%d:%d-%d:%d\"",
@@ -47,7 +48,6 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type,
char start_heading[] = "<h0";
char end_heading[] = "</h0";
bool tight;
- const size_t BUFFER_SIZE = 100;
char buffer[BUFFER_SIZE];
bool entering = (ev_type == CMARK_EVENT_ENTER);
diff --git a/src/latex.c b/src/latex.c
index 71559ba..cd2f6f3 100644
--- a/src/latex.c
+++ b/src/latex.c
@@ -17,6 +17,7 @@
#define LIT(s) renderer->out(renderer, s, false, LITERAL)
#define CR() renderer->cr(renderer)
#define BLANKLINE() renderer->blankline(renderer)
+#define LIST_NUMBER_STRING_SIZE 20
static CMARK_INLINE void outc(cmark_renderer *renderer, cmark_escaping escape,
int32_t c, unsigned char nextc) {
@@ -217,7 +218,6 @@ static int S_get_enumlevel(cmark_node *node) {
static int S_render_node(cmark_renderer *renderer, cmark_node *node,
cmark_event_type ev_type, int options) {
int list_number;
- const size_t LIST_NUMBER_STRING_SIZE = 20;
char list_number_string[LIST_NUMBER_STRING_SIZE];
bool entering = (ev_type == CMARK_EVENT_ENTER);
cmark_list_type list_type;
diff --git a/src/man.c b/src/man.c
index 2ce7540..3d8bc20 100644
--- a/src/man.c
+++ b/src/man.c
@@ -14,6 +14,7 @@
#define LIT(s) renderer->out(renderer, s, false, LITERAL)
#define CR() renderer->cr(renderer)
#define BLANKLINE() renderer->blankline(renderer)
+#define LIST_NUMBER_SIZE 20
// Functions to convert cmark_nodes to groff man strings.
static void S_outc(cmark_renderer *renderer, cmark_escaping escape, int32_t c,
@@ -110,7 +111,6 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
tmp = tmp->prev;
list_number += 1;
}
- const size_t LIST_NUMBER_SIZE = 20;
char list_number_s[LIST_NUMBER_SIZE];
snprintf(list_number_s, LIST_NUMBER_SIZE, "\"%d.\" 4", list_number);
LIT(list_number_s);
diff --git a/src/xml.c b/src/xml.c
index fc33886..12bd629 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -9,6 +9,8 @@
#include "buffer.h"
#include "houdini.h"
+#define BUFFER_SIZE 100
+
// Functions to convert cmark_nodes to XML strings.
static void escape_xml(cmark_strbuf *dest, const unsigned char *source,
@@ -34,7 +36,6 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type,
bool literal = false;
cmark_delim_type delim;
bool entering = (ev_type == CMARK_EVENT_ENTER);
- const size_t BUFFER_SIZE = 100;
char buffer[BUFFER_SIZE];
if (entering) {