Clean up print format specifier usage

This commit is contained in:
Michael Drake 2023-06-17 11:20:09 +01:00
parent a16d5ff10b
commit c987b043b1
6 changed files with 15 additions and 14 deletions

View File

@ -1614,7 +1614,7 @@ static nserror store_write_block(struct store_state *state,
offst);
if (wr != (ssize_t)bse->elem[elem_idx].size) {
NSLOG(netsurf, ERROR,
"Write failed %"PRIssizet" of %"PRId32" bytes from %p at %"PRIsizet" block %d errno %d",
"Write failed %"PRIssizet" of %"PRId32" bytes from %p at %"PRIsizet" block %"PRIu16" errno %d",
wr,
bse->elem[elem_idx].size,
bse->elem[elem_idx].data,
@ -1784,7 +1784,7 @@ static nserror store_read_block(struct store_state *state,
offst);
if (rd != (ssize_t)bse->elem[elem_idx].size) {
NSLOG(netsurf, ERROR,
"Failed reading %"PRIssizet" of %"PRId32" bytes into %p from %"PRIsizet" block %d errno %d",
"Failed reading %"PRIssizet" of %"PRId32" bytes into %p from %"PRIsizet" block %"PRIu16" errno %d",
rd,
bse->elem[elem_idx].size,
bse->elem[elem_idx].data,

View File

@ -38,7 +38,7 @@ static void dump_css_fixed(FILE *stream, css_fixed f)
uint32_t fracpart = ((NSCSS_ABS(f) & 0x3ff) * 1000 + 500) / (1 << 10);
#undef NSCSS_ABS
fprintf(stream, "%s%"PRId32".%03ld", f < 0 ? "-" : "", uintpart, fracpart);
fprintf(stream, "%s%"PRIu32".%03"PRIu32, f < 0 ? "-" : "", uintpart, fracpart);
}
/**
@ -50,7 +50,7 @@ static void dump_css_fixed(FILE *stream, css_fixed f)
static void dump_css_number(FILE *stream, css_fixed val)
{
if (INTTOFIX(FIXTOINT(val)) == val)
fprintf(stream, "%"PRId32"", FIXTOINT(val));
fprintf(stream, "%"PRId32, FIXTOINT(val));
else
dump_css_fixed(stream, val);
}

View File

@ -487,7 +487,7 @@ form_dom_to_data_select(dom_html_select_element *select_element,
&option_element);
if (exp != DOM_NO_ERR) {
NSLOG(netsurf, INFO,
"Could not get options item %"PRId32"", option_index);
"Could not get options item %"PRId32, option_index);
res = NSERROR_DOM;
} else {
res = form_dom_to_data_select_option(
@ -1101,7 +1101,7 @@ form_dom_to_data(struct form *form,
exp = dom_html_collection_item(elements, element_idx, &element);
if (exp != DOM_NO_ERR) {
NSLOG(netsurf, INFO,
"retrieving form element %"PRId32" failed with %d",
"retrieving form element %"PRIu32" failed with %d",
element_idx, exp);
res = NSERROR_DOM;
goto form_dom_to_data_error;
@ -1111,7 +1111,7 @@ form_dom_to_data(struct form *form,
exp = dom_node_get_node_name(element, &nodename);
if (exp != DOM_NO_ERR) {
NSLOG(netsurf, INFO,
"getting element node name %"PRId32" failed with %d",
"getting element node name %"PRIu32" failed with %d",
element_idx, exp);
dom_node_unref(element);
res = NSERROR_DOM;

View File

@ -593,7 +593,7 @@ void hlcache_finalise(void)
num_contents++;
}
NSLOG(netsurf, INFO, "%"PRId32" contents remain before cache drain",
NSLOG(netsurf, INFO, "%"PRIu32" contents remain before cache drain",
num_contents);
/* Drain cache */
@ -608,7 +608,8 @@ void hlcache_finalise(void)
}
} while (num_contents > 0 && num_contents != prev_contents);
NSLOG(netsurf, INFO, "%"PRId32" contents remaining after being polite", num_contents);
NSLOG(netsurf, INFO, "%"PRIu32" contents remaining after being polite",
num_contents);
/* Drain cache again, forcing the matter */
do {
@ -622,12 +623,12 @@ void hlcache_finalise(void)
}
} while (num_contents > 0 && num_contents != prev_contents);
NSLOG(netsurf, INFO, "%"PRId32" contents remaining:", num_contents);
NSLOG(netsurf, INFO, "%"PRIu32" contents remaining:", num_contents);
for (entry = hlcache->content_list; entry != NULL; entry = entry->next) {
hlcache_handle entry_handle = { entry, NULL, NULL };
if (entry->content != NULL) {
NSLOG(netsurf, INFO, " %p : %s (%"PRId32" users)",
NSLOG(netsurf, INFO, " %p : %s (%"PRIu32" users)",
entry,
nsurl_access(hlcache_handle_get_url(&entry_handle)),
content_count_users(entry->content));

View File

@ -3897,7 +3897,7 @@ llcache_initialise(const struct llcache_parameters *prm)
llcache->all_caught_up = true;
NSLOG(llcache, INFO,
"llcache initialising with a limit of %"PRId32" bytes",
"llcache initialising with a limit of %"PRIu32" bytes",
llcache->limit);
/* backing store initialisation */

View File

@ -391,7 +391,7 @@ nsoption_output_value_html(struct nsoption_s *option,
"#%06"PRIX32
"</span> "
"<span style=\"background-color: #%06"PRIx32"; "
"border: 1px solid #%06x; "
"border: 1px solid #%06"PRIx32"; "
"display: inline-block; "
"width: 1em; height: 1em;\">"
"</span>",
@ -460,7 +460,7 @@ nsoption_output_value_text(struct nsoption_s *option,
rgbcolour = (((0x000000FF & option->value.c) << 16) |
((0x0000FF00 & option->value.c) << 0) |
((0x00FF0000 & option->value.c) >> 16));
slen = snprintf(string + pos, size - pos, "%06"PRIx32"", rgbcolour);
slen = snprintf(string + pos, size - pos, "%06"PRIx32, rgbcolour);
break;
case OPTION_STRING: