aboutsummaryrefslogtreecommitdiff
path: root/docs/examples
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-12-17 23:34:26 +0100
committerDaniel Stenberg <daniel@haxx.se>2010-12-17 23:34:26 +0100
commit9583b4af9057c9e35ec3dd3270d4c4813b5f7aaa (patch)
treee50544f244a6243aec3d72a559375c17b83f25bb /docs/examples
parent8219bc9e19c78ec4617ae5311b4ea64c49763ff6 (diff)
examples: fix compiler warnings
Diffstat (limited to 'docs/examples')
-rw-r--r--docs/examples/certinfo.c5
-rw-r--r--docs/examples/debug.c4
-rw-r--r--docs/examples/ftpgetinfo.c4
-rw-r--r--docs/examples/ftpgetresp.c2
-rw-r--r--docs/examples/ftpupload.c2
-rw-r--r--docs/examples/getinmemory.c4
-rw-r--r--docs/examples/multi-app.c2
-rw-r--r--docs/examples/multi-debugcallback.c7
-rw-r--r--docs/examples/multi-double.c2
-rw-r--r--docs/examples/multi-post.c2
-rw-r--r--docs/examples/multi-single.c2
-rw-r--r--docs/examples/persistant.c2
-rw-r--r--docs/examples/sepheaders.c2
-rw-r--r--docs/examples/simplessl.c4
14 files changed, 25 insertions, 19 deletions
diff --git a/docs/examples/certinfo.c b/docs/examples/certinfo.c
index ceb0ac2b0..2e331a415 100644
--- a/docs/examples/certinfo.c
+++ b/docs/examples/certinfo.c
@@ -9,9 +9,12 @@
static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream)
{
+ (void)stream;
+ (void)ptr;
return size * nmemb;
}
-int main(int argc, char **argv)
+
+int main(void)
{
CURL *curl;
CURLcode res;
diff --git a/docs/examples/debug.c b/docs/examples/debug.c
index cc6848178..1e04acb51 100644
--- a/docs/examples/debug.c
+++ b/docs/examples/debug.c
@@ -28,12 +28,12 @@ void dump(const char *text,
/* without the hex output, we can fit more on screen */
width = 0x40;
- fprintf(stream, "%s, %010.10ld bytes (0x%08.8lx)\n",
+ fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
text, (long)size, (long)size);
for(i=0; i<size; i+= width) {
- fprintf(stream, "%04.4lx: ", (long)i);
+ fprintf(stream, "%4.4lx: ", (long)i);
if(!nohex) {
/* hex not disabled, show it */
diff --git a/docs/examples/ftpgetinfo.c b/docs/examples/ftpgetinfo.c
index c4e234f18..95c6f8ac8 100644
--- a/docs/examples/ftpgetinfo.c
+++ b/docs/examples/ftpgetinfo.c
@@ -21,6 +21,8 @@
static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data)
{
+ (void)ptr;
+ (void)data;
/* we are not interested in the headers itself,
so we only return the size we would have saved ... */
return (size_t)(size * nmemb);
@@ -58,7 +60,7 @@ int main(void)
if((CURLE_OK == res) && filetime)
printf("filetime %s: %s", filename, ctime(&filetime));
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
- if((CURLE_OK == res) && filesize)
+ if((CURLE_OK == res) && (filesize>0))
printf("filesize %s: %0.0f bytes\n", filename, filesize);
} else {
/* we failed */
diff --git a/docs/examples/ftpgetresp.c b/docs/examples/ftpgetresp.c
index 2122c4f68..c78832f3c 100644
--- a/docs/examples/ftpgetresp.c
+++ b/docs/examples/ftpgetresp.c
@@ -27,7 +27,7 @@ write_response(void *ptr, size_t size, size_t nmemb, void *data)
return fwrite(ptr, size, nmemb, writehere);
}
-int main(int argc, char **argv)
+int main(void)
{
CURL *curl;
CURLcode res;
diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c
index f1f66c0a1..bee62494c 100644
--- a/docs/examples/ftpupload.c
+++ b/docs/examples/ftpupload.c
@@ -48,7 +48,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
return retcode;
}
-int main(int argc, char **argv)
+int main(void)
{
CURL *curl;
CURLcode res;
diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c
index 635a936ba..85b049483 100644
--- a/docs/examples/getinmemory.c
+++ b/docs/examples/getinmemory.c
@@ -43,7 +43,7 @@ WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
}
-int main(int argc, char **argv)
+int main(void)
{
CURL *curl_handle;
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
* you're done with it, you should free() it as a nice application.
*/
- printf("%lu bytes retrieved\n", chunk.size);
+ printf("%lu bytes retrieved\n", (long)chunk.size);
if(chunk.memory)
free(chunk.memory);
diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c
index 6ba131830..29b07aba1 100644
--- a/docs/examples/multi-app.c
+++ b/docs/examples/multi-app.c
@@ -27,7 +27,7 @@
#define HTTP_HANDLE 0 /* Index for the HTTP transfer */
#define FTP_HANDLE 1 /* Index for the FTP transfer */
-int main(int argc, char **argv)
+int main(void)
{
CURL *handles[HANDLECOUNT];
CURLM *multi_handle;
diff --git a/docs/examples/multi-debugcallback.c b/docs/examples/multi-debugcallback.c
index 529c3d9bb..773faec67 100644
--- a/docs/examples/multi-debugcallback.c
+++ b/docs/examples/multi-debugcallback.c
@@ -37,12 +37,12 @@ void dump(const char *text,
/* without the hex output, we can fit more on screen */
width = 0x40;
- fprintf(stream, "%s, %010.10ld bytes (0x%08.8lx)\n",
+ fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
text, (long)size, (long)size);
for(i=0; i<size; i+= width) {
- fprintf(stream, "%04.4lx: ", (long)i);
+ fprintf(stream, "%4.4lx: ", (long)i);
if(!nohex) {
/* hex not disabled, show it */
@@ -79,6 +79,7 @@ int my_trace(CURL *handle, curl_infotype type,
{
const char *text;
+ (void)userp;
(void)handle; /* prevent compiler warning */
switch (type) {
@@ -108,7 +109,7 @@ int my_trace(CURL *handle, curl_infotype type,
/*
* Simply download a HTTP file.
*/
-int main(int argc, char **argv)
+int main(void)
{
CURL *http_handle;
CURLM *multi_handle;
diff --git a/docs/examples/multi-double.c b/docs/examples/multi-double.c
index 3ea106bf7..990fec36a 100644
--- a/docs/examples/multi-double.c
+++ b/docs/examples/multi-double.c
@@ -22,7 +22,7 @@
/*
* Simply download two HTTP files!
*/
-int main(int argc, char **argv)
+int main(void)
{
CURL *http_handle;
CURL *http_handle2;
diff --git a/docs/examples/multi-post.c b/docs/examples/multi-post.c
index 8b4f03e9e..13cfe6ff4 100644
--- a/docs/examples/multi-post.c
+++ b/docs/examples/multi-post.c
@@ -15,7 +15,7 @@
#include <curl/curl.h>
-int main(int argc, char *argv[])
+int main(void)
{
CURL *curl;
diff --git a/docs/examples/multi-single.c b/docs/examples/multi-single.c
index f248afe76..ca632e08c 100644
--- a/docs/examples/multi-single.c
+++ b/docs/examples/multi-single.c
@@ -22,7 +22,7 @@
/*
* Simply download a HTTP file.
*/
-int main(int argc, char **argv)
+int main(void)
{
CURL *http_handle;
CURLM *multi_handle;
diff --git a/docs/examples/persistant.c b/docs/examples/persistant.c
index 177ada359..53710cde4 100644
--- a/docs/examples/persistant.c
+++ b/docs/examples/persistant.c
@@ -11,7 +11,7 @@
#include <unistd.h>
#include <curl/curl.h>
-int main(int argc, char **argv)
+int main(void)
{
CURL *curl;
CURLcode res;
diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c
index e0c4cbbb7..3fb9045e1 100644
--- a/docs/examples/sepheaders.c
+++ b/docs/examples/sepheaders.c
@@ -21,7 +21,7 @@ static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
return written;
}
-int main(int argc, char **argv)
+int main(void)
{
CURL *curl_handle;
static const char *headerfilename = "head.out";
diff --git a/docs/examples/simplessl.c b/docs/examples/simplessl.c
index db3accaaa..a02c2ae32 100644
--- a/docs/examples/simplessl.c
+++ b/docs/examples/simplessl.c
@@ -32,7 +32,7 @@
*/
-int main(int argc, char **argv)
+int main(void)
{
CURL *curl;
CURLcode res;
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
const char *pEngine;
-#if USE_ENGINE
+#ifdef USE_ENGINE
pKeyName = "rsa_test";
pKeyType = "ENG";
pEngine = "chil"; /* for nChiper HSM... */