Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/5035408503741db9920daf62aacb9506a85ea92e
...commit
http://git.netsurf-browser.org/netsurf.git/commit/5035408503741db9920daf62aacb9506a85ea92e
...tree
http://git.netsurf-browser.org/netsurf.git/tree/5035408503741db9920daf62aacb9506a85ea92e
The branch, master has been updated
via 5035408503741db9920daf62aacb9506a85ea92e (commit)
via 23102ff60157c85ff283f80e456bb124e74a4596 (commit)
via c987b043b1fb4c5a25594e822c16787906b09fc8 (commit)
via a16d5ff10b2225c7cf7b33ddfff1d947b0dbe40a (commit)
from 21e636a3a6056c23bbd4257f50315532fe010aa5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=5035408503741db9920daf62aacb9506a85ea92e
commit 5035408503741db9920daf62aacb9506a85ea92e
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
content: backing store: Remove unused typedef.
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index aff1534..a145c6f 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -89,14 +89,6 @@
#define BLOCK_USE_MAP_SIZE (1 << (BLOCK_ENTRY_COUNT - 3))
/**
- * The type used to store index values referring to store entries. Care
- * must be taken with this type as it is used to build address to
- * entry mapping so changing the size will have large impacts on
- * memory usage.
- */
-typedef uint16_t entry_index_t;
-
-/**
* The type used as a binary identifier for each entry derived from
* the URL. A larger identifier will have fewer collisions but
* requires proportionately more storage.
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=23102ff60157c85ff283f80e456bb124e74a4596
commit 23102ff60157c85ff283f80e456bb124e74a4596
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
test: Use YAML SafeLoader
diff --git a/test/monkey-see-monkey-do b/test/monkey-see-monkey-do
index 4317315..72b8685 100755
--- a/test/monkey-see-monkey-do
+++ b/test/monkey-see-monkey-do
@@ -117,7 +117,7 @@ def main():
index = index.read()
print("Parsing tests...")
- test_set = yaml.load_all(index, Loader=yaml.FullLoader)
+ test_set = yaml.load_all(index, Loader=yaml.SafeLoader)
print("Running tests...")
ret = 0
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=c987b043b1fb4c5a25594e822c16787906b09fc8
commit c987b043b1fb4c5a25594e822c16787906b09fc8
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Clean up print format specifier usage
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index fa9fffe..aff1534 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -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,
diff --git a/content/handlers/css/dump.c b/content/handlers/css/dump.c
index 799ee5e..950a6f8 100644
--- a/content/handlers/css/dump.c
+++ b/content/handlers/css/dump.c
@@ -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);
}
diff --git a/content/handlers/html/form.c b/content/handlers/html/form.c
index b1e911c..afa40ac 100644
--- a/content/handlers/html/form.c
+++ b/content/handlers/html/form.c
@@ -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;
diff --git a/content/hlcache.c b/content/hlcache.c
index 59ed17e..5cba88b 100644
--- a/content/hlcache.c
+++ b/content/hlcache.c
@@ -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));
diff --git a/content/llcache.c b/content/llcache.c
index 9d69c96..175c5c8 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -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 */
diff --git a/utils/nsoption.c b/utils/nsoption.c
index cd7791d..7306dee 100644
--- a/utils/nsoption.c
+++ b/utils/nsoption.c
@@ -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:
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=a16d5ff10b2225c7cf7b33ddfff1d947b0dbe40a
commit a16d5ff10b2225c7cf7b33ddfff1d947b0dbe40a
Author: DeltaVonNeumann <[email protected]>
Commit: Michael Drake <[email protected]>
Avoid integer types with platform dependent size
diff --git a/content/fetchers/file/dirlist.c b/content/fetchers/file/dirlist.c
index d49dc7f..345dbd8 100644
--- a/content/fetchers/file/dirlist.c
+++ b/content/fetchers/file/dirlist.c
@@ -29,6 +29,7 @@
#include "utils/messages.h"
#include "utils/nscolour.h"
+#include "netsurf/inttypes.h"
#include "netsurf/types.h"
#include "netsurf/plot_style.h"
@@ -158,7 +159,7 @@ bool dirlist_generate_title(const char *title, char
*buffer, int buffer_length)
"<title>%s</title>\n"
"<style>\n"
"html {\n"
- "\tbackground-color: #%06x;\n"
+ "\tbackground-color: #%06"PRIx32";\n"
"}\n"
"%s"
"</style>\n"
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index ede729f..fa9fffe 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -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 %d bytes from %p at
%"PRIsizet" block %d errno %d",
+ "Write failed %"PRIssizet" of %"PRId32" bytes from %p at
%"PRIsizet" block %d errno %d",
wr,
bse->elem[elem_idx].size,
bse->elem[elem_idx].data,
@@ -1661,7 +1661,7 @@ static nserror store_write_file(struct store_state *state,
close(fd);
if (wr != (ssize_t)bse->elem[elem_idx].size) {
NSLOG(netsurf, ERROR,
- "Write failed %"PRIssizet" of %d bytes from %p errno %d",
+ "Write failed %"PRIssizet" of %"PRId32" bytes from %p
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 %d bytes into %p from
%"PRIsizet" block %d errno %d",
+ "Failed reading %"PRIssizet" of %"PRId32" bytes into %p
from %"PRIsizet" block %d errno %d",
rd,
bse->elem[elem_idx].size,
bse->elem[elem_idx].data,
diff --git a/content/handlers/css/dump.c b/content/handlers/css/dump.c
index 4138f93..799ee5e 100644
--- a/content/handlers/css/dump.c
+++ b/content/handlers/css/dump.c
@@ -19,6 +19,8 @@
#include <stdio.h>
#include <libcss/libcss.h>
+#include "netsurf/inttypes.h"
+
#include "css/dump.h"
#include "css/utils.h"
@@ -36,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%d.%03d", f < 0 ? "-" : "", uintpart, fracpart);
+ fprintf(stream, "%s%"PRId32".%03ld", f < 0 ? "-" : "", uintpart,
fracpart);
}
/**
@@ -48,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, "%d", FIXTOINT(val));
+ fprintf(stream, "%"PRId32"", FIXTOINT(val));
else
dump_css_fixed(stream, val);
}
@@ -181,7 +183,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
val = css_computed_background_color(style, &color);
switch (val) {
case CSS_BACKGROUND_COLOR_COLOR:
- fprintf(stream, "background-color: #%08x ", color);
+ fprintf(stream, "background-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -255,7 +257,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
val = css_computed_border_top_color(style, &color);
switch (val) {
case CSS_BORDER_COLOR_COLOR:
- fprintf(stream, "border-top-color: #%08x ", color);
+ fprintf(stream, "border-top-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -265,7 +267,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
val = css_computed_border_right_color(style, &color);
switch (val) {
case CSS_BORDER_COLOR_COLOR:
- fprintf(stream, "border-right-color: #%08x ", color);
+ fprintf(stream, "border-right-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -275,7 +277,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
val = css_computed_border_bottom_color(style, &color);
switch (val) {
case CSS_BORDER_COLOR_COLOR:
- fprintf(stream, "border-bottom-color: #%08x ", color);
+ fprintf(stream, "border-bottom-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -285,7 +287,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
val = css_computed_border_left_color(style, &color);
switch (val) {
case CSS_BORDER_COLOR_COLOR:
- fprintf(stream, "border-left-color: #%08x ", color);
+ fprintf(stream, "border-left-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -610,7 +612,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
/* color */
val = css_computed_color(style, &color);
if (val == CSS_COLOR_COLOR) {
- fprintf(stream, "color: #%08x ", color);
+ fprintf(stream, "color: #%08"PRIx32" ", color);
}
/* content */
@@ -1353,7 +1355,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
fprintf(stream, "outline-color: invert ");
break;
case CSS_OUTLINE_COLOR_COLOR:
- fprintf(stream, "outline-color: #%08x ", color);
+ fprintf(stream, "outline-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -1820,7 +1822,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
fprintf(stream, "z-index: auto ");
break;
case CSS_Z_INDEX_SET:
- fprintf(stream, "z-index: %d ", zindex);
+ fprintf(stream, "z-index: %"PRId32" ", zindex);
break;
default:
break;
diff --git a/content/handlers/html/css.c b/content/handlers/html/css.c
index 2434b17..be17ac8 100644
--- a/content/handlers/html/css.c
+++ b/content/handlers/html/css.c
@@ -33,6 +33,7 @@
#include "utils/nsoption.h"
#include "utils/corestrings.h"
#include "utils/log.h"
+#include "netsurf/inttypes.h"
#include "netsurf/misc.h"
#include "netsurf/content.h"
#include "content/hlcache.h"
@@ -173,7 +174,7 @@ html_stylesheet_from_domnode(html_content *c,
dom_string_unref(style);
- snprintf(urlbuf, sizeof(urlbuf), "x-ns-css:%u", key);
+ snprintf(urlbuf, sizeof(urlbuf), "x-ns-css:%"PRIu32"", key);
error = nsurl_create(urlbuf, &url);
if (error != NSERROR_OK) {
diff --git a/content/handlers/html/form.c b/content/handlers/html/form.c
index 97ec195..b1e911c 100644
--- a/content/handlers/html/form.c
+++ b/content/handlers/html/form.c
@@ -41,6 +41,7 @@
#include "utils/utf8.h"
#include "utils/ascii.h"
#include "netsurf/browser_window.h"
+#include "netsurf/inttypes.h"
#include "netsurf/mouse.h"
#include "netsurf/plotters.h"
#include "netsurf/misc.h"
@@ -486,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 %d", option_index);
+ "Could not get options item %"PRId32"",
option_index);
res = NSERROR_DOM;
} else {
res = form_dom_to_data_select_option(
@@ -1100,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 %d failed with %d",
+ "retrieving form element %"PRId32" failed with
%d",
element_idx, exp);
res = NSERROR_DOM;
goto form_dom_to_data_error;
@@ -1110,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 %d failed with %d",
+ "getting element node name %"PRId32" failed with
%d",
element_idx, exp);
dom_node_unref(element);
res = NSERROR_DOM;
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 2b6b1a8..82f5f13 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -123,7 +123,7 @@ bool fire_generic_dom_event(dom_string *type, dom_node
*target,
return false;
}
NSLOG(netsurf, INFO, "Dispatching '%*s' against %p",
- dom_string_length(type), dom_string_data(type), target);
+ (int)dom_string_length(type), dom_string_data(type), target);
result = fire_dom_event(evt, target);
dom_event_unref(evt);
return result;
@@ -200,7 +200,7 @@ bool fire_dom_keyboard_event(dom_string *type, dom_node
*target,
}
NSLOG(netsurf, INFO, "Dispatching '%*s' against %p",
- dom_string_length(type), dom_string_data(type), target);
+ (int)dom_string_length(type), dom_string_data(type),
target);
result = fire_dom_event((dom_event *) evt, target);
dom_event_unref(evt);
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index d9de14b..827180c 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4194,7 +4194,7 @@ layout__get_ol_reversed(dom_node *ol_node)
*/
static bool
layout__get_list_item_count(
- dom_node *list_owner, int *count_out)
+ dom_node *list_owner, dom_long *count_out)
{
dom_html_element_type tag_type;
dom_exception exc;
@@ -4266,7 +4266,7 @@ layout__ordered_list_count(
dom_exception exc;
dom_node *child;
int step = 1;
- int next;
+ dom_long next;
if (box->node == NULL) {
return;
diff --git a/content/handlers/javascript/duktape/dukky.c
b/content/handlers/javascript/duktape/dukky.c
index 52a9c82..c0a2749 100644
--- a/content/handlers/javascript/duktape/dukky.c
+++ b/content/handlers/javascript/duktape/dukky.c
@@ -1156,7 +1156,7 @@ static void dukky_generic_event_handler(dom_event *evt,
void *pw)
NSLOG(dukky, DEBUG, "Unable to find the event name");
return;
}
- NSLOG(dukky, DEBUG, "Event's name is %*s", dom_string_length(name),
+ NSLOG(dukky, DEBUG, "Event's name is %*s", (int)dom_string_length(name),
dom_string_data(name));
exc = dom_event_get_event_phase(evt, &phase);
if (exc != DOM_NO_ERR) {
@@ -1394,10 +1394,10 @@ void dukky_register_event_listener_for(duk_context *ctx,
if (exc != DOM_NO_ERR) {
NSLOG(dukky, DEBUG,
"Unable to register listener for %p.%*s", ele,
- dom_string_length(name), dom_string_data(name));
+ (int)dom_string_length(name), dom_string_data(name));
} else {
NSLOG(dukky, DEBUG, "have registered listener for %p.%*s",
- ele, dom_string_length(name), dom_string_data(name));
+ ele, (int)dom_string_length(name), dom_string_data(name));
}
dom_event_listener_unref(listen);
}
diff --git a/content/hlcache.c b/content/hlcache.c
index d860015..59ed17e 100644
--- a/content/hlcache.c
+++ b/content/hlcache.c
@@ -30,6 +30,7 @@
#include "utils/messages.h"
#include "utils/ring.h"
#include "utils/utils.h"
+#include "netsurf/inttypes.h"
#include "netsurf/misc.h"
#include "netsurf/content.h"
#include "desktop/gui_internal.h"
@@ -592,7 +593,7 @@ void hlcache_finalise(void)
num_contents++;
}
- NSLOG(netsurf, INFO, "%d contents remain before cache drain",
+ NSLOG(netsurf, INFO, "%"PRId32" contents remain before cache drain",
num_contents);
/* Drain cache */
@@ -607,7 +608,7 @@ void hlcache_finalise(void)
}
} while (num_contents > 0 && num_contents != prev_contents);
- NSLOG(netsurf, INFO, "%d contents remaining after being polite",
num_contents);
+ NSLOG(netsurf, INFO, "%"PRId32" contents remaining after being polite",
num_contents);
/* Drain cache again, forcing the matter */
do {
@@ -621,12 +622,12 @@ void hlcache_finalise(void)
}
} while (num_contents > 0 && num_contents != prev_contents);
- NSLOG(netsurf, INFO, "%d contents remaining:", num_contents);
+ NSLOG(netsurf, INFO, "%"PRId32" 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 (%d users)",
+ NSLOG(netsurf, INFO, " %p : %s (%"PRId32" users)",
entry,
nsurl_access(hlcache_handle_get_url(&entry_handle)),
content_count_users(entry->content));
diff --git a/content/llcache.c b/content/llcache.c
index f86ae0d..9d69c96 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -1923,7 +1923,7 @@ llcache_object_retrieve_from_cache(nsurl *url,
llcache_object *obj, *newest = NULL;
NSLOG(llcache, DEBUG,
- "Searching cache for %s flags:%x referer:%s post:%p",
+ "Searching cache for %s flags:%"PRIx32" referer:%s post:%p",
nsurl_access(url), flags,
referer==NULL?"":nsurl_access(referer),
post);
@@ -2100,7 +2100,7 @@ llcache_object_retrieve(nsurl *url,
nsurl *defragmented_url;
bool uncachable = false;
- NSLOG(llcache, DEBUG, "Retrieve %s (%x, %s, %p)", nsurl_access(url),
flags,
+ NSLOG(llcache, DEBUG, "Retrieve %s (%"PRIx32", %s, %p)",
nsurl_access(url), flags,
referer==NULL?"":nsurl_access(referer), post);
@@ -3876,7 +3876,7 @@ void llcache_clean(bool purge)
}
}
- NSLOG(llcache, DEBUG, "Size: %u (limit: %u)", llcache_size, limit);
+ NSLOG(llcache, DEBUG, "Size: %"PRIu32" (limit: %"PRIu32")",
llcache_size, limit);
}
/* Exported interface documented in content/llcache.h */
@@ -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 %d bytes",
+ "llcache initialising with a limit of %"PRId32" bytes",
llcache->limit);
/* backing store initialisation */
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index fd838b8..bd78589 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -99,7 +99,7 @@
static void netsurf_lwc_iterator(lwc_string *str, void *pw)
{
- NSLOG(netsurf, WARNING, "[%3u] %.*s", str->refcnt,
+ NSLOG(netsurf, WARNING, "[%3"PRIu32"] %.*s", str->refcnt,
(int)lwc_string_length(str), lwc_string_data(str));
}
diff --git a/test/monkey-see-monkey-do b/test/monkey-see-monkey-do
index 4dc761a..4317315 100755
--- a/test/monkey-see-monkey-do
+++ b/test/monkey-see-monkey-do
@@ -117,7 +117,7 @@ def main():
index = index.read()
print("Parsing tests...")
- test_set = yaml.load_all(index)
+ test_set = yaml.load_all(index, Loader=yaml.FullLoader)
print("Running tests...")
ret = 0
diff --git a/utils/idna.c b/utils/idna.c
index 628ef1f..3ce3e1b 100644
--- a/utils/idna.c
+++ b/utils/idna.c
@@ -440,7 +440,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
/* 4. Check characters not DISALLOWED by RFC5892 */
if (idna_prop == IDNA_P_DISALLOWED) {
NSLOG(netsurf, INFO,
- "Check failed: character %"PRIsizet" (%x) is
DISALLOWED",
+ "Check failed: character %"PRIsizet" (%"PRIx32")
is DISALLOWED",
i,
label[i]);
return false;
@@ -450,7 +450,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
if (idna_prop == IDNA_P_CONTEXTJ) {
if (idna__contextj_rule(label, i, len) == false) {
NSLOG(netsurf, INFO,
- "Check failed: character %"PRIsizet" (%x)
does not conform to CONTEXTJ rule",
+ "Check failed: character %"PRIsizet"
(%"PRIx32") does not conform to CONTEXTJ rule",
i,
label[i]);
return false;
@@ -462,7 +462,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
if (idna_prop == IDNA_P_CONTEXTO) {
if (idna__contexto_rule(label[i]) == false) {
NSLOG(netsurf, INFO,
- "Check failed: character %"PRIsizet" (%x)
has no CONTEXTO rule defined",
+ "Check failed: character %"PRIsizet"
(%"PRIx32") has no CONTEXTO rule defined",
i,
label[i]);
return false;
@@ -472,7 +472,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
/* 7. Check characters are not UNASSIGNED */
if (idna_prop == IDNA_P_UNASSIGNED) {
NSLOG(netsurf, INFO,
- "Check failed: character %"PRIsizet" (%x) is
UNASSIGNED",
+ "Check failed: character %"PRIsizet" (%"PRIx32")
is UNASSIGNED",
i,
label[i]);
return false;
diff --git a/utils/nscolour.c b/utils/nscolour.c
index a071752..5a772b8 100644
--- a/utils/nscolour.c
+++ b/utils/nscolour.c
@@ -28,6 +28,7 @@
#include <stddef.h>
#include <stdbool.h>
+#include "netsurf/inttypes.h"
#include "netsurf/plot_style.h"
#include "utils/errors.h"
@@ -211,49 +212,49 @@ nserror nscolour_get_stylesheet(const char
**stylesheet_out)
ret = snprintf(buffer, sizeof(buffer),
".ns-odd-bg {\n"
- "\tbackground-color: #%06x;\n"
+ "\tbackground-color: #%06"PRIx32";\n"
"}\n"
".ns-odd-bg-hover {\n"
- "\tbackground-color: #%06x;\n"
+ "\tbackground-color: #%06"PRIx32";\n"
"}\n"
".ns-odd-fg {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-odd-fg-subtle {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-odd-fg-faded {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-odd-fg-good {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-odd-fg-bad {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-even-bg {\n"
- "\tbackground-color: #%06x;\n"
+ "\tbackground-color: #%06"PRIx32";\n"
"}\n"
".ns-even-bg-hover {\n"
- "\tbackground-color: #%06x;\n"
+ "\tbackground-color: #%06"PRIx32";\n"
"}\n"
".ns-even-fg {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-even-fg-subtle {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-even-fg-faded {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-even-fg-good {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-even-fg-bad {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-border {\n"
- "\tborder-color: #%06x;\n"
+ "\tborder-color: #%06"PRIx32";\n"
"}\n",
colour_rb_swap(nscolours[NSCOLOUR_WIN_ODD_BG]),
colour_rb_swap(nscolours[NSCOLOUR_WIN_ODD_BG_HOVER]),
diff --git a/utils/nsoption.c b/utils/nsoption.c
index a8a29b3..cd7791d 100644
--- a/utils/nsoption.c
+++ b/utils/nsoption.c
@@ -32,6 +32,7 @@
#include <string.h>
#include <strings.h>
+#include "netsurf/inttypes.h"
#include "netsurf/plot_style.h"
#include "utils/errors.h"
#include "utils/log.h"
@@ -112,7 +113,7 @@ strtooption(const char *value, struct nsoption_s *option)
break;
case OPTION_COLOUR:
- if (sscanf(value, "%x", &rgbcolour) == 1) {
+ if (sscanf(value, "%"SCNx32"", &rgbcolour) == 1) {
option->value.c = (((0x000000FF & rgbcolour) << 16) |
((0x0000FF00 & rgbcolour) << 0) |
((0x00FF0000 & rgbcolour) >> 16));
@@ -323,7 +324,7 @@ nsoption_output(FILE *fp,
rgbcolour = (((0x000000FF & opts[entry].value.c) << 16)
|
((0x0000FF00 & opts[entry].value.c) << 0) |
((0x00FF0000 & opts[entry].value.c) >>
16));
- fprintf(fp, "%s:%06x\n",
+ fprintf(fp, "%s:%06"PRIx32"\n",
opts[entry].key,
rgbcolour);
@@ -387,9 +388,9 @@ nsoption_output_value_html(struct nsoption_s *option,
slen = snprintf(string + pos,
size - pos,
"<span style=\"font-family:Monospace;\">"
- "#%06X"
+ "#%06"PRIX32
"</span> "
- "<span style=\"background-color: #%06x; "
+ "<span style=\"background-color: #%06"PRIx32"; "
"border: 1px solid #%06x; "
"display: inline-block; "
"width: 1em; height: 1em;\">"
@@ -459,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, "%06x", rgbcolour);
+ slen = snprintf(string + pos, size - pos, "%06"PRIx32"",
rgbcolour);
break;
case OPTION_STRING:
diff --git a/utils/utf8.c b/utils/utf8.c
index 7091ad4..3eedd08 100644
--- a/utils/utf8.c
+++ b/utils/utf8.c
@@ -32,6 +32,7 @@
#include "utils/log.h"
#include "utils/utf8.h"
+#include "netsurf/inttypes.h"
#include "netsurf/utf8.h"
#include "desktop/gui_internal.h"
@@ -346,7 +347,7 @@ utf8_convert_html_chunk(iconv_t cd,
return NSERROR_NOMEM;
ucs4 = utf8_to_ucs4(chunk, inlen);
- esclen = snprintf(escape, sizeof(escape), "&#x%06x;", ucs4);
+ esclen = snprintf(escape, sizeof(escape), "&#x%06"PRIx32";",
ucs4);
pescape = escape;
ret = iconv(cd, (void *) &pescape, &esclen,
(void *) out, outlen);
-----------------------------------------------------------------------
Summary of changes:
content/fetchers/file/dirlist.c | 3 ++-
content/fs_backing_store.c | 14 +++---------
content/handlers/css/dump.c | 22 ++++++++++---------
content/handlers/html/css.c | 3 ++-
content/handlers/html/form.c | 7 +++---
content/handlers/html/html.c | 4 ++--
content/handlers/html/layout.c | 4 ++--
content/handlers/javascript/duktape/dukky.c | 6 +++---
content/hlcache.c | 10 +++++----
content/llcache.c | 8 +++----
desktop/netsurf.c | 2 +-
test/monkey-see-monkey-do | 2 +-
utils/idna.c | 8 +++----
utils/nscolour.c | 31 ++++++++++++++-------------
utils/nsoption.c | 13 +++++------
utils/utf8.c | 3 ++-
16 files changed, 71 insertions(+), 69 deletions(-)
diff --git a/content/fetchers/file/dirlist.c b/content/fetchers/file/dirlist.c
index d49dc7f..345dbd8 100644
--- a/content/fetchers/file/dirlist.c
+++ b/content/fetchers/file/dirlist.c
@@ -29,6 +29,7 @@
#include "utils/messages.h"
#include "utils/nscolour.h"
+#include "netsurf/inttypes.h"
#include "netsurf/types.h"
#include "netsurf/plot_style.h"
@@ -158,7 +159,7 @@ bool dirlist_generate_title(const char *title, char
*buffer, int buffer_length)
"<title>%s</title>\n"
"<style>\n"
"html {\n"
- "\tbackground-color: #%06x;\n"
+ "\tbackground-color: #%06"PRIx32";\n"
"}\n"
"%s"
"</style>\n"
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index ede729f..a145c6f 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -89,14 +89,6 @@
#define BLOCK_USE_MAP_SIZE (1 << (BLOCK_ENTRY_COUNT - 3))
/**
- * The type used to store index values referring to store entries. Care
- * must be taken with this type as it is used to build address to
- * entry mapping so changing the size will have large impacts on
- * memory usage.
- */
-typedef uint16_t entry_index_t;
-
-/**
* The type used as a binary identifier for each entry derived from
* the URL. A larger identifier will have fewer collisions but
* requires proportionately more storage.
@@ -1614,7 +1606,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 %d 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,
@@ -1661,7 +1653,7 @@ static nserror store_write_file(struct store_state *state,
close(fd);
if (wr != (ssize_t)bse->elem[elem_idx].size) {
NSLOG(netsurf, ERROR,
- "Write failed %"PRIssizet" of %d bytes from %p errno %d",
+ "Write failed %"PRIssizet" of %"PRId32" bytes from %p
errno %d",
wr,
bse->elem[elem_idx].size,
bse->elem[elem_idx].data,
@@ -1784,7 +1776,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 %d 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,
diff --git a/content/handlers/css/dump.c b/content/handlers/css/dump.c
index 4138f93..950a6f8 100644
--- a/content/handlers/css/dump.c
+++ b/content/handlers/css/dump.c
@@ -19,6 +19,8 @@
#include <stdio.h>
#include <libcss/libcss.h>
+#include "netsurf/inttypes.h"
+
#include "css/dump.h"
#include "css/utils.h"
@@ -36,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%d.%03d", f < 0 ? "-" : "", uintpart, fracpart);
+ fprintf(stream, "%s%"PRIu32".%03"PRIu32, f < 0 ? "-" : "", uintpart,
fracpart);
}
/**
@@ -48,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, "%d", FIXTOINT(val));
+ fprintf(stream, "%"PRId32, FIXTOINT(val));
else
dump_css_fixed(stream, val);
}
@@ -181,7 +183,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
val = css_computed_background_color(style, &color);
switch (val) {
case CSS_BACKGROUND_COLOR_COLOR:
- fprintf(stream, "background-color: #%08x ", color);
+ fprintf(stream, "background-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -255,7 +257,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
val = css_computed_border_top_color(style, &color);
switch (val) {
case CSS_BORDER_COLOR_COLOR:
- fprintf(stream, "border-top-color: #%08x ", color);
+ fprintf(stream, "border-top-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -265,7 +267,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
val = css_computed_border_right_color(style, &color);
switch (val) {
case CSS_BORDER_COLOR_COLOR:
- fprintf(stream, "border-right-color: #%08x ", color);
+ fprintf(stream, "border-right-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -275,7 +277,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
val = css_computed_border_bottom_color(style, &color);
switch (val) {
case CSS_BORDER_COLOR_COLOR:
- fprintf(stream, "border-bottom-color: #%08x ", color);
+ fprintf(stream, "border-bottom-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -285,7 +287,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
val = css_computed_border_left_color(style, &color);
switch (val) {
case CSS_BORDER_COLOR_COLOR:
- fprintf(stream, "border-left-color: #%08x ", color);
+ fprintf(stream, "border-left-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -610,7 +612,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
/* color */
val = css_computed_color(style, &color);
if (val == CSS_COLOR_COLOR) {
- fprintf(stream, "color: #%08x ", color);
+ fprintf(stream, "color: #%08"PRIx32" ", color);
}
/* content */
@@ -1353,7 +1355,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
fprintf(stream, "outline-color: invert ");
break;
case CSS_OUTLINE_COLOR_COLOR:
- fprintf(stream, "outline-color: #%08x ", color);
+ fprintf(stream, "outline-color: #%08"PRIx32" ", color);
break;
default:
break;
@@ -1820,7 +1822,7 @@ void nscss_dump_computed_style(FILE *stream, const
css_computed_style *style)
fprintf(stream, "z-index: auto ");
break;
case CSS_Z_INDEX_SET:
- fprintf(stream, "z-index: %d ", zindex);
+ fprintf(stream, "z-index: %"PRId32" ", zindex);
break;
default:
break;
diff --git a/content/handlers/html/css.c b/content/handlers/html/css.c
index 2434b17..be17ac8 100644
--- a/content/handlers/html/css.c
+++ b/content/handlers/html/css.c
@@ -33,6 +33,7 @@
#include "utils/nsoption.h"
#include "utils/corestrings.h"
#include "utils/log.h"
+#include "netsurf/inttypes.h"
#include "netsurf/misc.h"
#include "netsurf/content.h"
#include "content/hlcache.h"
@@ -173,7 +174,7 @@ html_stylesheet_from_domnode(html_content *c,
dom_string_unref(style);
- snprintf(urlbuf, sizeof(urlbuf), "x-ns-css:%u", key);
+ snprintf(urlbuf, sizeof(urlbuf), "x-ns-css:%"PRIu32"", key);
error = nsurl_create(urlbuf, &url);
if (error != NSERROR_OK) {
diff --git a/content/handlers/html/form.c b/content/handlers/html/form.c
index 97ec195..afa40ac 100644
--- a/content/handlers/html/form.c
+++ b/content/handlers/html/form.c
@@ -41,6 +41,7 @@
#include "utils/utf8.h"
#include "utils/ascii.h"
#include "netsurf/browser_window.h"
+#include "netsurf/inttypes.h"
#include "netsurf/mouse.h"
#include "netsurf/plotters.h"
#include "netsurf/misc.h"
@@ -486,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 %d", option_index);
+ "Could not get options item %"PRId32,
option_index);
res = NSERROR_DOM;
} else {
res = form_dom_to_data_select_option(
@@ -1100,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 %d failed with %d",
+ "retrieving form element %"PRIu32" failed with
%d",
element_idx, exp);
res = NSERROR_DOM;
goto form_dom_to_data_error;
@@ -1110,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 %d failed with %d",
+ "getting element node name %"PRIu32" failed with
%d",
element_idx, exp);
dom_node_unref(element);
res = NSERROR_DOM;
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 2b6b1a8..82f5f13 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -123,7 +123,7 @@ bool fire_generic_dom_event(dom_string *type, dom_node
*target,
return false;
}
NSLOG(netsurf, INFO, "Dispatching '%*s' against %p",
- dom_string_length(type), dom_string_data(type), target);
+ (int)dom_string_length(type), dom_string_data(type), target);
result = fire_dom_event(evt, target);
dom_event_unref(evt);
return result;
@@ -200,7 +200,7 @@ bool fire_dom_keyboard_event(dom_string *type, dom_node
*target,
}
NSLOG(netsurf, INFO, "Dispatching '%*s' against %p",
- dom_string_length(type), dom_string_data(type), target);
+ (int)dom_string_length(type), dom_string_data(type),
target);
result = fire_dom_event((dom_event *) evt, target);
dom_event_unref(evt);
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index d9de14b..827180c 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -4194,7 +4194,7 @@ layout__get_ol_reversed(dom_node *ol_node)
*/
static bool
layout__get_list_item_count(
- dom_node *list_owner, int *count_out)
+ dom_node *list_owner, dom_long *count_out)
{
dom_html_element_type tag_type;
dom_exception exc;
@@ -4266,7 +4266,7 @@ layout__ordered_list_count(
dom_exception exc;
dom_node *child;
int step = 1;
- int next;
+ dom_long next;
if (box->node == NULL) {
return;
diff --git a/content/handlers/javascript/duktape/dukky.c
b/content/handlers/javascript/duktape/dukky.c
index 52a9c82..c0a2749 100644
--- a/content/handlers/javascript/duktape/dukky.c
+++ b/content/handlers/javascript/duktape/dukky.c
@@ -1156,7 +1156,7 @@ static void dukky_generic_event_handler(dom_event *evt,
void *pw)
NSLOG(dukky, DEBUG, "Unable to find the event name");
return;
}
- NSLOG(dukky, DEBUG, "Event's name is %*s", dom_string_length(name),
+ NSLOG(dukky, DEBUG, "Event's name is %*s", (int)dom_string_length(name),
dom_string_data(name));
exc = dom_event_get_event_phase(evt, &phase);
if (exc != DOM_NO_ERR) {
@@ -1394,10 +1394,10 @@ void dukky_register_event_listener_for(duk_context *ctx,
if (exc != DOM_NO_ERR) {
NSLOG(dukky, DEBUG,
"Unable to register listener for %p.%*s", ele,
- dom_string_length(name), dom_string_data(name));
+ (int)dom_string_length(name), dom_string_data(name));
} else {
NSLOG(dukky, DEBUG, "have registered listener for %p.%*s",
- ele, dom_string_length(name), dom_string_data(name));
+ ele, (int)dom_string_length(name), dom_string_data(name));
}
dom_event_listener_unref(listen);
}
diff --git a/content/hlcache.c b/content/hlcache.c
index d860015..5cba88b 100644
--- a/content/hlcache.c
+++ b/content/hlcache.c
@@ -30,6 +30,7 @@
#include "utils/messages.h"
#include "utils/ring.h"
#include "utils/utils.h"
+#include "netsurf/inttypes.h"
#include "netsurf/misc.h"
#include "netsurf/content.h"
#include "desktop/gui_internal.h"
@@ -592,7 +593,7 @@ void hlcache_finalise(void)
num_contents++;
}
- NSLOG(netsurf, INFO, "%d contents remain before cache drain",
+ NSLOG(netsurf, INFO, "%"PRIu32" contents remain before cache drain",
num_contents);
/* Drain cache */
@@ -607,7 +608,8 @@ void hlcache_finalise(void)
}
} while (num_contents > 0 && num_contents != prev_contents);
- NSLOG(netsurf, INFO, "%d 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 {
@@ -621,12 +623,12 @@ void hlcache_finalise(void)
}
} while (num_contents > 0 && num_contents != prev_contents);
- NSLOG(netsurf, INFO, "%d 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 (%d users)",
+ NSLOG(netsurf, INFO, " %p : %s (%"PRIu32" users)",
entry,
nsurl_access(hlcache_handle_get_url(&entry_handle)),
content_count_users(entry->content));
diff --git a/content/llcache.c b/content/llcache.c
index f86ae0d..175c5c8 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -1923,7 +1923,7 @@ llcache_object_retrieve_from_cache(nsurl *url,
llcache_object *obj, *newest = NULL;
NSLOG(llcache, DEBUG,
- "Searching cache for %s flags:%x referer:%s post:%p",
+ "Searching cache for %s flags:%"PRIx32" referer:%s post:%p",
nsurl_access(url), flags,
referer==NULL?"":nsurl_access(referer),
post);
@@ -2100,7 +2100,7 @@ llcache_object_retrieve(nsurl *url,
nsurl *defragmented_url;
bool uncachable = false;
- NSLOG(llcache, DEBUG, "Retrieve %s (%x, %s, %p)", nsurl_access(url),
flags,
+ NSLOG(llcache, DEBUG, "Retrieve %s (%"PRIx32", %s, %p)",
nsurl_access(url), flags,
referer==NULL?"":nsurl_access(referer), post);
@@ -3876,7 +3876,7 @@ void llcache_clean(bool purge)
}
}
- NSLOG(llcache, DEBUG, "Size: %u (limit: %u)", llcache_size, limit);
+ NSLOG(llcache, DEBUG, "Size: %"PRIu32" (limit: %"PRIu32")",
llcache_size, limit);
}
/* Exported interface documented in content/llcache.h */
@@ -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 %d bytes",
+ "llcache initialising with a limit of %"PRIu32" bytes",
llcache->limit);
/* backing store initialisation */
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index fd838b8..bd78589 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -99,7 +99,7 @@
static void netsurf_lwc_iterator(lwc_string *str, void *pw)
{
- NSLOG(netsurf, WARNING, "[%3u] %.*s", str->refcnt,
+ NSLOG(netsurf, WARNING, "[%3"PRIu32"] %.*s", str->refcnt,
(int)lwc_string_length(str), lwc_string_data(str));
}
diff --git a/test/monkey-see-monkey-do b/test/monkey-see-monkey-do
index 4dc761a..72b8685 100755
--- a/test/monkey-see-monkey-do
+++ b/test/monkey-see-monkey-do
@@ -117,7 +117,7 @@ def main():
index = index.read()
print("Parsing tests...")
- test_set = yaml.load_all(index)
+ test_set = yaml.load_all(index, Loader=yaml.SafeLoader)
print("Running tests...")
ret = 0
diff --git a/utils/idna.c b/utils/idna.c
index 628ef1f..3ce3e1b 100644
--- a/utils/idna.c
+++ b/utils/idna.c
@@ -440,7 +440,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
/* 4. Check characters not DISALLOWED by RFC5892 */
if (idna_prop == IDNA_P_DISALLOWED) {
NSLOG(netsurf, INFO,
- "Check failed: character %"PRIsizet" (%x) is
DISALLOWED",
+ "Check failed: character %"PRIsizet" (%"PRIx32")
is DISALLOWED",
i,
label[i]);
return false;
@@ -450,7 +450,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
if (idna_prop == IDNA_P_CONTEXTJ) {
if (idna__contextj_rule(label, i, len) == false) {
NSLOG(netsurf, INFO,
- "Check failed: character %"PRIsizet" (%x)
does not conform to CONTEXTJ rule",
+ "Check failed: character %"PRIsizet"
(%"PRIx32") does not conform to CONTEXTJ rule",
i,
label[i]);
return false;
@@ -462,7 +462,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
if (idna_prop == IDNA_P_CONTEXTO) {
if (idna__contexto_rule(label[i]) == false) {
NSLOG(netsurf, INFO,
- "Check failed: character %"PRIsizet" (%x)
has no CONTEXTO rule defined",
+ "Check failed: character %"PRIsizet"
(%"PRIx32") has no CONTEXTO rule defined",
i,
label[i]);
return false;
@@ -472,7 +472,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
/* 7. Check characters are not UNASSIGNED */
if (idna_prop == IDNA_P_UNASSIGNED) {
NSLOG(netsurf, INFO,
- "Check failed: character %"PRIsizet" (%x) is
UNASSIGNED",
+ "Check failed: character %"PRIsizet" (%"PRIx32")
is UNASSIGNED",
i,
label[i]);
return false;
diff --git a/utils/nscolour.c b/utils/nscolour.c
index a071752..5a772b8 100644
--- a/utils/nscolour.c
+++ b/utils/nscolour.c
@@ -28,6 +28,7 @@
#include <stddef.h>
#include <stdbool.h>
+#include "netsurf/inttypes.h"
#include "netsurf/plot_style.h"
#include "utils/errors.h"
@@ -211,49 +212,49 @@ nserror nscolour_get_stylesheet(const char
**stylesheet_out)
ret = snprintf(buffer, sizeof(buffer),
".ns-odd-bg {\n"
- "\tbackground-color: #%06x;\n"
+ "\tbackground-color: #%06"PRIx32";\n"
"}\n"
".ns-odd-bg-hover {\n"
- "\tbackground-color: #%06x;\n"
+ "\tbackground-color: #%06"PRIx32";\n"
"}\n"
".ns-odd-fg {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-odd-fg-subtle {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-odd-fg-faded {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-odd-fg-good {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-odd-fg-bad {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-even-bg {\n"
- "\tbackground-color: #%06x;\n"
+ "\tbackground-color: #%06"PRIx32";\n"
"}\n"
".ns-even-bg-hover {\n"
- "\tbackground-color: #%06x;\n"
+ "\tbackground-color: #%06"PRIx32";\n"
"}\n"
".ns-even-fg {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-even-fg-subtle {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-even-fg-faded {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-even-fg-good {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-even-fg-bad {\n"
- "\tcolor: #%06x;\n"
+ "\tcolor: #%06"PRIx32";\n"
"}\n"
".ns-border {\n"
- "\tborder-color: #%06x;\n"
+ "\tborder-color: #%06"PRIx32";\n"
"}\n",
colour_rb_swap(nscolours[NSCOLOUR_WIN_ODD_BG]),
colour_rb_swap(nscolours[NSCOLOUR_WIN_ODD_BG_HOVER]),
diff --git a/utils/nsoption.c b/utils/nsoption.c
index a8a29b3..7306dee 100644
--- a/utils/nsoption.c
+++ b/utils/nsoption.c
@@ -32,6 +32,7 @@
#include <string.h>
#include <strings.h>
+#include "netsurf/inttypes.h"
#include "netsurf/plot_style.h"
#include "utils/errors.h"
#include "utils/log.h"
@@ -112,7 +113,7 @@ strtooption(const char *value, struct nsoption_s *option)
break;
case OPTION_COLOUR:
- if (sscanf(value, "%x", &rgbcolour) == 1) {
+ if (sscanf(value, "%"SCNx32"", &rgbcolour) == 1) {
option->value.c = (((0x000000FF & rgbcolour) << 16) |
((0x0000FF00 & rgbcolour) << 0) |
((0x00FF0000 & rgbcolour) >> 16));
@@ -323,7 +324,7 @@ nsoption_output(FILE *fp,
rgbcolour = (((0x000000FF & opts[entry].value.c) << 16)
|
((0x0000FF00 & opts[entry].value.c) << 0) |
((0x00FF0000 & opts[entry].value.c) >>
16));
- fprintf(fp, "%s:%06x\n",
+ fprintf(fp, "%s:%06"PRIx32"\n",
opts[entry].key,
rgbcolour);
@@ -387,10 +388,10 @@ nsoption_output_value_html(struct nsoption_s *option,
slen = snprintf(string + pos,
size - pos,
"<span style=\"font-family:Monospace;\">"
- "#%06X"
+ "#%06"PRIX32
"</span> "
- "<span style=\"background-color: #%06x; "
- "border: 1px solid #%06x; "
+ "<span style=\"background-color: #%06"PRIx32"; "
+ "border: 1px solid #%06"PRIx32"; "
"display: inline-block; "
"width: 1em; height: 1em;\">"
"</span>",
@@ -459,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, "%06x", rgbcolour);
+ slen = snprintf(string + pos, size - pos, "%06"PRIx32,
rgbcolour);
break;
case OPTION_STRING:
diff --git a/utils/utf8.c b/utils/utf8.c
index 7091ad4..3eedd08 100644
--- a/utils/utf8.c
+++ b/utils/utf8.c
@@ -32,6 +32,7 @@
#include "utils/log.h"
#include "utils/utf8.h"
+#include "netsurf/inttypes.h"
#include "netsurf/utf8.h"
#include "desktop/gui_internal.h"
@@ -346,7 +347,7 @@ utf8_convert_html_chunk(iconv_t cd,
return NSERROR_NOMEM;
ucs4 = utf8_to_ucs4(chunk, inlen);
- esclen = snprintf(escape, sizeof(escape), "&#x%06x;", ucs4);
+ esclen = snprintf(escape, sizeof(escape), "&#x%06"PRIx32";",
ucs4);
pescape = escape;
ret = iconv(cd, (void *) &pescape, &esclen,
(void *) out, outlen);
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]