From 9a3b644bf01f746d8e0c57706277ab0bd4ec8002 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 5 May 2019 14:55:08 +0100 Subject: Replace zd with PRIsizet to appease Windows Signed-off-by: Daniel Silverstone --- content/handlers/javascript/duktape/Window.bnd | 13 +++++++------ content/handlers/javascript/duktape/dukky.c | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/content/handlers/javascript/duktape/Window.bnd b/content/handlers/javascript/duktape/Window.bnd index c2f64280d..e19b33670 100644 --- a/content/handlers/javascript/duktape/Window.bnd +++ b/content/handlers/javascript/duktape/Window.bnd @@ -22,6 +22,7 @@ class Window { #include "desktop/gui_internal.h" #include "netsurf/misc.h" #include "utils/ring.h" +#include "netsurf/inttypes.h" #define WINDOW_CALLBACKS MAGIC(WindowCallbacks) #define HANDLER_MAGIC MAGIC(HANDLER_MAP) @@ -51,7 +52,7 @@ static void window_remove_callback_bits(duk_context *ctx, size_t handle) { } static void window_call_callback(duk_context *ctx, size_t handle) { - NSLOG(dukky, DEEPDEBUG, "ctx=%p, handle=%zd", ctx, handle); + NSLOG(dukky, DEEPDEBUG, "ctx=%p, handle=%"PRIsizet, ctx, handle); /* Stack is ... */ duk_push_context_dump(ctx); NSLOG(dukky, DEEPDEBUG, "On entry to callback, stack is: %s", duk_get_string(ctx, -1)); @@ -88,16 +89,16 @@ static void window_call_callback(duk_context *ctx, size_t handle) { static void window_schedule_callback(void *p) { window_schedule_t *priv = (window_schedule_t *)p; - NSLOG(dukky, DEEPDEBUG, "Entered window scheduler callback: %zd", priv->handle); + NSLOG(dukky, DEEPDEBUG, "Entered window scheduler callback: %"PRIsizet, priv->handle); window_call_callback(priv->ctx, priv->handle); if (priv->repeat_timeout > 0) { /* Reschedule */ - NSLOG(dukky, DEEPDEBUG, "Rescheduling repeating callback %zd", priv->handle); + NSLOG(dukky, DEEPDEBUG, "Rescheduling repeating callback %"PRIsizet, priv->handle); guit->misc->schedule(priv->repeat_timeout, window_schedule_callback, priv); } else { - NSLOG(dukky, DEEPDEBUG, "Removing completed callback %zd", priv->handle); + NSLOG(dukky, DEEPDEBUG, "Removing completed callback %"PRIsizet, priv->handle); /* Remove this from the ring */ RING_REMOVE(priv->owner->schedule_ring, priv); window_remove_callback_bits(priv->ctx, priv->handle); @@ -150,7 +151,7 @@ static size_t window_alloc_new_callback(duk_context *ctx, window_private_t *wind /* And we're back to func, timeout, ... */ guit->misc->schedule(timeout, window_schedule_callback, sched); - NSLOG(dukky, DEEPDEBUG, "Scheduled callback %zd for %d ms from now", new_handle, timeout); + NSLOG(dukky, DEEPDEBUG, "Scheduled callback %"PRIsizet" for %d ms from now", new_handle, timeout); return new_handle; } @@ -160,7 +161,7 @@ static void window_remove_callback_by_handle(duk_context *ctx, size_t handle) { RING_ITERATE_START(window_schedule_t, window->schedule_ring, sched) { if (sched->handle == handle) { - NSLOG(dukky, DEEPDEBUG, "Cancelled callback %zd", sched->handle); + NSLOG(dukky, DEEPDEBUG, "Cancelled callback %"PRIsizet, sched->handle); guit->misc->schedule(-1, window_schedule_callback, sched); RING_REMOVE(window->schedule_ring, sched); window_remove_callback_bits(ctx, sched->handle); diff --git a/content/handlers/javascript/duktape/dukky.c b/content/handlers/javascript/duktape/dukky.c index 68eca81d5..2755a272f 100644 --- a/content/handlers/javascript/duktape/dukky.c +++ b/content/handlers/javascript/duktape/dukky.c @@ -755,7 +755,7 @@ bool js_exec(jscontext *ctx, const char *txt, size_t txtlen, const char *name) assert(ctx); if (txt == NULL || txtlen == 0) return false; duk_set_top(CTX, 0); - NSLOG(dukky, DEEPDEBUG, "Running %zd bytes from %s", txtlen, name); + NSLOG(dukky, DEEPDEBUG, "Running %"PRIsizet" bytes from %s", txtlen, name); /* NSLOG(dukky, DEEPDEBUG, "\n%s\n", txt); */ (void) nsu_getmonotonic_ms(&ctx->exec_start_time); -- cgit v1.2.3