From 8c6b0b466ea4775c20f53bcd497681dc2f09a2f5 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 20 Dec 2024 13:52:27 -0500 Subject: [PATCH] style: address compiler warnings in the gumbo source --- gumbo-parser/src/ascii.c | 4 ++-- gumbo-parser/src/parser.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gumbo-parser/src/ascii.c b/gumbo-parser/src/ascii.c index 35c4278a99e..f656476da63 100644 --- a/gumbo-parser/src/ascii.c +++ b/gumbo-parser/src/ascii.c @@ -44,8 +44,8 @@ const unsigned char _gumbo_ascii_table[0x80] = { }; // Table generation code. -// clang -DGUMBO_GEN_TABLE=1 ascii.c && ./a.out && rm a.out -#if GUMBO_GEN_TABLE +// clang -DGUMBO_GEN_TABLE ascii.c && ./a.out && rm a.out +#ifdef GUMBO_GEN_TABLE #include int main() { diff --git a/gumbo-parser/src/parser.c b/gumbo-parser/src/parser.c index 06f096f8ddb..96e6f2bdbea 100644 --- a/gumbo-parser/src/parser.c +++ b/gumbo-parser/src/parser.c @@ -318,7 +318,7 @@ static GumboNode* create_node(GumboNodeType type) { return node; } -static GumboNode* new_document_node() { +static GumboNode* new_document_node(void) { GumboNode* document_node = create_node(GUMBO_NODE_DOCUMENT); document_node->parse_flags = GUMBO_INSERTION_BY_PARSER; gumbo_vector_init(1, &document_node->v.document.children); @@ -1997,7 +1997,7 @@ static void adjust_svg_tag(GumboToken* token) { assert(token->type == GUMBO_TOKEN_START_TAG); if (token->v.start_tag.tag == GUMBO_TAG_FOREIGNOBJECT) { assert(token->v.start_tag.name == NULL); - token->v.start_tag.name = "foreignObject"; + token->v.start_tag.name = (char *)"foreignObject"; } else if (token->v.start_tag.tag == GUMBO_TAG_UNKNOWN) { assert(token->v.start_tag.name); const StringReplacement *replacement = gumbo_get_svg_tag_replacement(