Fix signedness of format strings

Format strings used %d to print variables with unsigned values.
Changing to %u to match signedness.
Fixes "clang -Wformat-signedness" warnings.
This commit is contained in:
Hanno Böck 2024-10-20 08:45:59 +02:00
parent b70c8f5e51
commit 424dd12400
3 changed files with 5 additions and 5 deletions

View file

@ -127,7 +127,7 @@ dumpContentModelElement(const XML_Content *model, unsigned level,
}
// Node
printf("[%u] type=%s(%d), quant=%s(%d)", (unsigned)(model - root),
printf("[%u] type=%s(%u), quant=%s(%u)", (unsigned)(model - root),
contentTypeName(model->type), model->type,
contentQuantName(model->quant), model->quant);
if (model->name) {
@ -135,7 +135,7 @@ dumpContentModelElement(const XML_Content *model, unsigned level,
} else {
printf(", name=NULL");
}
printf(", numchildren=%d", model->numchildren);
printf(", numchildren=%u", model->numchildren);
printf("\n");
}

View file

@ -7856,7 +7856,7 @@ accountingReportDiff(XML_Parser rootParser,
assert(! rootParser->m_parentParser);
fprintf(stderr,
" (+" EXPAT_FMT_PTRDIFF_T("6") " bytes %s|%d, xmlparse.c:%d) %*s\"",
" (+" EXPAT_FMT_PTRDIFF_T("6") " bytes %s|%u, xmlparse.c:%d) %*s\"",
bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
levelsAwayFromRootParser, source_line, 10, "");
@ -7969,7 +7969,7 @@ entityTrackingReportStats(XML_Parser rootParser, ENTITY *entity,
fprintf(
stderr,
"expat: Entities(%p): Count %9d, depth %2d/%2d %*s%s%s; %s length %d (xmlparse.c:%d)\n",
"expat: Entities(%p): Count %9u, depth %2u/%2u %*s%s%s; %s length %d (xmlparse.c:%d)\n",
(void *)rootParser, rootParser->m_entity_stats.countEverOpened,
rootParser->m_entity_stats.currentDepth,
rootParser->m_entity_stats.maximumDepthSeen,

View file

@ -91,7 +91,7 @@ reportError(XML_Parser parser, const XML_Char *filename) {
filename, XML_GetErrorLineNumber(parser),
XML_GetErrorColumnNumber(parser), message);
else
ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code);
ftprintf(stderr, T("%s: (unknown message %u)\n"), filename, code);
}
/* This implementation will give problems on files larger than INT_MAX. */