Skip to content

Commit 6306f76

Browse files
gitsterdscho
authored andcommitted
Merge branch 'jk/curl-easy-setopt-typefix' into js/curl-easy-setopt-typefix
* jk/curl-easy-setopt-typefix: curl: fix symbolic constant typechecks with curl_easy_setopt() curl: fix integer variable typechecks with curl_easy_setopt() curl: fix integer constant typechecks with curl_easy_setopt()
2 parents b65d24b + 6edc160 commit 6306f76

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

http-push.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static char *xml_entities(const char *s)
194194
static void curl_setup_http_get(CURL *curl, const char *url,
195195
const char *custom_req)
196196
{
197-
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1);
197+
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
198198
curl_easy_setopt(curl, CURLOPT_URL, url);
199199
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, custom_req);
200200
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite_null);

http.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ static int has_proxy_cert_password(void)
744744
#ifdef GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE
745745
static void set_curl_keepalive(CURL *c)
746746
{
747-
curl_easy_setopt(c, CURLOPT_TCP_KEEPALIVE, 1);
747+
curl_easy_setopt(c, CURLOPT_TCP_KEEPALIVE, 1L);
748748
}
749749

750750
#else
@@ -1071,13 +1071,13 @@ static CURL *get_curl_handle(void)
10711071
die("curl_easy_init failed");
10721072

10731073
if (!curl_ssl_verify) {
1074-
curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 0);
1075-
curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 0);
1074+
curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 0L);
1075+
curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 0L);
10761076
} else {
10771077
/* Verify authenticity of the peer's certificate */
1078-
curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 1);
1078+
curl_easy_setopt(result, CURLOPT_SSL_VERIFYPEER, 1L);
10791079
/* The name in the cert must match whom we tried to connect */
1080-
curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 2);
1080+
curl_easy_setopt(result, CURLOPT_SSL_VERIFYHOST, 2L);
10811081
}
10821082

10831083
#ifdef GIT_CURL_HAVE_CURL_HTTP_VERSION_2
@@ -1192,8 +1192,8 @@ static CURL *get_curl_handle(void)
11921192
curl_low_speed_time);
11931193
}
11941194

1195-
curl_easy_setopt(result, CURLOPT_MAXREDIRS, 20);
1196-
curl_easy_setopt(result, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
1195+
curl_easy_setopt(result, CURLOPT_MAXREDIRS, 20L);
1196+
curl_easy_setopt(result, CURLOPT_POSTREDIR, (long)CURL_REDIR_POST_ALL);
11971197

11981198
#ifdef GIT_CURL_HAVE_CURLOPT_PROTOCOLS_STR
11991199
{
@@ -1226,7 +1226,7 @@ static CURL *get_curl_handle(void)
12261226
user_agent ? user_agent : git_user_agent());
12271227

12281228
if (curl_ftp_no_epsv)
1229-
curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);
1229+
curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0L);
12301230

12311231
if (curl_ssl_try)
12321232
curl_easy_setopt(result, CURLOPT_USE_SSL, CURLUSESSL_TRY);
@@ -1268,19 +1268,19 @@ static CURL *get_curl_handle(void)
12681268

12691269
if (starts_with(curl_http_proxy, "socks5h"))
12701270
curl_easy_setopt(result,
1271-
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
1271+
CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS5_HOSTNAME);
12721272
else if (starts_with(curl_http_proxy, "socks5"))
12731273
curl_easy_setopt(result,
1274-
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
1274+
CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS5);
12751275
else if (starts_with(curl_http_proxy, "socks4a"))
12761276
curl_easy_setopt(result,
1277-
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
1277+
CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS4A);
12781278
else if (starts_with(curl_http_proxy, "socks"))
12791279
curl_easy_setopt(result,
1280-
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
1280+
CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS4);
12811281
#ifdef GIT_CURL_HAVE_CURLOPT_PROXY_KEYPASSWD
12821282
else if (starts_with(curl_http_proxy, "https")) {
1283-
curl_easy_setopt(result, CURLOPT_PROXYTYPE, CURLPROXY_HTTPS);
1283+
curl_easy_setopt(result, CURLOPT_PROXYTYPE, (long)CURLPROXY_HTTPS);
12841284

12851285
if (http_proxy_ssl_cert)
12861286
curl_easy_setopt(result, CURLOPT_PROXY_SSLCERT, http_proxy_ssl_cert);

imap-send.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,7 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred)
14141414

14151415
curl_easy_setopt(curl, CURLOPT_URL, path.buf);
14161416
strbuf_release(&path);
1417-
curl_easy_setopt(curl, CURLOPT_PORT, srvc->port);
1417+
curl_easy_setopt(curl, CURLOPT_PORT, (long)srvc->port);
14181418

14191419
if (srvc->auth_method) {
14201420
#ifndef GIT_CURL_HAVE_CURLOPT_LOGIN_OPTIONS
@@ -1431,8 +1431,8 @@ static CURL *setup_curl(struct imap_server_conf *srvc, struct credential *cred)
14311431
if (!srvc->use_ssl)
14321432
curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_TRY);
14331433

1434-
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, srvc->ssl_verify);
1435-
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, srvc->ssl_verify);
1434+
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, (long)srvc->ssl_verify);
1435+
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, (long)srvc->ssl_verify);
14361436

14371437
curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
14381438

remote-curl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,12 +876,12 @@ static int probe_rpc(struct rpc_state *rpc, struct slot_results *results)
876876
headers = curl_slist_append(headers, rpc->hdr_content_type);
877877
headers = curl_slist_append(headers, rpc->hdr_accept);
878878

879-
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0);
880-
curl_easy_setopt(slot->curl, CURLOPT_POST, 1);
879+
curl_easy_setopt(slot->curl, CURLOPT_NOBODY, 0L);
880+
curl_easy_setopt(slot->curl, CURLOPT_POST, 1L);
881881
curl_easy_setopt(slot->curl, CURLOPT_URL, rpc->service_url);
882882
curl_easy_setopt(slot->curl, CURLOPT_ENCODING, NULL);
883883
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, "0000");
884-
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, 4);
884+
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, 4L);
885885
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, headers);
886886
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
887887
curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, &buf);

0 commit comments

Comments
 (0)