aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-08-02 23:46:24 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-08-02 23:46:24 +0200
commite9f35132642b8bace7ab40207603b5713296fe25 (patch)
treea27291c6511bcace8b5acab7fbe58cc0bd289c7d
parenta1a5ba3d0adad64c4c028d5d3f2903abd0efb510 (diff)
example: fix code to build warning-free
-rw-r--r--docs/examples/chkspeed.c10
1 files 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 {