aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-10-24 05:12:44 +0200
committergrunfink <grunfink@comam.es>2025-10-24 05:12:44 +0200
commitef4af726d73f09db8688034edd63f4ba1348485a (patch)
tree7bed28e8a61eebe6525906df752f0c86cbdc2be1
parent1a42fdc8bd4d5dc045a87108e73dcda4f633266b (diff)
Added cast to curl_read_callback functions to mute warnings.
-rw-r--r--xs_curl.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/xs_curl.h b/xs_curl.h
index 2301661..16b022a 100644
--- a/xs_curl.h
+++ b/xs_curl.h
@@ -125,11 +125,11 @@ xs_dict *xs_http_request(const char *method, const char *url,
/* store response headers here */
curl_easy_setopt(curl, CURLOPT_HEADERDATA, &response);
- curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, _header_callback);
+ curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, (curl_read_callback) _header_callback);
struct _payload_data ipd = { NULL, 0, 0 };
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ipd);
- curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _data_callback);
+ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, (curl_read_callback) _data_callback);
if (strcmp(method, "POST") == 0 || strcmp(method, "PUT") == 0) {
CURLoption curl_method = method[1] == 'O' ? CURLOPT_POST : CURLOPT_UPLOAD;
@@ -147,7 +147,7 @@ xs_dict *xs_http_request(const char *method, const char *url,
pd.offset = 0;
curl_easy_setopt(curl, CURLOPT_READDATA, &pd);
- curl_easy_setopt(curl, CURLOPT_READFUNCTION, _post_callback);
+ curl_easy_setopt(curl, CURLOPT_READFUNCTION, (curl_read_callback) _post_callback);
}
}
@@ -232,7 +232,7 @@ int xs_smtp_request(const char *url, const char *user, const char *pass,
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, rcpt);
curl_easy_setopt(curl, CURLOPT_READDATA, &pd);
- curl_easy_setopt(curl, CURLOPT_READFUNCTION, _post_callback);
+ curl_easy_setopt(curl, CURLOPT_READFUNCTION, (curl_read_callback) _post_callback);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
res = curl_easy_perform(curl);