anyauthput.c: fix compiler warnings
This commit is contained in:
@@ -78,7 +78,8 @@
|
|||||||
/* ioctl callback function */
|
/* ioctl callback function */
|
||||||
static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
|
static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
|
||||||
{
|
{
|
||||||
intptr_t fd = (intptr_t)userp;
|
int *fdp = (int *)userp;
|
||||||
|
int fd = *fdp;
|
||||||
|
|
||||||
(void)handle; /* not used in here */
|
(void)handle; /* not used in here */
|
||||||
|
|
||||||
@@ -103,7 +104,8 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
|
|||||||
ssize_t retcode;
|
ssize_t retcode;
|
||||||
curl_off_t nread;
|
curl_off_t nread;
|
||||||
|
|
||||||
intptr_t fd = (intptr_t)stream;
|
int *fdp = (int *)stream;
|
||||||
|
int fd = *fdp;
|
||||||
|
|
||||||
retcode = read(fd, ptr, size * nmemb);
|
retcode = read(fd, ptr, size * nmemb);
|
||||||
|
|
||||||
@@ -119,7 +121,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
intptr_t hd;
|
int hd;
|
||||||
struct stat file_info;
|
struct stat file_info;
|
||||||
|
|
||||||
char *file;
|
char *file;
|
||||||
@@ -145,13 +147,13 @@ int main(int argc, char **argv)
|
|||||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||||
|
|
||||||
/* which file to upload */
|
/* which file to upload */
|
||||||
curl_easy_setopt(curl, CURLOPT_READDATA, (void*)hd);
|
curl_easy_setopt(curl, CURLOPT_READDATA, (void*)&hd);
|
||||||
|
|
||||||
/* set the ioctl function */
|
/* set the ioctl function */
|
||||||
curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, my_ioctl);
|
curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, my_ioctl);
|
||||||
|
|
||||||
/* pass the file descriptor to the ioctl callback as well */
|
/* pass the file descriptor to the ioctl callback as well */
|
||||||
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)hd);
|
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)&hd);
|
||||||
|
|
||||||
/* enable "uploading" (which means PUT when doing HTTP) */
|
/* enable "uploading" (which means PUT when doing HTTP) */
|
||||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||||
|
|||||||
Reference in New Issue
Block a user