]> granicus.if.org Git - curl/commitdiff
Fixed a surprising number of example programs that were passing int arguments
authorDan Fandrich <dan@coneharvesters.com>
Thu, 22 May 2008 21:20:07 +0000 (21:20 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 22 May 2008 21:20:07 +0000 (21:20 +0000)
to curl_easy_setopt instead of long.

28 files changed:
docs/examples/10-at-a-time.c
docs/examples/anyauthput.c
docs/examples/cacertinmem.c
docs/examples/cookie_interface.c
docs/examples/curlgtk.c
docs/examples/curlx.c
docs/examples/debug.c
docs/examples/fileupload.c
docs/examples/fopen.c
docs/examples/ftpget.c
docs/examples/ftpupload.c
docs/examples/ftpuploadresume.c
docs/examples/ghiper.c
docs/examples/hiperfifo.c
docs/examples/htmltidy.c
docs/examples/htmltitle.cc
docs/examples/httpput.c
docs/examples/https.c
docs/examples/multi-app.c
docs/examples/multi-debugcallback.c
docs/examples/multi-post.c
docs/examples/persistant.c
docs/examples/post-callback.c
docs/examples/sepheaders.c
docs/examples/simplepost.c
docs/examples/simplessl.c
docs/examples/synctime.c
docs/examples/threaded-ssl.c

index b30efc0752e2fd6d990a226dfd4fd90f660217d0..0b2a20ed8361be7b33043b8729a18df08da13cbe 100644 (file)
@@ -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);
 }
index 952c7c2d78fa0e898d6c6b01da22fb2f81518877..41531f7aafc8b311de4127e21a842833e5a22a0b 100644 (file)
@@ -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");
index e58c9ace9508d0bf52c0e191dcc1202ed2a83eb3..78809ae93c15ec756f44806c47447273803b90a1 100644 (file)
@@ -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
index b0f33831d6bf25ef783f00c853d8a54ddb7d486a..51b32428d9d5ff0159fca331b6143f66587762a9 100644 (file)
@@ -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) {
index 19f7b1712afaf5e054ffb5755fe769e1a12d8222..2327929fbb6b5274dbf8e47405cd80b2db231bc5 100644 (file)
@@ -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);
 
index 636c8b4fec46ce380c908fca24554aef3d16b4fa..bd192865f78517a9b9725efeb2bca61846be815c 100644 (file)
@@ -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 */
index 6f7a6383a9d87d3fc61a9352802a8c70c18ff09f..543a565eb93d07d52738dc0e582b810ddadacba5 100644 (file)
@@ -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);
index 0f6e69d20621d7639597b278e5d3d404cd73e876..cb88ef687a4b22647c3c86e596056764bcb1ae9d 100644 (file)
@@ -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);
 
index 44d2498a01846147c22707a579270d05ea75520d..9801e15c15733dbad00b5036b33e1522f70ae65d 100644 (file)
@@ -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)
index 155e79cb70498c921d8e5f4939a6a284f58f9867..179fd612931d565b4cc716ad6ddb8bbf7cc7a65d 100644 (file)
@@ -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);
 
index 9ce548480bf6dc7c49390efad8551b0093e45860..76fc92ebbe3c838133a3f6d65e7dc44459abeef2 100644 (file)
@@ -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);
index 7c71add0c89eabd0de38acf9567e3eaf59173225..d8d1c5b888b70c829c9d78d629fe0e3999091927 100644 (file)
@@ -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);
index db7d3cb1c00c3d4eca155f6cad25f5b97edd12f5..a9b695ea02ee10d6b6aab66257f883dc6c08f457 100644 (file)
@@ -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);
index a3b3b55eb571905d3da1f275fa660e618cb21b50..95ca8ad0df5de0c091b58a83c2005851718d42db 100644 (file)
@@ -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,
index 112a4e6b674860533df3169ce66e6445a98135b0..cd75401a9759a461b85c6bd6560632f95c57dbcf 100644 (file)
@@ -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();
index 62a4363d534471486ffca7679a93523c95fa7443..de7ff0339c2f532b15bf49ce805c7d631133697b 100644 (file)
@@ -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);
index 5b92548a5f35f1d039ca6a5606fb9f279eac53d2..585dfa2cc422c341c863ab5b52e6d892f1880794 100644 (file)
@@ -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);
index 4a83f5f936473bd8368205e8990d06751659e51b..e6b8e89b6c56420252de056ab9bcfa27bde333be 100644 (file)
@@ -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);
index 5969c91c8ba198004ebed730142a96c009002b79..a8a92ab338a40f24ca6976fd6d4a77191a8f81f6 100644 (file)
@@ -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();
index 1cd6e4398eca64252173a3aebd1615be3d4733d8..6a7403a8a1db25764a6589b38a0179c552fa4a20 100644 (file)
@@ -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();
index c560bb916c949155b1701326b2cabe0cf5f20760..18973a94aa72faef4112a7f3ebd9526f4872192f 100644 (file)
@@ -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);
index 673889914d217a11913fc563a6dc5cbfbfebff84..3d75b9ebef61b75422befd9b9e36320cbcaf24a0 100644 (file)
@@ -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/");
index e3f37c4aecb40db7cd2d7003e13bca44b13cc6f6..ed89cac2ab44960e4fcaadd5352faef0959b71f2 100644 (file)
@@ -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
index adfa4374aff417fde308ba394d2f2a7e0adbc34d..9d3dba1f983b6f9e1dbab4574049c3e2abd147ab 100644 (file)
@@ -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_WRITEHEADERheaderfile);
 
   /*
    * Notice here that if you want the actual data sent anywhere else but
index 9bab83b7d986bfe0c54f58bd83e5c42d3a8cca10..4aed4f999b9438a2f4486ec238ec9d55f8164bbb 100644 (file)
@@ -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);
 
index 77da32d08f6b31796217ad0c6f698f92e7cf17a6..ea9eb5ee7b983e1d97341b56752cf3a4276fd3e5 100644 (file)
@@ -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... */
index 2d5a8e51e1b12bb09f268c9c092b05cee691c52d..dd824670e2699e7210be0182830e94792d67cfeb 100644 (file)
@@ -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);
index afc60955141ce2a4003f83341d025c021de7d7ec..6b979bac4764e18af5b5d502ee2ba8c6b4252f58 100644 (file)
@@ -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);