Fixed some more simple compile warnings in the examples.
authorDan Fandrich <dan@coneharvesters.com>
Mon, 16 Jul 2007 21:22:12 +0000 (21:22 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Mon, 16 Jul 2007 21:22:12 +0000 (21:22 +0000)
docs/examples/anyauthput.c
docs/examples/cookie_interface.c
docs/examples/ftpget.c
docs/examples/ftpgetresp.c
docs/examples/ftpupload.c
docs/examples/getinmemory.c
docs/examples/httpput.c
docs/examples/post-callback.c
docs/examples/sepheaders.c

index 54cea00..bc6138f 100644 (file)
@@ -57,7 +57,7 @@ static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
 }
 
 /* read callback function, fread() look alike */
-size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
+static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
 {
   size_t retcode;
 
index a39106e..b0f3383 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <time.h>
 
@@ -74,7 +75,7 @@ main(void)
 #define snprintf _snprintf
 #endif
     /* Netscape format cookie */
-    snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%u\t%s\t%s",
+    snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%lu\t%s\t%s",
       ".google.com", "TRUE", "/", "FALSE", time(NULL) + 31337, "PREF", "hello google, i like you very much!");
     res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
     if (res != CURLE_OK) {
index 4e3fc8f..42e70bd 100644 (file)
@@ -26,7 +26,7 @@ struct FtpFile {
   FILE *stream;
 };
 
-int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
+static int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
 {
   struct FtpFile *out=(struct FtpFile *)stream;
   if(out && !out->stream) {
index cf61ded..31c1f42 100644 (file)
@@ -21,7 +21,7 @@
  * This functionality was introduced in libcurl 7.9.3.
  */
 
-size_t
+static size_t
 write_response(void *ptr, size_t size, size_t nmemb, void *data)
 {
   FILE *writehere = (FILE *)data;
index 65f8a8a..5a09849 100644 (file)
@@ -14,6 +14,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <unistd.h>
 
 /*
  * This example shows an FTP upload, with a rename of the file just after
index 00ed39e..e80aa41 100644 (file)
@@ -26,7 +26,7 @@ struct MemoryStruct {
   size_t size;
 };
 
-void *myrealloc(void *ptr, size_t size)
+static void *myrealloc(void *ptr, size_t size)
 {
   /* There might be a realloc() out there that doesn't like reallocing
      NULL pointers, so we take care of it here */
@@ -36,7 +36,7 @@ void *myrealloc(void *ptr, size_t size)
     return malloc(size);
 }
 
-size_t
+static size_t
 WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
 {
   size_t realsize = size * nmemb;
index 8fd423c..5b92548 100644 (file)
@@ -11,6 +11,7 @@
 #include <stdio.h>
 #include <fcntl.h>
 #include <sys/stat.h>
+#include <unistd.h>
 
 #include <curl/curl.h>
 
@@ -24,7 +25,7 @@
  * http://www.apacheweek.com/features/put
  */
 
-size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
+static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
 {
   size_t retcode;
 
index a2c8987..531b681 100644 (file)
@@ -22,7 +22,7 @@ struct WriteThis {
   int sizeleft;
 };
 
-size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
+static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
 {
   struct WriteThis *pooh = (struct WriteThis *)userp;
 
index e35aebf..adfa437 100644 (file)
@@ -16,7 +16,7 @@
 #include <curl/types.h>
 #include <curl/easy.h>
 
-size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
+static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
 {
   int written = fwrite(ptr, size, nmemb, (FILE *)stream);
   return written;