From 5debe7cb34bb6f0ee094515c17b7662e386829fb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 1 Jul 2025 11:31:01 +0200 Subject: [PATCH] CURLOPT: drop redundant `long` casts Also: - CURLOPT_HSTS_CTRL.md: sync macro definitions with `curl/curl.h`. Perhaps it'd be better to delete copies like this? - keep existing casts within the documentation to make sure it applies to older curl versions as well. - CURLOPT_IPRESOLVE.md: re-add a long cast to man page, for consistency with the above. Closes #17791 --- docs/examples/anyauthput.c | 2 +- docs/examples/ghiper.c | 4 ++-- docs/examples/hsts-preload.c | 2 +- docs/examples/http3.c | 3 +-- docs/examples/imap-tls.c | 2 +- docs/examples/pop3-tls.c | 2 +- docs/examples/smtp-tls.c | 2 +- docs/libcurl/opts/CURLOPT_HSTS_CTRL.md | 4 ++-- docs/libcurl/opts/CURLOPT_HTTP_VERSION.md | 3 +-- docs/libcurl/opts/CURLOPT_IPRESOLVE.md | 2 +- src/config2setopts.c | 2 +- tests/client/hx_download.c | 2 +- tests/client/hx_upload.c | 2 +- tests/libtest/lib1511.c | 2 +- tests/libtest/lib1513.c | 6 +++--- tests/libtest/lib1555.c | 6 +++--- tests/libtest/lib1568.c | 2 +- tests/libtest/lib1593.c | 2 +- tests/libtest/lib1599.c | 2 +- tests/libtest/lib1662.c | 3 +-- tests/libtest/lib2309.c | 2 +- tests/libtest/lib2502.c | 2 +- tests/libtest/lib510.c | 2 +- tests/libtest/lib540.c | 2 +- tests/libtest/lib547.c | 2 +- tests/libtest/lib552.c | 2 +- tests/libtest/lib555.c | 2 +- tests/libtest/lib579.c | 2 +- tests/libtest/lib583.c | 2 +- tests/libtest/lib590.c | 11 ++++++----- tests/libtest/lib678.c | 3 +-- tests/libtest/lib694.c | 2 +- 32 files changed, 43 insertions(+), 46 deletions(-) diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index 7106c32eb6..c62250dce3 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -142,7 +142,7 @@ int main(int argc, char **argv) /* tell libcurl we can use "any" auth, which lets the lib pick one, but it also costs one extra round-trip and possibly sending of all the PUT data twice!!! */ - curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY); + curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); /* set user name and password for the authentication */ curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password"); diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c index 7bc6bef0da..7d8449cdf0 100644 --- a/docs/examples/ghiper.c +++ b/docs/examples/ghiper.c @@ -66,7 +66,7 @@ #include #define MSG_OUT g_print /* Change to "g_error" to write to stderr */ -#define SHOW_VERBOSE 0 /* Set to non-zero for libcurl messages */ +#define SHOW_VERBOSE 0L /* Set to non-zero for libcurl messages */ #define SHOW_PROGRESS 0 /* Set to non-zero to enable progress callback */ /* Global information, common to all connections */ @@ -311,7 +311,7 @@ static void new_conn(const char *url, struct GlobalInfo *g) curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url); curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn); - curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, (long)SHOW_VERBOSE); + curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, SHOW_VERBOSE); curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error); curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS ? 0L : 1L); diff --git a/docs/examples/hsts-preload.c b/docs/examples/hsts-preload.c index a25773f42d..ba9fe87a94 100644 --- a/docs/examples/hsts-preload.c +++ b/docs/examples/hsts-preload.c @@ -87,7 +87,7 @@ int main(void) struct state st = {0}; /* enable HSTS for this handle */ - curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, (long)CURLHSTS_ENABLE); + curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE); /* function to call at first to populate the cache before the transfer */ curl_easy_setopt(curl, CURLOPT_HSTSREADFUNCTION, hstsread); diff --git a/docs/examples/http3.c b/docs/examples/http3.c index e278f2e313..573ea20d2b 100644 --- a/docs/examples/http3.c +++ b/docs/examples/http3.c @@ -38,8 +38,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); /* Use HTTP/3 but fallback to earlier HTTP if necessary */ - curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, - (long)CURL_HTTP_VERSION_3); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_3); /* Perform the request, res gets the return code */ res = curl_easy_perform(curl); diff --git a/docs/examples/imap-tls.c b/docs/examples/imap-tls.c index 838923b334..8fbc96bb55 100644 --- a/docs/examples/imap-tls.c +++ b/docs/examples/imap-tls.c @@ -57,7 +57,7 @@ int main(void) * of using CURLUSESSL_TRY here, because if TLS upgrade fails, the * transfer continues anyway - see the security discussion in the libcurl * tutorial for more details. */ - curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL); + curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL); /* If your server does not have a valid certificate, then you can disable * part of the Transport Layer Security protection by setting the diff --git a/docs/examples/pop3-tls.c b/docs/examples/pop3-tls.c index 7c2d824d04..b2f504c475 100644 --- a/docs/examples/pop3-tls.c +++ b/docs/examples/pop3-tls.c @@ -56,7 +56,7 @@ int main(void) * using CURLUSESSL_TRY here, because if TLS upgrade fails, the transfer * continues anyway - see the security discussion in the libcurl tutorial * for more details. */ - curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL); + curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL); /* If your server does not have a valid certificate, then you can disable * part of the Transport Layer Security protection by setting the diff --git a/docs/examples/smtp-tls.c b/docs/examples/smtp-tls.c index fd4e385023..34a00bd548 100644 --- a/docs/examples/smtp-tls.c +++ b/docs/examples/smtp-tls.c @@ -110,7 +110,7 @@ int main(void) * of using CURLUSESSL_TRY here, because if TLS upgrade fails, the * transfer continues anyway - see the security discussion in the libcurl * tutorial for more details. */ - curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL); + curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL); /* If your server does not have a valid certificate, then you can disable * part of the Transport Layer Security protection by setting the diff --git a/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md b/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md index 8305a62a39..3ed7f3c597 100644 --- a/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md +++ b/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md @@ -23,8 +23,8 @@ CURLOPT_HSTS_CTRL - control HSTS behavior ~~~c #include -#define CURLHSTS_ENABLE (1<<0) -#define CURLHSTS_READONLYFILE (1<<1) +#define CURLHSTS_ENABLE (long)(1<<0) +#define CURLHSTS_READONLYFILE (long)(1<<1) CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTS_CTRL, long bitmask); ~~~ diff --git a/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md b/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md index 63ad0c08a6..618a7123e9 100644 --- a/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md +++ b/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md @@ -105,8 +105,7 @@ int main(void) if(curl) { CURLcode ret; curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); - curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, - (long)CURL_HTTP_VERSION_2TLS); + curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, (long)CURL_HTTP_VERSION_2TLS); ret = curl_easy_perform(curl); if(ret == CURLE_HTTP_RETURNED_ERROR) { /* an HTTP response error problem */ diff --git a/docs/libcurl/opts/CURLOPT_IPRESOLVE.md b/docs/libcurl/opts/CURLOPT_IPRESOLVE.md index 1b761c961b..1b13e3641d 100644 --- a/docs/libcurl/opts/CURLOPT_IPRESOLVE.md +++ b/docs/libcurl/opts/CURLOPT_IPRESOLVE.md @@ -66,7 +66,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin"); /* of all addresses example.com resolves to, only IPv6 ones are used */ - curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6); + curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V6); res = curl_easy_perform(curl); diff --git a/src/config2setopts.c b/src/config2setopts.c index 10c7b9a703..92a9b19e10 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -751,7 +751,7 @@ static CURLcode proxy_setopts(struct OperationConfig *config, CURL *curl) /* new in libcurl 7.10.6 */ if(config->proxyanyauth) - my_setopt_bitmask(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY); + my_setopt_bitmask(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY); else if(config->proxynegotiate) my_setopt_bitmask(curl, CURLOPT_PROXYAUTH, CURLAUTH_GSSNEGOTIATE); else if(config->proxyntlm) diff --git a/tests/client/hx_download.c b/tests/client/hx_download.c index e168b93daf..59e2b036d1 100644 --- a/tests/client/hx_download.c +++ b/tests/client/hx_download.c @@ -129,7 +129,7 @@ static int setup_hx_download(CURL *hnd, const char *url, struct transfer_d *t, curl_easy_setopt(hnd, CURLOPT_XFERINFOFUNCTION, my_progress_d_cb); curl_easy_setopt(hnd, CURLOPT_XFERINFODATA, t); if(use_earlydata) - curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_EARLYDATA); + curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, CURLSSLOPT_EARLYDATA); if(forbid_reuse_d) curl_easy_setopt(hnd, CURLOPT_FORBID_REUSE, 1L); if(host) diff --git a/tests/client/hx_upload.c b/tests/client/hx_upload.c index 3cefdacfbf..0fd25b0fa1 100644 --- a/tests/client/hx_upload.c +++ b/tests/client/hx_upload.c @@ -149,7 +149,7 @@ static int setup_hx_upload(CURL *hnd, const char *url, struct transfer_u *t, curl_easy_setopt(hnd, CURLOPT_WRITEFUNCTION, my_write_u_cb); curl_easy_setopt(hnd, CURLOPT_WRITEDATA, t); if(use_earlydata) - curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_EARLYDATA); + curl_easy_setopt(hnd, CURLOPT_SSL_OPTIONS, CURLSSLOPT_EARLYDATA); if(!t->method || !strcmp("PUT", t->method)) curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L); diff --git a/tests/libtest/lib1511.c b/tests/libtest/lib1511.c index 9a84c8d509..5062cae32a 100644 --- a/tests/libtest/lib1511.c +++ b/tests/libtest/lib1511.c @@ -37,7 +37,7 @@ static CURLcode test_lib1511(char *URL) easy_setopt(curl, CURLOPT_URL, URL); easy_setopt(curl, CURLOPT_HEADER, 1L); - easy_setopt(curl, CURLOPT_TIMECONDITION, (long)CURL_TIMECOND_IFMODSINCE); + easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE); /* TIMEVALUE in the future */ easy_setopt(curl, CURLOPT_TIMEVALUE, 1566210680L); diff --git a/tests/libtest/lib1513.c b/tests/libtest/lib1513.c index 545bf90abe..0584dd9991 100644 --- a/tests/libtest/lib1513.c +++ b/tests/libtest/lib1513.c @@ -57,11 +57,11 @@ static CURLcode test_lib1513(char *URL) easy_init(curl); easy_setopt(curl, CURLOPT_URL, URL); - easy_setopt(curl, CURLOPT_TIMEOUT, (long)7); - easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1); + easy_setopt(curl, CURLOPT_TIMEOUT, 7L); + easy_setopt(curl, CURLOPT_NOSIGNAL, 1L); easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressKiller); easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL); - easy_setopt(curl, CURLOPT_NOPROGRESS, (long)0); + easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); res = curl_easy_perform(curl); diff --git a/tests/libtest/lib1555.c b/tests/libtest/lib1555.c index 39c9ad5cb9..51692fab67 100644 --- a/tests/libtest/lib1555.c +++ b/tests/libtest/lib1555.c @@ -62,11 +62,11 @@ static CURLcode test_lib1555(char *URL) easy_init(t1555_curl); easy_setopt(t1555_curl, CURLOPT_URL, URL); - easy_setopt(t1555_curl, CURLOPT_TIMEOUT, (long)7); - easy_setopt(t1555_curl, CURLOPT_NOSIGNAL, (long)1); + easy_setopt(t1555_curl, CURLOPT_TIMEOUT, 7L); + easy_setopt(t1555_curl, CURLOPT_NOSIGNAL, 1L); easy_setopt(t1555_curl, CURLOPT_PROGRESSFUNCTION, progressCallback); easy_setopt(t1555_curl, CURLOPT_PROGRESSDATA, NULL); - easy_setopt(t1555_curl, CURLOPT_NOPROGRESS, (long)0); + easy_setopt(t1555_curl, CURLOPT_NOPROGRESS, 0L); res = curl_easy_perform(t1555_curl); diff --git a/tests/libtest/lib1568.c b/tests/libtest/lib1568.c index 7a402a0293..eb8d31e926 100644 --- a/tests/libtest/lib1568.c +++ b/tests/libtest/lib1568.c @@ -37,7 +37,7 @@ static CURLcode test_lib1568(char *URL) curl_easy_setopt(hnd, CURLOPT_HEADER, 1L); curl_easy_setopt(hnd, CURLOPT_USERPWD, "testuser:testpass"); curl_easy_setopt(hnd, CURLOPT_USERAGENT, "lib1568"); - curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST); + curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); curl_easy_setopt(hnd, CURLOPT_PORT, strtol(libtest_arg2, NULL, 10)); diff --git a/tests/libtest/lib1593.c b/tests/libtest/lib1593.c index 803e410b90..44d8bf1e1d 100644 --- a/tests/libtest/lib1593.c +++ b/tests/libtest/lib1593.c @@ -40,7 +40,7 @@ static CURLcode test_lib1593(char *URL) easy_init(curl); easy_setopt(curl, CURLOPT_URL, URL); - easy_setopt(curl, CURLOPT_TIMECONDITION, (long)CURL_TIMECOND_IFMODSINCE); + easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE); /* Some TIMEVALUE; it doesn't matter. */ easy_setopt(curl, CURLOPT_TIMEVALUE, 1566210680L); diff --git a/tests/libtest/lib1599.c b/tests/libtest/lib1599.c index 24617246b2..73ca9e18f6 100644 --- a/tests/libtest/lib1599.c +++ b/tests/libtest/lib1599.c @@ -33,7 +33,7 @@ static CURLcode test_lib1599(char *URL) if(curl) { curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(curl, CURLOPT_NETRC, (long)CURL_NETRC_REQUIRED); + curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_REQUIRED); curl_easy_setopt(curl, CURLOPT_NETRC_FILE, libtest_arg2); res = curl_easy_perform(curl); diff --git a/tests/libtest/lib1662.c b/tests/libtest/lib1662.c index 416b3b729b..5ac7e1246d 100644 --- a/tests/libtest/lib1662.c +++ b/tests/libtest/lib1662.c @@ -73,8 +73,7 @@ static CURLcode test_lib1662(char *URL) curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/2000"); curl_easy_setopt(hnd, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L); - curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, - (long)CURL_HTTP_VERSION_2TLS); + curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS); curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L); curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); diff --git a/tests/libtest/lib2309.c b/tests/libtest/lib2309.c index 9145b63965..d5df7cae07 100644 --- a/tests/libtest/lib2309.c +++ b/tests/libtest/lib2309.c @@ -45,7 +45,7 @@ static CURLcode test_lib2309(char *URL) curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg3); - curl_easy_setopt(curl, CURLOPT_NETRC, (long)CURL_NETRC_REQUIRED); + curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_REQUIRED); curl_easy_setopt(curl, CURLOPT_NETRC_FILE, libtest_arg2); curldupe = curl_easy_duphandle(curl); diff --git a/tests/libtest/lib2502.c b/tests/libtest/lib2502.c index fde4283972..af31ce3936 100644 --- a/tests/libtest/lib2502.c +++ b/tests/libtest/lib2502.c @@ -70,7 +70,7 @@ static CURLcode test_lib2502(char *URL) easy_setopt(curl[i], CURLOPT_URL, target_url); /* go http2 */ easy_setopt(curl[i], CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_3ONLY); - easy_setopt(curl[i], CURLOPT_CONNECTTIMEOUT_MS, (long)5000); + easy_setopt(curl[i], CURLOPT_CONNECTTIMEOUT_MS, 5000L); easy_setopt(curl[i], CURLOPT_CAINFO, libtest_arg4); /* wait for first connection established to see if we can share it */ easy_setopt(curl[i], CURLOPT_PIPEWAIT, 1L); diff --git a/tests/libtest/lib510.c b/tests/libtest/lib510.c index bef9260c4e..c5d4a5582e 100644 --- a/tests/libtest/lib510.c +++ b/tests/libtest/lib510.c @@ -110,7 +110,7 @@ static CURLcode test_lib510(char *URL) test_setopt(curl, CURLOPT_HTTPHEADER, slist); if(testnum == 565) { - test_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST); + test_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); test_setopt(curl, CURLOPT_USERPWD, "foo:bar"); } diff --git a/tests/libtest/lib540.c b/tests/libtest/lib540.c index 1914206972..b4c8a00eeb 100644 --- a/tests/libtest/lib540.c +++ b/tests/libtest/lib540.c @@ -61,7 +61,7 @@ static CURLcode init(int num, CURLM *cm, const char *url, const char *userpwd, if(res) goto init_failed; - res_easy_setopt(testeh[num], CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY); + res_easy_setopt(testeh[num], CURLOPT_PROXYAUTH, CURLAUTH_ANY); if(res) goto init_failed; diff --git a/tests/libtest/lib547.c b/tests/libtest/lib547.c index 829f8fdd62..9099b458c9 100644 --- a/tests/libtest/lib547.c +++ b/tests/libtest/lib547.c @@ -103,7 +103,7 @@ static CURLcode test_lib547(char *URL) test_setopt(curl, CURLOPT_PROXY, libtest_arg2); test_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3); test_setopt(curl, CURLOPT_PROXYAUTH, - (long) (CURLAUTH_NTLM | CURLAUTH_DIGEST | CURLAUTH_BASIC) ); + CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM); res = curl_easy_perform(curl); diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c index 3fbdac130e..9a97d110af 100644 --- a/tests/libtest/lib552.c +++ b/tests/libtest/lib552.c @@ -198,7 +198,7 @@ static CURLcode test_lib552(char *URL) /* Accept any auth. But for this bug configure proxy with DIGEST, basic might work too, not NTLM */ - test_setopt(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY); + test_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY); res = curl_easy_perform(curl); diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c index f3e03d6dfd..a71df17714 100644 --- a/tests/libtest/lib555.c +++ b/tests/libtest/lib555.c @@ -99,7 +99,7 @@ static CURLcode test_lib555(char *URL) easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); easy_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3); easy_setopt(curl, CURLOPT_PROXYAUTH, - (long) (CURLAUTH_NTLM | CURLAUTH_DIGEST | CURLAUTH_BASIC) ); + CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM); multi_init(m); diff --git a/tests/libtest/lib579.c b/tests/libtest/lib579.c index fd47d55be9..8ec94c3f66 100644 --- a/tests/libtest/lib579.c +++ b/tests/libtest/lib579.c @@ -149,7 +149,7 @@ static CURLcode test_lib579(char *URL) /* enforce chunked transfer by setting the header */ test_setopt(curl, CURLOPT_HTTPHEADER, slist); - test_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST); + test_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); test_setopt(curl, CURLOPT_USERPWD, "foo:bar"); /* we want to use our own progress function */ diff --git a/tests/libtest/lib583.c b/tests/libtest/lib583.c index a68105ea47..07e0e4ac45 100644 --- a/tests/libtest/lib583.c +++ b/tests/libtest/lib583.c @@ -54,7 +54,7 @@ static CURLcode test_lib583(char *URL) easy_setopt(curl, CURLOPT_VERBOSE, 1L); easy_setopt(curl, CURLOPT_URL, URL); - easy_setopt(curl, CURLOPT_INFILESIZE, (long)5); + easy_setopt(curl, CURLOPT_INFILESIZE, 5L); multi_add_handle(multiHandle, curl); diff --git a/tests/libtest/lib590.c b/tests/libtest/lib590.c index ffa30c6fce..d11f7fc09c 100644 --- a/tests/libtest/lib590.c +++ b/tests/libtest/lib590.c @@ -29,10 +29,11 @@ It is reproducible by the following steps: - - Use a proxy that offers NTLM and Negotiate ( CURLOPT_PROXY and - CURLOPT_PROXYPORT) - - Tell libcurl NOT to use Negotiate CURL_EASY_SETOPT(CURLOPT_PROXYAUTH, - CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM) + - Use a proxy that offers NTLM and Negotiate + (CURLOPT_PROXY and CURLOPT_PROXYPORT) + - Tell libcurl NOT to use Negotiate + curl_easy_setopt(CURLOPT_PROXYAUTH, + CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM) - Start the request */ @@ -59,7 +60,7 @@ static CURLcode test_lib590(char *URL) test_setopt(curl, CURLOPT_URL, URL); test_setopt(curl, CURLOPT_HEADER, 1L); test_setopt(curl, CURLOPT_PROXYAUTH, - (long) (CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM)); + CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM); test_setopt(curl, CURLOPT_PROXY, libtest_arg2); /* set in first.c */ /* set the name + password twice to test that the API is fine with it */ diff --git a/tests/libtest/lib678.c b/tests/libtest/lib678.c index 2461769f8f..cad7b9843e 100644 --- a/tests/libtest/lib678.c +++ b/tests/libtest/lib678.c @@ -80,8 +80,7 @@ static CURLcode test_cert_blob(const char *url, const char *cafile) curl_easy_setopt(curl, CURLOPT_HEADER, 1L); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_USERAGENT, "CURLOPT_CAINFO_BLOB"); - curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, - (long)CURLSSLOPT_REVOKE_BEST_EFFORT); + curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_REVOKE_BEST_EFFORT); blob.data = certdata; blob.len = certsize; diff --git a/tests/libtest/lib694.c b/tests/libtest/lib694.c index 071697838c..e637946c96 100644 --- a/tests/libtest/lib694.c +++ b/tests/libtest/lib694.c @@ -48,7 +48,7 @@ static CURLcode test_lib694(char *URL) test_setopt(curl, CURLOPT_HEADER, 1L); test_setopt(curl, CURLOPT_VERBOSE, 1L); test_setopt(curl, CURLOPT_HTTPAUTH, - (long) (CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM)); + CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM); test_setopt(curl, CURLOPT_USERPWD, "me:password"); do { -- 2.47.2