Fixed some more simple compile warnings in the examples.

This commit is contained in:
Dan Fandrich 2007-07-16 21:22:12 +00:00
parent b85b56a73d
commit 4706a93341
9 changed files with 12 additions and 9 deletions

View 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;

View 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) {

View 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) {

View 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;

View 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

View 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;

View 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;

View 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;

View 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;