From ef4af726d73f09db8688034edd63f4ba1348485a Mon Sep 17 00:00:00 2001 From: grunfink Date: Fri, 24 Oct 2025 05:12:44 +0200 Subject: Added cast to curl_read_callback functions to mute warnings. --- xs_curl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xs_curl.h') 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); -- cgit v1.2.3