summaryrefslogtreecommitdiff
path: root/xs_curl.h
diff options
context:
space:
mode:
authorGravatar grunfink2025-10-24 05:18:49 +0200
committerGravatar grunfink2025-10-24 05:18:49 +0200
commitf52306f4dba129ab9797fc8596e4b336b2142315 (patch)
tree51faf697706cb28a91ad356de304aa13ecaebafd /xs_curl.h
parentAdded cast to curl_read_callback functions to mute warnings. (diff)
downloadpenes-snac2-f52306f4dba129ab9797fc8596e4b336b2142315.tar.gz
penes-snac2-f52306f4dba129ab9797fc8596e4b336b2142315.tar.xz
penes-snac2-f52306f4dba129ab9797fc8596e4b336b2142315.zip
More fixes to libcurl warnings.
Diffstat (limited to '')
-rw-r--r--xs_curl.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/xs_curl.h b/xs_curl.h
index 16b022a..feb23e0 100644
--- a/xs_curl.h
+++ b/xs_curl.h
@@ -54,10 +54,10 @@ struct _payload_data {
54 int offset; 54 int offset;
55}; 55};
56 56
57static int _data_callback(void *buffer, size_t size, 57static size_t _data_callback(void *buffer, size_t size,
58 size_t nitems, struct _payload_data *pd) 58 size_t nitems, struct _payload_data *pd)
59{ 59{
60 int sz = size * nitems; 60 size_t sz = size * nitems;
61 61
62 /* open space */ 62 /* open space */
63 pd->size += sz; 63 pd->size += sz;
@@ -71,14 +71,14 @@ static int _data_callback(void *buffer, size_t size,
71} 71}
72 72
73 73
74static int _post_callback(char *buffer, size_t size, 74static size_t _post_callback(char *buffer, size_t size,
75 size_t nitems, struct _payload_data *pd) 75 size_t nitems, struct _payload_data *pd)
76{ 76{
77 /* size of data left */ 77 /* size of data left */
78 int sz = pd->size - pd->offset; 78 size_t sz = pd->size - pd->offset;
79 79
80 /* if it's still bigger than the provided space, trim */ 80 /* if it's still bigger than the provided space, trim */
81 if (sz > (int) (size * nitems)) 81 if (sz > (size_t) (size * nitems))
82 sz = size * nitems; 82 sz = size * nitems;
83 83
84 memcpy(buffer, pd->data + pd->offset, sz); 84 memcpy(buffer, pd->data + pd->offset, sz);