summaryrefslogtreecommitdiff
path: root/docs/examples/externalsocket.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-04-13 17:58:41 +0200
committerYang Tse <yangsita@gmail.com>2012-04-13 17:59:49 +0200
commit865893fb143540037ca34f6a4438ebe2e286ec5a (patch)
tree7e915522d0c9e6eafd0a4d30929dfa45c3695da3 /docs/examples/externalsocket.c
parenta60edcc6d445e7e0517589cf5fda2682bd89e34e (diff)
downloadcurl-865893fb143540037ca34f6a4438ebe2e286ec5a.tar.gz
examples: fix compiler warnings
Diffstat (limited to 'docs/examples/externalsocket.c')
-rw-r--r--docs/examples/externalsocket.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c
index c4abafd87..6e2a773b2 100644
--- a/docs/examples/externalsocket.c
+++ b/docs/examples/externalsocket.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -57,7 +57,10 @@ static curl_socket_t opensocket(void *clientp,
curlsocktype purpose,
struct curl_sockaddr *address)
{
- curl_socket_t sockfd = *(curl_socket_t *)clientp;
+ curl_socket_t sockfd;
+ (void)purpose;
+ (void)address;
+ sockfd = *(curl_socket_t *)clientp;
/* the actual externally set socket is passed in via the OPENSOCKETDATA
option */
return sockfd;
@@ -66,6 +69,9 @@ static curl_socket_t opensocket(void *clientp,
static int sockopt_callback(void *clientp, curl_socket_t curlfd,
curlsocktype purpose)
{
+ (void)clientp;
+ (void)curlfd;
+ (void)purpose;
/* This return code was added in libcurl 7.21.5 */
return CURL_SOCKOPT_ALREADY_CONNECTED;
}
@@ -96,7 +102,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_URL, "http://99.99.99.99:9999");
/* Create the socket "manually" */
- if( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) {
+ if( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD ) {
printf("Error creating listening socket.\n");
return 3;
}