summaryrefslogtreecommitdiff
path: root/docs/examples
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-05-22 21:20:07 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-05-22 21:20:07 +0000
commite664cd5826d43930fcc5b5dbaedbec94af33184b (patch)
tree7cca8fe1a4d1649d4d40ed7dcd4fc64486dedf00 /docs/examples
parentb8abeab6d3729ce4c9cc3eccb69e2bd3be2b58d3 (diff)
downloadcurl-e664cd5826d43930fcc5b5dbaedbec94af33184b.tar.gz
Fixed a surprising number of example programs that were passing int arguments
to curl_easy_setopt instead of long.
Diffstat (limited to 'docs/examples')
-rw-r--r--docs/examples/10-at-a-time.c4
-rw-r--r--docs/examples/anyauthput.c7
-rw-r--r--docs/examples/cacertinmem.c10
-rw-r--r--docs/examples/cookie_interface.c2
-rw-r--r--docs/examples/curlgtk.c2
-rw-r--r--docs/examples/curlx.c4
-rw-r--r--docs/examples/debug.c2
-rw-r--r--docs/examples/fileupload.c4
-rw-r--r--docs/examples/fopen.c2
-rw-r--r--docs/examples/ftpget.c2
-rw-r--r--docs/examples/ftpupload.c3
-rw-r--r--docs/examples/ftpuploadresume.c18
-rw-r--r--docs/examples/ghiper.c12
-rw-r--r--docs/examples/hiperfifo.c4
-rw-r--r--docs/examples/htmltidy.c4
-rw-r--r--docs/examples/htmltitle.cc2
-rw-r--r--docs/examples/httpput.c6
-rw-r--r--docs/examples/https.c4
-rw-r--r--docs/examples/multi-app.c2
-rw-r--r--docs/examples/multi-debugcallback.c2
-rw-r--r--docs/examples/multi-post.c2
-rw-r--r--docs/examples/persistant.c4
-rw-r--r--docs/examples/post-callback.c6
-rw-r--r--docs/examples/sepheaders.c4
-rw-r--r--docs/examples/simplepost.c2
-rw-r--r--docs/examples/simplessl.c4
-rw-r--r--docs/examples/synctime.c2
-rw-r--r--docs/examples/threaded-ssl.c4
28 files changed, 63 insertions, 61 deletions
diff --git a/docs/examples/10-at-a-time.c b/docs/examples/10-at-a-time.c
index b30efc075..0b2a20ed8 100644
--- a/docs/examples/10-at-a-time.c
+++ b/docs/examples/10-at-a-time.c
@@ -90,10 +90,10 @@ static void init(CURLM *cm, int i)
CURL *eh = curl_easy_init();
curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, cb);
- curl_easy_setopt(eh, CURLOPT_HEADER, 0);
+ curl_easy_setopt(eh, CURLOPT_HEADER, 0L);
curl_easy_setopt(eh, CURLOPT_URL, urls[i]);
curl_easy_setopt(eh, CURLOPT_PRIVATE, urls[i]);
- curl_easy_setopt(eh, CURLOPT_VERBOSE, 0);
+ curl_easy_setopt(eh, CURLOPT_VERBOSE, 0L);
curl_multi_add_handle(cm, eh);
}
diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c
index 952c7c2d7..41531f7aa 100644
--- a/docs/examples/anyauthput.c
+++ b/docs/examples/anyauthput.c
@@ -110,7 +110,7 @@ int main(int argc, char **argv)
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)hd);
/* enable "uploading" (which means PUT when doing HTTP) */
- curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ;
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L) ;
/* specify target URL, and note that this URL should also include a file
name, not only a directory (as you can do with GTP uploads) */
@@ -118,12 +118,13 @@ int main(int argc, char **argv)
/* and give the size of the upload, this supports large file sizes
on systems that have general support for it */
- curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_info.st_size);
+ curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
+ (curl_off_t)file_info.st_size);
/* tell libcurl we can use "any" auth, which lets the lib pick one, but it
also costs one extra round-trip and possibly sending of all the PUT
data twice!!! */
- curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
+ curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
/* set user name and password for the authentication */
curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
diff --git a/docs/examples/cacertinmem.c b/docs/examples/cacertinmem.c
index e58c9ace9..78809ae93 100644
--- a/docs/examples/cacertinmem.c
+++ b/docs/examples/cacertinmem.c
@@ -102,16 +102,16 @@ int main(void)
rv=curl_global_init(CURL_GLOBAL_ALL);
ch=curl_easy_init();
- rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0);
- rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0);
- rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1);
- rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1);
+ rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0L);
+ rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0L);
+ rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1L);
+ rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1L);
rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction);
rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout);
rv=curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction);
rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr);
rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
- rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1);
+ rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L);
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.cacert.org/");
/* first try: retrieve page without cacerts' certificate -> will fail
diff --git a/docs/examples/cookie_interface.c b/docs/examples/cookie_interface.c
index b0f33831d..51b32428d 100644
--- a/docs/examples/cookie_interface.c
+++ b/docs/examples/cookie_interface.c
@@ -54,7 +54,7 @@ main(void)
char nline[256];
curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com/"); /* google.com sets "PREF" cookie */
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
res = curl_easy_perform(curl);
if (res != CURLE_OK) {
diff --git a/docs/examples/curlgtk.c b/docs/examples/curlgtk.c
index 19f7b1712..2327929fb 100644
--- a/docs/examples/curlgtk.c
+++ b/docs/examples/curlgtk.c
@@ -58,7 +58,7 @@ void *my_thread(void *ptr)
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, my_read_func);
- curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
+ curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_progress_func);
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, Bar);
diff --git a/docs/examples/curlx.c b/docs/examples/curlx.c
index 636c8b4fe..bd192865f 100644
--- a/docs/examples/curlx.c
+++ b/docs/examples/curlx.c
@@ -438,7 +438,7 @@ int main(int argc, char **argv) {
/* Now specify the POST binary data */
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
- curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,tabLength);
+ curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength);
/* pass our list of custom made headers */
@@ -477,7 +477,7 @@ int main(int argc, char **argv) {
/* Now specify the POST binary data */
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
- curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,tabLength);
+ curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength);
/* Perform the request, res will get the return code */
diff --git a/docs/examples/debug.c b/docs/examples/debug.c
index 6f7a6383a..543a565eb 100644
--- a/docs/examples/debug.c
+++ b/docs/examples/debug.c
@@ -116,7 +116,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config);
/* the DEBUGFUNCTION has no effect until we enable VERBOSE */
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
res = curl_easy_perform(curl);
diff --git a/docs/examples/fileupload.c b/docs/examples/fileupload.c
index 0f6e69d20..cb88ef687 100644
--- a/docs/examples/fileupload.c
+++ b/docs/examples/fileupload.c
@@ -36,7 +36,7 @@ int main(void)
"file:///home/dast/src/curl/debug/new");
/* tell it to "upload" to the URL */
- curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* set where to read from (on Windows you need to use READFUNCTION too) */
curl_easy_setopt(curl, CURLOPT_READDATA, fd);
@@ -46,7 +46,7 @@ int main(void)
(curl_off_t)file_info.st_size);
/* enable verbose for easier tracing */
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
res = curl_easy_perform(curl);
diff --git a/docs/examples/fopen.c b/docs/examples/fopen.c
index 44d2498a0..9801e15c1 100644
--- a/docs/examples/fopen.c
+++ b/docs/examples/fopen.c
@@ -236,7 +236,7 @@ url_fopen(const char *url,const char *operation)
curl_easy_setopt(file->handle.curl, CURLOPT_URL, url);
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEDATA, file);
- curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0);
+ curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0L);
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEFUNCTION, write_callback);
if(!multi_handle)
diff --git a/docs/examples/ftpget.c b/docs/examples/ftpget.c
index 155e79cb7..179fd6129 100644
--- a/docs/examples/ftpget.c
+++ b/docs/examples/ftpget.c
@@ -65,7 +65,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);
/* Switch on full protocol/debug output */
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
res = curl_easy_perform(curl);
diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c
index 9ce548480..76fc92ebb 100644
--- a/docs/examples/ftpupload.c
+++ b/docs/examples/ftpupload.c
@@ -9,6 +9,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include <curl/curl.h>
#include <sys/types.h>
@@ -83,7 +84,7 @@ int main(int argc, char **argv)
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
/* enable uploading */
- curl_easy_setopt(curl, CURLOPT_UPLOAD, 1) ;
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* specify target */
curl_easy_setopt(curl,CURLOPT_URL, REMOTE_URL);
diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c
index 7c71add0c..d8d1c5b88 100644
--- a/docs/examples/ftpuploadresume.c
+++ b/docs/examples/ftpuploadresume.c
@@ -77,7 +77,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
return 0;
}
- curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, 1);
+ curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath);
@@ -93,9 +93,9 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); /* disable passive mode */
- curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1);
+ curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);
- curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1);
+ curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L);
for (c = 0; (r != CURLE_OK) && (c < tries); c++) {
/* are we resuming? */
@@ -110,22 +110,22 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
* because HEADER will dump the headers to stdout
* without it.
*/
- curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 1);
- curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1);
+ curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 1L);
+ curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1L);
r = curl_easy_perform(curlhandle);
if (r != CURLE_OK)
continue;
- curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0);
- curl_easy_setopt(curlhandle, CURLOPT_HEADER, 0);
+ curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0L);
+ curl_easy_setopt(curlhandle, CURLOPT_HEADER, 0L);
fseek(f, uploaded_len, SEEK_SET);
- curl_easy_setopt(curlhandle, CURLOPT_APPEND, 1);
+ curl_easy_setopt(curlhandle, CURLOPT_APPEND, 1L);
}
else { /* no */
- curl_easy_setopt(curlhandle, CURLOPT_APPEND, 0);
+ curl_easy_setopt(curlhandle, CURLOPT_APPEND, 0L);
}
r = curl_easy_perform(curlhandle);
diff --git a/docs/examples/ghiper.c b/docs/examples/ghiper.c
index db7d3cb1c..a9b695ea0 100644
--- a/docs/examples/ghiper.c
+++ b/docs/examples/ghiper.c
@@ -325,16 +325,16 @@ static void new_conn(char *url, GlobalInfo *g )
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
- curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, SHOW_VERBOSE);
+ curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, (long)SHOW_VERBOSE);
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
- curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS?0:1);
+ curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS?0L:1L);
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
- curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1);
- curl_easy_setopt(conn->easy, CURLOPT_CONNECTTIMEOUT, 30);
- curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 1);
- curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 30);
+ curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1L);
+ curl_easy_setopt(conn->easy, CURLOPT_CONNECTTIMEOUT, 30L);
+ curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 1L);
+ curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 30L);
MSG_OUT("Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
rc =curl_multi_add_handle(g->multi, conn->easy);
diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c
index a3b3b55eb..95ca8ad0d 100644
--- a/docs/examples/hiperfifo.c
+++ b/docs/examples/hiperfifo.c
@@ -327,10 +327,10 @@ static void new_conn(char *url, GlobalInfo *g )
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
- curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1);
+ curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
- curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0);
+ curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
fprintf(MSG_OUT,
diff --git a/docs/examples/htmltidy.c b/docs/examples/htmltidy.c
index 112a4e6b6..cd75401a9 100644
--- a/docs/examples/htmltidy.c
+++ b/docs/examples/htmltidy.c
@@ -75,8 +75,8 @@ int main(int argc, char **argv )
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf);
- curl_easy_setopt(curl, CURLOPT_NOPROGRESS, no);
- curl_easy_setopt(curl, CURLOPT_VERBOSE, yes);
+ curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
tdoc = tidyCreate();
diff --git a/docs/examples/htmltitle.cc b/docs/examples/htmltitle.cc
index 62a4363d5..de7ff0339 100644
--- a/docs/examples/htmltitle.cc
+++ b/docs/examples/htmltitle.cc
@@ -100,7 +100,7 @@ static bool init(CURL *&conn, char *url)
return false;
}
- code = curl_easy_setopt(conn, CURLOPT_FOLLOWLOCATION, 1);
+ code = curl_easy_setopt(conn, CURLOPT_FOLLOWLOCATION, 1L);
if (code != CURLE_OK)
{
fprintf(stderr, "Failed to set redirect option [%s]\n", errorBuffer);
diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c
index 5b92548a5..585dfa2cc 100644
--- a/docs/examples/httpput.c
+++ b/docs/examples/httpput.c
@@ -76,14 +76,14 @@ int main(int argc, char **argv)
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
/* enable uploading */
- curl_easy_setopt(curl, CURLOPT_UPLOAD, 1) ;
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* HTTP PUT please */
- curl_easy_setopt(curl, CURLOPT_PUT, 1);
+ curl_easy_setopt(curl, CURLOPT_PUT, 1L);
/* specify target URL, and note that this URL should include a file
name, not only a directory */
- curl_easy_setopt(curl,CURLOPT_URL, url);
+ curl_easy_setopt(curl, CURLOPT_URL, url);
/* now specify which file to upload */
curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
diff --git a/docs/examples/https.c b/docs/examples/https.c
index 4a83f5f93..e6b8e89b6 100644
--- a/docs/examples/https.c
+++ b/docs/examples/https.c
@@ -31,7 +31,7 @@ int main(void)
* default bundle, then the CURLOPT_CAPATH option might come handy for
* you.
*/
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
#ifdef SKIP_HOSTNAME_VERFICATION
@@ -41,7 +41,7 @@ int main(void)
* subjectAltName) fields, libcurl will refuse to connect. You can skip
* this check, but this will make the connection less secure.
*/
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
#endif
res = curl_easy_perform(curl);
diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c
index 5969c91c8..a8a92ab33 100644
--- a/docs/examples/multi-app.c
+++ b/docs/examples/multi-app.c
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "http://website.com");
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://ftpsite.com");
- curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1);
+ curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1L);
/* init a multi stack */
multi_handle = curl_multi_init();
diff --git a/docs/examples/multi-debugcallback.c b/docs/examples/multi-debugcallback.c
index 1cd6e4398..6a7403a8a 100644
--- a/docs/examples/multi-debugcallback.c
+++ b/docs/examples/multi-debugcallback.c
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
curl_easy_setopt(http_handle, CURLOPT_DEBUGFUNCTION, my_trace);
- curl_easy_setopt(http_handle, CURLOPT_VERBOSE, TRUE);
+ curl_easy_setopt(http_handle, CURLOPT_VERBOSE, 1L);
/* init a multi stack */
multi_handle = curl_multi_init();
diff --git a/docs/examples/multi-post.c b/docs/examples/multi-post.c
index c560bb916..18973a94a 100644
--- a/docs/examples/multi-post.c
+++ b/docs/examples/multi-post.c
@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
/* what URL that receives this POST */
curl_easy_setopt(curl, CURLOPT_URL,
"http://www.fillinyoururl.com/upload.cgi");
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
diff --git a/docs/examples/persistant.c b/docs/examples/persistant.c
index 673889914..3d75b9ebe 100644
--- a/docs/examples/persistant.c
+++ b/docs/examples/persistant.c
@@ -21,8 +21,8 @@ int main(int argc, char **argv)
curl = curl_easy_init();
if(curl) {
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
- curl_easy_setopt(curl, CURLOPT_HEADER, 1);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
/* get the first document */
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/");
diff --git a/docs/examples/post-callback.c b/docs/examples/post-callback.c
index e3f37c4ae..ed89cac2a 100644
--- a/docs/examples/post-callback.c
+++ b/docs/examples/post-callback.c
@@ -55,7 +55,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_URL,
"http://receivingsite.com.pooh/index.cgi");
/* Now specify we want to POST data */
- curl_easy_setopt(curl, CURLOPT_POST, 1);
+ curl_easy_setopt(curl, CURLOPT_POST, 1L);
/* we want to use our own read function */
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
@@ -64,7 +64,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_READDATA, &pooh);
/* get verbose debug output please */
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/*
If you use POST to a HTTP 1.1 server, you can send data without knowing
@@ -85,7 +85,7 @@ int main(void)
#else
/* Set the expected POST size. If you want to POST large amounts of data,
consider CURLOPT_POSTFIELDSIZE_LARGE */
- curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, pooh.sizeleft);
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (curl_off_t)pooh.sizeleft);
#endif
#ifdef DISABLE_EXPECT
diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c
index adfa4374a..9d3dba1f9 100644
--- a/docs/examples/sepheaders.c
+++ b/docs/examples/sepheaders.c
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://curl.haxx.se");
/* no progress meter please */
- curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1);
+ curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);
/* send all data to this function */
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data);
@@ -57,7 +57,7 @@ int main(int argc, char **argv)
}
/* we want the headers to this file handle */
- curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER ,headerfile);
+ curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER, headerfile);
/*
* Notice here that if you want the actual data sent anywhere else but
diff --git a/docs/examples/simplepost.c b/docs/examples/simplepost.c
index 9bab83b7d..4aed4f999 100644
--- a/docs/examples/simplepost.c
+++ b/docs/examples/simplepost.c
@@ -26,7 +26,7 @@ int main(void)
/* if we don't provide POSTFIELDSIZE, libcurl will strlen() by
itself */
- curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(postthis));
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(postthis));
res = curl_easy_perform(curl);
diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c
index 77da32d08..ea9eb5ee7 100644
--- a/docs/examples/simplessl.c
+++ b/docs/examples/simplessl.c
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
fprintf(stderr,"can't set crypto engine\n");
break;
}
- if (curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT,1) != CURLE_OK)
+ if (curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT,1L) != CURLE_OK)
{ /* set the crypto engine as default */
/* only needed for the first time you load
a engine in a curl object... */
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
curl_easy_setopt(curl,CURLOPT_CAINFO,pCACertFile);
/* disconnect if we can't validate server's cert */
- curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1);
+ curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1L);
res = curl_easy_perform(curl);
break; /* we are done... */
diff --git a/docs/examples/synctime.c b/docs/examples/synctime.c
index 2d5a8e51e..dd824670e 100644
--- a/docs/examples/synctime.c
+++ b/docs/examples/synctime.c
@@ -189,7 +189,7 @@ int SyncTime_CURL_Fetch(CURL *curl, char *URL_Str, char *OutFileName,
outfile = NULL;
if (HttpGetBody == HTTP_COMMAND_HEAD)
- curl_easy_setopt(curl, CURLOPT_NOBODY, 1);
+ curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
else {
outfile = fopen(OutFileName, "wb");
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
diff --git a/docs/examples/threaded-ssl.c b/docs/examples/threaded-ssl.c
index afc609551..6b979bac4 100644
--- a/docs/examples/threaded-ssl.c
+++ b/docs/examples/threaded-ssl.c
@@ -106,8 +106,8 @@ static void *pull_one_url(void *url)
curl_easy_setopt(curl, CURLOPT_URL, url);
/* this example doesn't verify the server's certificate, which means we
might be downloading stuff from an impostor */
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_perform(curl); /* ignores error */
curl_easy_cleanup(curl);