summaryrefslogtreecommitdiff
path: root/src/inlines.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2014-11-15 19:39:32 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2014-11-16 21:15:09 +0100
commit5e6488d36b9172c10e260c5f827c40a3dcc2db00 (patch)
tree8457bd16049881e0d57b0916035b1ea0fbda8d43 /src/inlines.c
parentfe80f7b35fc168e0d1bb142a52073c6f0e1e9ef8 (diff)
Rename variables named 'new'
Needed for C++ compatibility.
Diffstat (limited to 'src/inlines.c')
-rw-r--r--src/inlines.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/inlines.c b/src/inlines.c
index 70525d6..76a70bc 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -39,17 +39,17 @@ static int subject_find_special_char(subject *subj);
static unsigned char *bufdup(const unsigned char *buf)
{
- unsigned char *new = NULL;
+ unsigned char *new_buf = NULL;
if (buf) {
int len = strlen((char *)buf);
- new = (unsigned char *)calloc(len + 1, sizeof(*new));
- if(new != NULL) {
- memcpy(new, buf, len + 1);
+ new_buf = (unsigned char *)calloc(len + 1, sizeof(*new_buf));
+ if(new_buf != NULL) {
+ memcpy(new_buf, buf, len + 1);
}
}
- return new;
+ return new_buf;
}
static void subject_from_buf(subject *e, strbuf *buffer, reference_map *refmap)
@@ -743,7 +743,7 @@ static int subject_find_special_char(subject *subj)
// Return 0 if no inline can be parsed, 1 otherwise.
static int parse_inline(subject* subj, node_inl ** last)
{
- node_inl* new = NULL;
+ node_inl* new_inl = NULL;
chunk contents;
unsigned char c;
int endpos;
@@ -753,40 +753,40 @@ static int parse_inline(subject* subj, node_inl ** last)
}
switch(c){
case '\n':
- new = handle_newline(subj);
+ new_inl = handle_newline(subj);
break;
case '`':
- new = handle_backticks(subj);
+ new_inl = handle_backticks(subj);
break;
case '\\':
- new = handle_backslash(subj);
+ new_inl = handle_backslash(subj);
break;
case '&':
- new = handle_entity(subj);
+ new_inl = handle_entity(subj);
break;
case '<':
- new = handle_pointy_brace(subj);
+ new_inl = handle_pointy_brace(subj);
break;
case '*':
case '_':
- new = handle_strong_emph(subj, c, last);
+ new_inl = handle_strong_emph(subj, c, last);
break;
case '[':
advance(subj);
- new = make_str(chunk_literal("["));
- subj->delimiters = push_delimiter(subj, 1, '[', true, false, new);
+ new_inl = make_str(chunk_literal("["));
+ subj->delimiters = push_delimiter(subj, 1, '[', true, false, new_inl);
break;
case ']':
- new = handle_close_bracket(subj, last);
+ new_inl = handle_close_bracket(subj, last);
break;
case '!':
advance(subj);
if (peek_char(subj) == '[') {
advance(subj);
- new = make_str(chunk_literal("!["));
- subj->delimiters = push_delimiter(subj, 1, '!', false, true, new);
+ new_inl = make_str(chunk_literal("!["));
+ subj->delimiters = push_delimiter(subj, 1, '!', false, true, new_inl);
} else {
- new = make_str(chunk_literal("!"));
+ new_inl = make_str(chunk_literal("!"));
}
break;
default:
@@ -799,13 +799,13 @@ static int parse_inline(subject* subj, node_inl ** last)
chunk_rtrim(&contents);
}
- new = make_str(contents);
+ new_inl = make_str(contents);
}
if (*last == NULL) {
- *last = new;
- } else if (new) {
- cmark_append_inlines(*last, new);
- *last = new;
+ *last = new_inl;
+ } else if (new_inl) {
+ cmark_append_inlines(*last, new_inl);
+ *last = new_inl;
}
return 1;