]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CURLOPT: bump `CURL_REDIR_*` macros to `long`
authorViktor Szakats <commit@vsz.me>
Wed, 30 Jul 2025 21:54:47 +0000 (23:54 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 31 Jul 2025 07:29:49 +0000 (09:29 +0200)
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:

- CURL_REDIR_GET_ALL
- CURL_REDIR_POST_301
- CURL_REDIR_POST_302
- CURL_REDIR_POST_303
- CURL_REDIR_POST_ALL

Also:
- keep existing cast within the documentation to make sure it applies
  to older curl versions as well.

Closes #18110

include/curl/curl.h
tests/libtest/lib1571.c
tests/libtest/lib650.c

index 67f03503b7bb60097eee2e069fcdb21141fd778a..36038494b3641b215afe2f46cfa6e25070ada7a5 100644 (file)
@@ -2398,10 +2398,10 @@ enum CURL_TLSAUTH {
    can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
    | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
 
-#define CURL_REDIR_GET_ALL  0
-#define CURL_REDIR_POST_301 1
-#define CURL_REDIR_POST_302 2
-#define CURL_REDIR_POST_303 4
+#define CURL_REDIR_GET_ALL  0L
+#define CURL_REDIR_POST_301 1L
+#define CURL_REDIR_POST_302 2L
+#define CURL_REDIR_POST_303 4L
 #define CURL_REDIR_POST_ALL \
     (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
 
index a4923e919662bb2ad8d76d9a8644960583bac8a9..622be2f643d0211b7d383e61c614fe2c746f9891 100644 (file)
@@ -50,7 +50,7 @@ static CURLcode test_lib1571(const char *URL)
     test_setopt(curl, CURLOPT_POSTFIELDS, "moo");
   }
   if(testnum == 1581) {
-    test_setopt(curl, CURLOPT_POSTREDIR, (long)CURL_REDIR_POST_301);
+    test_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_301);
   }
 
   test_setopt(curl, CURLOPT_CUSTOMREQUEST, "IGLOO");
index 42fa5b822c06e07f50de59cf15880cefa27971ea..e758aabac058288e1f073a30444ad6da47a0ae93 100644 (file)
@@ -187,7 +187,7 @@ static CURLcode test_lib650(const char *URL)
   test_setopt(curl, CURLOPT_VERBOSE, 1L);
 
   test_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
-  test_setopt(curl, CURLOPT_POSTREDIR, (long)CURL_REDIR_POST_301);
+  test_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_301);
 
   /* include headers in the output */
   test_setopt(curl, CURLOPT_HEADER, 1L);