]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
docs: make sure libcurl opts examples pass in long arguments
authorDaniel Stenberg <daniel@haxx.se>
Fri, 21 Oct 2022 22:06:35 +0000 (00:06 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 22 Oct 2022 21:24:57 +0000 (23:24 +0200)
Reported-by: Sergey
Fixes #9779
Closes #9780

16 files changed:
docs/libcurl/opts/CURLINFO_CONDITION_UNMET.3
docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.3
docs/libcurl/opts/CURLOPT_FTPSSLAUTH.3
docs/libcurl/opts/CURLOPT_FTP_CREATE_MISSING_DIRS.3
docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.3
docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.3
docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.3
docs/libcurl/opts/CURLOPT_HSTS_CTRL.3
docs/libcurl/opts/CURLOPT_HTTPAUTH.3
docs/libcurl/opts/CURLOPT_HTTP_VERSION.3
docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.3
docs/libcurl/opts/CURLOPT_SSLVERSION.3
docs/libcurl/opts/CURLOPT_SSL_OPTIONS.3
docs/libcurl/opts/CURLOPT_TIMECONDITION.3
docs/libcurl/opts/CURLOPT_USE_SSL.3
docs/libcurl/opts/CURLOPT_WS_OPTIONS.3

index 241adf65707f98504adb4ed1d4667a4981a61d5d..f3c0e1bd98c5cfaa673941f4723c69c44e5b623b 100644 (file)
@@ -52,7 +52,8 @@ if(curl) {
   curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
 
   /* If-Modified-Since the above time stamp */
-  curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
+  curl_easy_setopt(curl, CURLOPT_TIMECONDITION,
+                   (long)CURL_TIMECOND_IFMODSINCE);
 
   /* Perform the request */
   res = curl_easy_perform(curl);
index a3d3c88d847c9eac553d23debe0c2e34b6d66284..f42f3496b5274272f7e532ef24271a08b0dc8746 100644 (file)
@@ -75,7 +75,7 @@ HTTPS
 .nf
 CURL *curl = curl_easy_init();
 if(curl) {
-  curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, CURLALTSVC_H1);
+  curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, (long)CURLALTSVC_H1);
   curl_easy_setopt(curl, CURLOPT_ALTSVC, "altsvc-cache.txt");
   curl_easy_perform(curl);
 }
index cdc499a5a49b4c794dd64adbb14da41ce7f86cad..4e317fbc8e9693ceb5e46fed759ab0e889eef170 100644 (file)
@@ -54,7 +54,7 @@ if(curl) {
   curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
   curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);
   /* funny server, ask for SSL before TLS */
-  curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_SSL);
+  curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, (long)CURLFTPAUTH_SSL);
   ret = curl_easy_perform(curl);
   curl_easy_cleanup(curl);
 }
index 2fbe0600172e1c166c199cc61b1dae3edf72dc8c..67f2a63872318393d54ee50794fd631539219651 100644 (file)
@@ -66,7 +66,7 @@ CURL *curl = curl_easy_init();
 if(curl) {
   curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/non-existing/new.txt");
   curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS,
-                         CURLFTP_CREATE_DIR_RETRY);
+                   (long)CURLFTP_CREATE_DIR_RETRY);
 
   ret = curl_easy_perform(curl);
 
index cfaab87a9259918d7b3e90a7bcde48faa1d35ce7..db6c6071d6df6731ed3e93f4d89e14e1af2d475a 100644 (file)
@@ -60,7 +60,7 @@ CURL *curl = curl_easy_init();
 if(curl) {
   curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/1/2/3/4/new.txt");
   curl_easy_setopt(curl, CURLOPT_FTP_FILEMETHOD,
-                         CURLFTPMETHOD_SINGLECWD);
+                   (long)CURLFTPMETHOD_SINGLECWD);
 
   ret = curl_easy_perform(curl);
 
index 3d3a68e26e15929090009b120de6bdfcac348097..225d945f397f1f250b87fa384cf207f3e94e2d0e 100644 (file)
@@ -55,7 +55,7 @@ if(curl) {
   curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
   curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_CONTROL);
   /* go back to clear-text FTP after authenticating */
-  curl_easy_setopt(curl, CURLOPT_FTP_SSL_CCC, CURLFTPSSL_CCC_ACTIVE);
+  curl_easy_setopt(curl, CURLOPT_FTP_SSL_CCC, (long)CURLFTPSSL_CCC_ACTIVE);
   ret = curl_easy_perform(curl);
   curl_easy_cleanup(curl);
 }
index 4cf7a513c103e074edfacc5e520e9cc4eaef92d0..ef85dbc257b6fc2a9b824ff4dfce8e59ad843df5 100644 (file)
@@ -51,7 +51,7 @@ if(curl) {
   curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
   /* delegate if okayed by policy */
   curl_easy_setopt(curl, CURLOPT_GSSAPI_DELEGATION,
-                         CURLGSSAPI_DELEGATION_POLICY_FLAG);
+                   (long)CURLGSSAPI_DELEGATION_POLICY_FLAG);
   ret = curl_easy_perform(curl);
 }
 .fi
index 76f9004d2c461fbcfbdba7112944784c86065d14..f43ad5895e4c21991284f57dd35db850fad6d1ab 100644 (file)
@@ -57,7 +57,7 @@ HTTPS and HTTP
 .nf
 CURL *curl = curl_easy_init();
 if(curl) {
-  curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE);
+  curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, (long)CURLHSTS_ENABLE);
   curl_easy_perform(curl);
 }
 .fi
index 3477b025e5883ba2f7b65df30c64129c37ba548c..e217f782234d35a72408c1c43cc811d03e3f4617 100644 (file)
@@ -114,7 +114,7 @@ if(curl) {
   CURLcode ret;
   curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
   /* allow whatever auth the server speaks */
-  curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
+  curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
   curl_easy_setopt(curl, CURLOPT_USERPWD, "james:bond");
   ret = curl_easy_perform(curl);
 }
index c0a2a71aefcb7bcc1e734c80f8ca64a37b7c12b9..894dbf03eef12f00fa15dec8929811e6dad5b5fc 100644 (file)
@@ -85,7 +85,8 @@ CURL *curl = curl_easy_init();
 if(curl) {
   CURLcode ret;
   curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
-  curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, 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 */
index 0164103337b0f0823c03248c8123e720912e4c2d..71d15e5d2271999b1d770abc2a2e8986f66e95e5 100644 (file)
@@ -52,7 +52,7 @@ if(curl) {
   curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://user:pass@myproxy.com");
 
   /* enable username/password authentication only */
-  curl_easy_setopt(curl, CURLOPT_SOCKS5_AUTH, CURLAUTH_BASIC);
+  curl_easy_setopt(curl, CURLOPT_SOCKS5_AUTH, (long)CURLAUTH_BASIC);
 
   /* Perform the request */
   curl_easy_perform(curl);
index 960e54b342c8b5874671294a65826eb78729e7c6..f2e771b845b80954831414de2bb15e8247c76d37 100644 (file)
@@ -99,7 +99,7 @@ if(curl) {
   curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
 
   /* ask libcurl to use TLS version 1.0 or later */
-  curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
+  curl_easy_setopt(curl, CURLOPT_SSLVERSION, (long)CURL_SSLVERSION_TLSv1);
 
   /* Perform the request */
   curl_easy_perform(curl);
index 3d773ae30616009505ddbb9c8807d6af3a1cc8de..69087dddb2bfceb6c2a6b86fc344a14a291a62e5 100644 (file)
@@ -82,7 +82,7 @@ CURL *curl = curl_easy_init();
 if(curl) {
   curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
   /* weaken TLS only for use with silly servers */
-  curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_ALLOW_BEAST |
+  curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_ALLOW_BEAST |
                    CURLSSLOPT_NO_REVOKE);
   ret = curl_easy_perform(curl);
   curl_easy_cleanup(curl);
index dc7c83680c5da1689f6ccf56ef962edcdd1614d0..65289cda6c86521ffa1b4c1a712b2ee96ce1e164 100644 (file)
@@ -55,7 +55,8 @@ if(curl) {
   curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
 
   /* If-Modified-Since the above time stamp */
-  curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
+  curl_easy_setopt(curl, CURLOPT_TIMECONDITION,
+                   (long)CURL_TIMECOND_IFMODSINCE);
 
   /* Perform the request */
   curl_easy_perform(curl);
index 43aed8cee5295effc85f63eb4feee4a4b9d716c6..64c805e1cffab297f53bf3c5fe4e06f5de6992d1 100644 (file)
@@ -59,7 +59,7 @@ if(curl) {
   curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/file.ext");
 
   /* require use of SSL for this, or fail */
-  curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);
+  curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
 
   /* Perform the request */
   curl_easy_perform(curl);
index bfd59ccd91d18a0db903fe5d5b6d2ecee484f579..31a407038c86b802879ce6b04afad608e71a3bf1 100644 (file)
@@ -56,7 +56,7 @@ CURL *curl = curl_easy_init();
 if(curl) {
   curl_easy_setopt(curl, CURLOPT_URL, "ws://example.com/");
   /* tell curl we deal with all the WebSocket magic ourselves */
-  curl_easy_setopt(curl, CURLOPT_WS_OPTIONS, CURLWS_RAW_MODE);
+  curl_easy_setopt(curl, CURLOPT_WS_OPTIONS, (long)CURLWS_RAW_MODE);
   ret = curl_easy_perform(curl);
   curl_easy_cleanup(curl);
 }