From: Viktor Szakats Date: Mon, 28 Jul 2025 09:10:34 +0000 (+0200) Subject: CURLOPT: bump `CURLHEADER_*` macros to `long`, drop casts X-Git-Tag: curl-8_16_0~347 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=113f6aacd4ae4eaa25fca91932013425fca3788d;p=thirdparty%2Fcurl.git CURLOPT: bump `CURLHEADER_*` macros to `long`, drop casts This patch bumps the size of these macros from `int` to `long`, while keeping their actual values the same. It may cause incompatibilities in user code, requiring the bump of holder variables and/or adding casts: - CURLHEADER_SEPARATE - CURLHEADER_UNIFIED Also: - keep existing cast within the documentation to make sure it applies to older curl versions as well. Closes #18055 --- diff --git a/include/curl/curl.h b/include/curl/curl.h index 0ff9a307a7..67f03503b7 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -1024,8 +1024,8 @@ typedef enum { } curl_ftpmethod; /* bitmask defines for CURLOPT_HEADEROPT */ -#define CURLHEADER_UNIFIED 0 -#define CURLHEADER_SEPARATE (1<<0) +#define CURLHEADER_UNIFIED 0L +#define CURLHEADER_SEPARATE (1L<<0) /* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */ #define CURLALTSVC_READONLYFILE (1L<<2) diff --git a/tests/libtest/lib1525.c b/tests/libtest/lib1525.c index 10639ea7ff..375d6aef51 100644 --- a/tests/libtest/lib1525.c +++ b/tests/libtest/lib1525.c @@ -74,7 +74,7 @@ static CURLcode test_lib1525(char *URL) test_setopt(curl, CURLOPT_PROXY, libtest_arg2); test_setopt(curl, CURLOPT_HTTPHEADER, hhl); test_setopt(curl, CURLOPT_PROXYHEADER, hhl); - test_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_UNIFIED); + test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED); test_setopt(curl, CURLOPT_POST, 0L); test_setopt(curl, CURLOPT_UPLOAD, 1L); test_setopt(curl, CURLOPT_VERBOSE, 1L); diff --git a/tests/libtest/lib1526.c b/tests/libtest/lib1526.c index ad3956fa74..c2e3685a15 100644 --- a/tests/libtest/lib1526.c +++ b/tests/libtest/lib1526.c @@ -78,7 +78,7 @@ static CURLcode test_lib1526(char *URL) test_setopt(curl, CURLOPT_PROXY, libtest_arg2); test_setopt(curl, CURLOPT_HTTPHEADER, hhl); test_setopt(curl, CURLOPT_PROXYHEADER, phl); - test_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_SEPARATE); + test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE); test_setopt(curl, CURLOPT_POST, 0L); test_setopt(curl, CURLOPT_UPLOAD, 1L); test_setopt(curl, CURLOPT_VERBOSE, 1L); diff --git a/tests/libtest/lib1527.c b/tests/libtest/lib1527.c index 2e7c341cc2..35e06b45ae 100644 --- a/tests/libtest/lib1527.c +++ b/tests/libtest/lib1527.c @@ -85,7 +85,7 @@ static CURLcode test_lib1527(char *URL) test_setopt(curl, CURLOPT_READFUNCTION, t1527_read_cb); test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(t1527_testdata)); - test_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_UNIFIED); + test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED); res = curl_easy_perform(curl); diff --git a/tests/libtest/lib1528.c b/tests/libtest/lib1528.c index 068c17c682..24293a0188 100644 --- a/tests/libtest/lib1528.c +++ b/tests/libtest/lib1528.c @@ -56,7 +56,7 @@ static CURLcode test_lib1528(char *URL) test_setopt(curl, CURLOPT_PROXY, libtest_arg2); test_setopt(curl, CURLOPT_HTTPHEADER, hhl); test_setopt(curl, CURLOPT_PROXYHEADER, phl); - test_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_SEPARATE); + test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE); test_setopt(curl, CURLOPT_VERBOSE, 1L); test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); test_setopt(curl, CURLOPT_HEADER, 1L);