do not define a non-const in this way - webdump - HTML to plain-text converter … | |
git clone git://git.codemadness.org/webdump | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit f541d79e5f8a6f69df9494a1e96bee17b88fb82f | |
parent 16f2855bb159b11fd58bc0ccdf9069c00b0bafaa | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Fri, 8 Sep 2023 15:46:25 +0200 | |
do not define a non-const in this way | |
Add a macro for this case. This fixes a compiler error with tcc. | |
Diffstat: | |
M webdump.c | 17 +++++++++-------- | |
1 file changed, 9 insertions(+), 8 deletions(-) | |
--- | |
diff --git a/webdump.c b/webdump.c | |
@@ -178,7 +178,8 @@ static int ncells = 0; /* current cell count */ | |
static int hadnewline = 0; /* count for repeated newlines */ | |
/* flag for skipping initial white-space in tag: for HTML white-space handling… | |
static int skipinitialws = 1; | |
-static const int defaultindent = 2; | |
+#define DEFAULT_INDENT 2 | |
+static const int defaultindent = DEFAULT_INDENT; | |
static int indent; | |
/* previous output sequential newlines, used for calculating margins between | |
elements and reducing excessive newlines */ | |
@@ -229,12 +230,12 @@ static struct tag tags[] = { | |
{ "figcaption", DisplayBlock, 0, 0, … | |
{ "figure", DisplayBlock, 0, 0, … | |
{ "footer", DisplayBlock, 0, 0, … | |
-{ "h1", DisplayHeader, MarkupBold, 0, … | |
-{ "h2", DisplayHeader, MarkupBold, 0, … | |
-{ "h3", DisplayHeader, MarkupBold, 0, … | |
-{ "h4", DisplayHeader, MarkupBold, 0, … | |
-{ "h5", DisplayHeader, MarkupBold, 0, … | |
-{ "h6", DisplayHeader, MarkupBold, 0, … | |
+{ "h1", DisplayHeader, MarkupBold, 0, … | |
+{ "h2", DisplayHeader, MarkupBold, 0, … | |
+{ "h3", DisplayHeader, MarkupBold, 0, … | |
+{ "h4", DisplayHeader, MarkupBold, 0, … | |
+{ "h5", DisplayHeader, MarkupBold, 0, … | |
+{ "h6", DisplayHeader, MarkupBold, 0, … | |
{ "head", DisplayBlock, 0, 0, … | |
{ "header", DisplayBlock, 0, 0, … | |
{ "hr", DisplayBlock, 0, 0, … | |
@@ -269,7 +270,7 @@ static struct tag tags[] = { | |
{ "th", DisplayTableCell, MarkupBold, DisplayTabl… | |
{ "thead", DisplayInline, 0, DisplayTabl… | |
{ "time", DisplayInline, 0, 0, … | |
-{ "title", DisplayBlock, 0, 0, … | |
+{ "title", DisplayBlock, 0, 0, … | |
{ "tr", DisplayTableRow, 0, DisplayTabl… | |
{ "track", DisplayInline, 0, 0, … | |
{ "u", DisplayInline, MarkupUnderline, 0, … |