From e9f35132642b8bace7ab40207603b5713296fe25 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 2 Aug 2010 23:46:24 +0200 Subject: example: fix code to build warning-free --- docs/examples/chkspeed.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/examples/chkspeed.c b/docs/examples/chkspeed.c index c56fe3ccc..d802469b8 100644 --- a/docs/examples/chkspeed.c +++ b/docs/examples/chkspeed.c @@ -40,6 +40,8 @@ static size_t WriteCallback(void *ptr, size_t size, size_t nmemb, void *data) { /* we are not interested in the downloaded bytes itself, so we only return the size we would have saved ... */ + (void)ptr; /* unused */ + (void)data; /* unused */ return (size_t)(size * nmemb); } @@ -48,7 +50,7 @@ int main(int argc, char *argv[]) CURL *curl_handle; CURLcode res; int prtsep = 0, prttime = 0; - char *url = URL_1M; + const char *url = URL_1M; char *appname = argv[0]; if (argc > 1) { @@ -135,17 +137,17 @@ int main(int argc, char *argv[]) /* check for bytes downloaded */ res = curl_easy_getinfo(curl_handle, CURLINFO_SIZE_DOWNLOAD, &val); - if((CURLE_OK == res) && val) + if((CURLE_OK == res) && (val>0)) printf("Data downloaded: %0.0f bytes.\n", val); /* check for total download time */ res = curl_easy_getinfo(curl_handle, CURLINFO_TOTAL_TIME, &val); - if((CURLE_OK == res) && val) + if((CURLE_OK == res) && (val>0)) printf("Total download time: %0.3f sec.\n", val); /* check for average download speed */ res = curl_easy_getinfo(curl_handle, CURLINFO_SPEED_DOWNLOAD, &val); - if((CURLE_OK == res) && val) + if((CURLE_OK == res) && (val>0)) printf("Average download speed: %0.3f kbyte/sec.\n", val / 1024); } else { -- cgit v1.2.3