From 9f4f61ddcb7add87580fe6b60794c4aaaeb6b3a7 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 3 Apr 2025 12:42:06 -0700 Subject: [PATCH] lib: add const to clientwriter tables Unlike the connection filter tables that hold a writable log level, the client writer tables can be const. --- lib/cw-out.c | 2 +- lib/cw-out.h | 2 +- lib/cw-pause.c | 2 +- lib/cw-pause.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cw-out.c b/lib/cw-out.c index 6eb7ecd69c..af8f1b9e5c 100644 --- a/lib/cw-out.c +++ b/lib/cw-out.c @@ -114,7 +114,7 @@ static void cw_out_close(struct Curl_easy *data, struct Curl_cwriter *writer); static CURLcode cw_out_init(struct Curl_easy *data, struct Curl_cwriter *writer); -struct Curl_cwtype Curl_cwt_out = { +const struct Curl_cwtype Curl_cwt_out = { "cw-out", NULL, cw_out_init, diff --git a/lib/cw-out.h b/lib/cw-out.h index ca4c2e435d..89b9985bb5 100644 --- a/lib/cw-out.h +++ b/lib/cw-out.h @@ -33,7 +33,7 @@ * the client callbacks. Intended to be the last installed in the * client writer stack of a transfer. */ -extern struct Curl_cwtype Curl_cwt_out; +extern const struct Curl_cwtype Curl_cwt_out; /** * Return TRUE iff 'cw-out' client write has paused data. diff --git a/lib/cw-pause.c b/lib/cw-pause.c index c001b24857..9b9554c551 100644 --- a/lib/cw-pause.c +++ b/lib/cw-pause.c @@ -87,7 +87,7 @@ static void cw_pause_close(struct Curl_easy *data, static CURLcode cw_pause_init(struct Curl_easy *data, struct Curl_cwriter *writer); -struct Curl_cwtype Curl_cwt_pause = { +const struct Curl_cwtype Curl_cwt_pause = { "cw-pause", NULL, cw_pause_init, diff --git a/lib/cw-pause.h b/lib/cw-pause.h index c2e70b58c3..2aa1a499cd 100644 --- a/lib/cw-pause.h +++ b/lib/cw-pause.h @@ -32,7 +32,7 @@ * The client writer type "cw-pause" that buffers writes for * paused transfer writes. */ -extern struct Curl_cwtype Curl_cwt_pause; +extern const struct Curl_cwtype Curl_cwt_pause; CURLcode Curl_cw_pause_flush(struct Curl_easy *data); -- 2.47.2