diff --git a/Sources/CGumboParser/gumbo.h b/Sources/CGumboParser/gumbo.h index 77a3516..c489182 100644 --- a/Sources/CGumboParser/gumbo.h +++ b/Sources/CGumboParser/gumbo.h @@ -84,7 +84,7 @@ typedef struct { * name. It also has efficiency benefits, by letting the parser work * with enums instead of strings. */ -typedef enum { +typedef enum : size_t { GUMBO_TAG_HTML, GUMBO_TAG_HEAD, GUMBO_TAG_TITLE, diff --git a/Sources/CGumboParser/insertion_mode.h b/Sources/CGumboParser/insertion_mode.h index 6cb1d34..9d19d7d 100644 --- a/Sources/CGumboParser/insertion_mode.h +++ b/Sources/CGumboParser/insertion_mode.h @@ -4,7 +4,7 @@ // https://html.spec.whatwg.org/multipage/parsing.html#insertion-mode // If new enum values are added, be sure to update the kTokenHandlers // dispatch table in parser.c. -typedef enum { +typedef enum : size_t { GUMBO_INSERTION_MODE_INITIAL, GUMBO_INSERTION_MODE_BEFORE_HTML, GUMBO_INSERTION_MODE_BEFORE_HEAD, diff --git a/Sources/CGumboParser/parser.c b/Sources/CGumboParser/parser.c index 6988b58..a34ad56 100644 --- a/Sources/CGumboParser/parser.c +++ b/Sources/CGumboParser/parser.c @@ -4495,7 +4495,7 @@ HOT GumboOutput* gumbo_parse_with_options ( break; } gumbo_debug ( - "Handling %s token @%zu:%zu in state %u.\n", + "Handling %s token @%zu:%zu in state %zu.\n", (char*) token_type, token.position.line, token.position.column, diff --git a/Sources/CGumboParser/svg_attrs.c b/Sources/CGumboParser/svg_attrs.c index bfe49e9..eafbe8e 100644 --- a/Sources/CGumboParser/svg_attrs.c +++ b/Sources/CGumboParser/svg_attrs.c @@ -49,7 +49,7 @@ hash (register const char *str, register size_t len) 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78 }; - register unsigned int hval = len; + register unsigned int hval = (unsigned int)len; switch (hval) { diff --git a/Sources/CGumboParser/svg_tags.c b/Sources/CGumboParser/svg_tags.c index 4b7f41f..8b86671 100644 --- a/Sources/CGumboParser/svg_tags.c +++ b/Sources/CGumboParser/svg_tags.c @@ -49,7 +49,7 @@ hash (register const char *str, register size_t len) 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43 }; - register unsigned int hval = len; + register unsigned int hval = (unsigned int)len; switch (hval) { diff --git a/Sources/CGumboParser/tag_lookup.c b/Sources/CGumboParser/tag_lookup.c index 18fb354..6538e8e 100644 --- a/Sources/CGumboParser/tag_lookup.c +++ b/Sources/CGumboParser/tag_lookup.c @@ -49,7 +49,7 @@ hash (register const char *str, register size_t len) 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272 }; - register unsigned int hval = len; + register unsigned int hval = (unsigned int)len; switch (hval) {