Silence "unused parameter" warnings Merely added a suitable macro. Didn't refactor any code to actually figure out why the parameters were not used.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
diff --git a/src/md4c.c b/src/md4c.c
index 830c9e1..d7b814a 100644
--- a/src/md4c.c
+++ b/src/md4c.c
@@ -89,6 +89,9 @@
#define MD4C_FALLTHROUGH() ((void)0)
#endif
+/* Suppress "unused parameter" warnings. */
+#define MD4C_UNUSED(x) ((void)x)
+
/************************
*** Internal Types ***
@@ -911,6 +914,8 @@ md_merge_lines(MD_CTX* ctx, OFF beg, OFF end, const MD_LINE* lines, int n_lines,
int line_index = 0;
OFF off = beg;
+ MD4C_UNUSED(n_lines);
+
while(1) {
const MD_LINE* line = &lines[line_index];
OFF line_end = line->end;
@@ -1252,6 +1257,7 @@ static int
md_is_hex_entity_contents(MD_CTX* ctx, const CHAR* text, OFF beg, OFF max_end, OFF* p_end)
{
OFF off = beg;
+ MD4C_UNUSED(ctx);
while(off < max_end && ISXDIGIT_(text[off]) && off - beg <= 8)
off++;
@@ -1268,6 +1274,7 @@ static int
md_is_dec_entity_contents(MD_CTX* ctx, const CHAR* text, OFF beg, OFF max_end, OFF* p_end)
{
OFF off = beg;
+ MD4C_UNUSED(ctx);
while(off < max_end && ISDIGIT_(text[off]) && off - beg <= 8)
off++;
@@ -1284,6 +1291,7 @@ static int
md_is_named_entity_contents(MD_CTX* ctx, const CHAR* text, OFF beg, OFF max_end, OFF* p_end)
{
OFF off = beg;
+ MD4C_UNUSED(ctx);
if(off < max_end && ISALPHA_(text[off]))
off++;
@@ -1389,6 +1397,8 @@ md_build_attr_append_substr(MD_CTX* ctx, MD_ATTRIBUTE_BUILD* build,
static void
md_free_attribute(MD_CTX* ctx, MD_ATTRIBUTE_BUILD* build)
{
+ MD4C_UNUSED(ctx);
+
if(build->substr_alloc > 0) {
free(build->text);
free(build->substr_types);
@@ -3951,6 +3961,8 @@ md_analyze_marks(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
int mark_beg, int mark_end, const CHAR* mark_chars)
{
int i = mark_beg;
+ MD4C_UNUSED(lines);
+ MD4C_UNUSED(n_lines);
while(i < mark_end) {
MD_MARK* mark = &ctx->marks[i];