From 3db2f4dae12902e2df3c961ad6d93febfc7d73d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Mon, 20 Apr 2026 11:38:57 +0200 Subject: [PATCH] Use APR_INT64_T_FMT instead of %ld for printing --- native/advertise/mod_advertise.c | 4 ++-- native/mod_manager/mod_manager.c | 4 ++-- native/mod_proxy_cluster/mod_proxy_cluster.c | 14 +++++++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/native/advertise/mod_advertise.c b/native/advertise/mod_advertise.c index 60c32975..5c7aec30 100644 --- a/native/advertise/mod_advertise.c +++ b/native/advertise/mod_advertise.c @@ -691,8 +691,8 @@ static void advertise_info(request_rec *r) } if (mconf->ma_advertise_server != NULL) { ap_rprintf(r, " Advertising on Group %s Port %d ", mconf->ma_advertise_adrs, mconf->ma_advertise_port); - ap_rprintf(r, "for %s://%s:%d every %ld seconds
", mconf->ma_advertise_srvm, mconf->ma_advertise_srvs, - mconf->ma_advertise_srvp, apr_time_sec(mconf->ma_advertise_freq)); + ap_rprintf(r, "for %s://%s:%d every %" APR_INT64_T_FMT " seconds
", mconf->ma_advertise_srvm, + mconf->ma_advertise_srvs, mconf->ma_advertise_srvp, apr_time_sec(mconf->ma_advertise_freq)); } else { ap_rputs("
", r); } diff --git a/native/mod_manager/mod_manager.c b/native/mod_manager/mod_manager.c index 30273667..77e2eb11 100644 --- a/native/mod_manager/mod_manager.c +++ b/native/mod_manager/mod_manager.c @@ -2379,7 +2379,7 @@ static void print_status_response(request_rec *r, const char *jvmroute, int node ap_set_content_type(r, PLAINTEXT_CONTENT_TYPE); ap_rprintf(r, "Type=STATUS-RSP&JVMRoute=%.*s", JVMROUTESZ, jvmroute); ap_rprintf(r, node_up ? "&State=OK" : "&State=NOTOK"); - ap_rprintf(r, "&id=%ld", ap_scoreboard_image->global->restart_time); + ap_rprintf(r, "&id=%" APR_INT64_T_FMT, ap_scoreboard_image->global->restart_time); ap_rprintf(r, "\n"); } @@ -2477,7 +2477,7 @@ static void print_ping_response(request_rec *r, const char *jvmroute, int is_up) ap_rprintf(r, is_up ? "&State=OK" : "&State=NOTOK"); } - ap_rprintf(r, "&id=%ld", ap_scoreboard_image->global->restart_time); + ap_rprintf(r, "&id=%" APR_INT64_T_FMT, ap_scoreboard_image->global->restart_time); ap_rprintf(r, "\n"); } diff --git a/native/mod_proxy_cluster/mod_proxy_cluster.c b/native/mod_proxy_cluster/mod_proxy_cluster.c index 3439d827..c611efaa 100644 --- a/native/mod_proxy_cluster/mod_proxy_cluster.c +++ b/native/mod_proxy_cluster/mod_proxy_cluster.c @@ -2069,7 +2069,8 @@ static proxy_worker *searchworker(request_rec *r, const char *bal, const char *u if (worker->s->index != -1) { *id = worker->s->index; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, - "searchworker: %s worker->s->index: %d the_conf %ld", url, *id, (uintptr_t)conf); + "searchworker: %s worker->s->index: %d the_conf %" APR_INT64_T_FMT, url, *id, + (uintptr_t)conf); *the_conf = conf; return worker; /* Done current index */ } @@ -2077,14 +2078,16 @@ static proxy_worker *searchworker(request_rec *r, const char *bal, const char *u if (helper && helper->index != -1) { *id = helper->index; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, - "searchworker: %s helper->index %d the_conf %ld", url, *id, (uintptr_t)conf); + "searchworker: %s helper->index %d the_conf %" APR_INT64_T_FMT, url, *id, + (uintptr_t)conf); *the_conf = conf; return worker; /* Done previous index */ } if (helper && helper->shared) { *id = helper->shared->index; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, - "searchworker: %s helper->shared->index %d the_conf %ld", url, *id, (uintptr_t)conf); + "searchworker: %s helper->shared->index %d the_conf %" APR_INT64_T_FMT, url, *id, + (uintptr_t)conf); *the_conf = conf; return worker; /* our index was saved when we remove... */ } @@ -2119,7 +2122,8 @@ static proxy_worker *proxy_node_getid(request_rec *r, const char *balancername, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_node_getid: searchworker returns NULL"); return NULL; } - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_node_getid: the_conf %ld", (uintptr_t)*the_conf); + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_node_getid: the_conf %" APR_INT64_T_FMT, + (uintptr_t)*the_conf); return worker; } @@ -2553,7 +2557,7 @@ static int proxy_cluster_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t } if (SIZEOFSCORE <= sizeof(proxy_worker_shared)) { ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, - "SIZEOFSCORE too small for mod_proxy shared stat structure %d <= %ld", SIZEOFSCORE, + "SIZEOFSCORE too small for mod_proxy shared stat structure %d <= %" APR_INT64_T_FMT, SIZEOFSCORE, sizeof(proxy_worker_shared)); return HTTP_INTERNAL_SERVER_ERROR; }