From: Dan Fandrich Date: Mon, 16 Jul 2007 21:22:12 +0000 (+0000) Subject: Fixed some more simple compile warnings in the examples. X-Git-Tag: upstream/7.37.1~8906 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4706a9334149f656eef9b5e8888da1ead23b0941;p=platform%2Fupstream%2Fcurl.git Fixed some more simple compile warnings in the examples. --- diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index 54cea00..bc6138f 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -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; diff --git a/docs/examples/cookie_interface.c b/docs/examples/cookie_interface.c index a39106e..b0f3383 100644 --- a/docs/examples/cookie_interface.c +++ b/docs/examples/cookie_interface.c @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -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) { diff --git a/docs/examples/ftpget.c b/docs/examples/ftpget.c index 4e3fc8f..42e70bd 100644 --- a/docs/examples/ftpget.c +++ b/docs/examples/ftpget.c @@ -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) { diff --git a/docs/examples/ftpgetresp.c b/docs/examples/ftpgetresp.c index cf61ded..31c1f42 100644 --- a/docs/examples/ftpgetresp.c +++ b/docs/examples/ftpgetresp.c @@ -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; diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index 65f8a8a..5a09849 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -14,6 +14,7 @@ #include #include #include +#include /* * This example shows an FTP upload, with a rename of the file just after diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c index 00ed39e..e80aa41 100644 --- a/docs/examples/getinmemory.c +++ b/docs/examples/getinmemory.c @@ -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; diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index 8fd423c..5b92548 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -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; diff --git a/docs/examples/post-callback.c b/docs/examples/post-callback.c index a2c8987..531b681 100644 --- a/docs/examples/post-callback.c +++ b/docs/examples/post-callback.c @@ -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; diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c index e35aebf..adfa437 100644 --- a/docs/examples/sepheaders.c +++ b/docs/examples/sepheaders.c @@ -16,7 +16,7 @@ #include #include -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;