diff options
author | Yang Tse <yangsita@gmail.com> | 2007-10-17 16:58:32 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-10-17 16:58:32 +0000 |
commit | 92433e596b7fbfa5c75926705dcfef0080ebf012 (patch) | |
tree | 9dc076641396934683d15b962395dc6f11d36d5f /lib | |
parent | 5360f88393c91758ed0f29fa65a9b15716589aa1 (diff) |
We use this ZERO_NULL to avoid picky compiler warnings,
when assigning a NULL pointer to a function pointer var.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dict.c | 18 | ||||
-rw-r--r-- | lib/file.c | 16 | ||||
-rw-r--r-- | lib/ftp.c | 32 | ||||
-rw-r--r-- | lib/http.c | 24 | ||||
-rw-r--r-- | lib/ldap.c | 36 | ||||
-rw-r--r-- | lib/setup_once.h | 9 | ||||
-rw-r--r-- | lib/ssh.c | 20 | ||||
-rw-r--r-- | lib/telnet.c | 16 | ||||
-rw-r--r-- | lib/tftp.c | 12 | ||||
-rw-r--r-- | lib/url.c | 28 |
10 files changed, 106 insertions, 105 deletions
diff --git a/lib/dict.c b/lib/dict.c index 8266e2bb6..f0efab373 100644 --- a/lib/dict.c +++ b/lib/dict.c @@ -95,16 +95,16 @@ static CURLcode Curl_dict(struct connectdata *conn, bool *done); const struct Curl_handler Curl_handler_dict = { "DICT", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_dict, /* do_it */ - NULL, /* done */ - NULL, /* do_more */ - NULL, /* connect_it */ - NULL, /* connecting */ - NULL, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* done */ + ZERO_NULL, /* do_more */ + ZERO_NULL, /* connect_it */ + ZERO_NULL, /* connecting */ + ZERO_NULL, /* doing */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_DICT, /* defport */ PROT_DICT /* protocol */ }; diff --git a/lib/file.c b/lib/file.c index d8a3420c0..6d4ae9892 100644 --- a/lib/file.c +++ b/lib/file.c @@ -104,16 +104,16 @@ static CURLcode Curl_file_done(struct connectdata *conn, const struct Curl_handler Curl_handler_file = { "FILE", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_file, /* do_it */ Curl_file_done, /* done */ - NULL, /* do_more */ - NULL, /* connect_it */ - NULL, /* connecting */ - NULL, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* do_more */ + ZERO_NULL, /* connect_it */ + ZERO_NULL, /* connecting */ + ZERO_NULL, /* doing */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ 0, /* defport */ PROT_FILE /* protocol */ }; @@ -207,16 +207,16 @@ const struct Curl_handler Curl_handler_ftps = { const struct Curl_handler Curl_handler_ftp_proxy = { "FTP", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ - NULL, /* do_more */ - NULL, /* connect_it */ - NULL, /* connecting */ - NULL, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* do_more */ + ZERO_NULL, /* connect_it */ + ZERO_NULL, /* connecting */ + ZERO_NULL, /* doing */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_FTP, /* defport */ PROT_HTTP /* protocol */ }; @@ -229,16 +229,16 @@ const struct Curl_handler Curl_handler_ftp_proxy = { const struct Curl_handler Curl_handler_ftps_proxy = { "FTPS", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ - NULL, /* do_more */ - NULL, /* connect_it */ - NULL, /* connecting */ - NULL, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* do_more */ + ZERO_NULL, /* connect_it */ + ZERO_NULL, /* connecting */ + ZERO_NULL, /* doing */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_FTPS, /* defport */ PROT_HTTP /* protocol */ }; diff --git a/lib/http.c b/lib/http.c index d3954338f..b32ca1d5b 100644 --- a/lib/http.c +++ b/lib/http.c @@ -121,16 +121,16 @@ static int Curl_https_getsock(struct connectdata *conn, */ const struct Curl_handler Curl_handler_http = { "HTTP", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ - NULL, /* do_more */ + ZERO_NULL, /* do_more */ Curl_http_connect, /* connect_it */ - NULL, /* connecting */ - NULL, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* connecting */ + ZERO_NULL, /* doing */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_HTTP, /* defport */ PROT_HTTP, /* protocol */ }; @@ -141,16 +141,16 @@ const struct Curl_handler Curl_handler_http = { */ const struct Curl_handler Curl_handler_https = { "HTTPS", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_http, /* do_it */ Curl_http_done, /* done */ - NULL, /* do_more */ + ZERO_NULL, /* do_more */ Curl_http_connect, /* connect_it */ Curl_https_connecting, /* connecting */ - NULL, /* doing */ + ZERO_NULL, /* doing */ Curl_https_getsock, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_HTTPS, /* defport */ PROT_HTTP | PROT_HTTPS | PROT_SSL /* protocol */ }; diff --git a/lib/ldap.c b/lib/ldap.c index e9467e009..57023a952 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -126,16 +126,16 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done); const struct Curl_handler Curl_handler_ldap = { "LDAP", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_ldap, /* do_it */ - NULL, /* done */ - NULL, /* do_more */ - NULL, /* connect_it */ - NULL, /* connecting */ - NULL, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* done */ + ZERO_NULL, /* do_more */ + ZERO_NULL, /* connect_it */ + ZERO_NULL, /* connecting */ + ZERO_NULL, /* doing */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_LDAP, /* defport */ PROT_LDAP /* protocol */ }; @@ -147,16 +147,16 @@ const struct Curl_handler Curl_handler_ldap = { const struct Curl_handler Curl_handler_ldaps = { "LDAPS", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_ldap, /* do_it */ - NULL, /* done */ - NULL, /* do_more */ - NULL, /* connect_it */ - NULL, /* connecting */ - NULL, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* done */ + ZERO_NULL, /* do_more */ + ZERO_NULL, /* connect_it */ + ZERO_NULL, /* connecting */ + ZERO_NULL, /* doing */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_LDAPS, /* defport */ PROT_LDAP | PROT_SSL /* protocol */ }; diff --git a/lib/setup_once.h b/lib/setup_once.h index 1622f0cc8..ba564120a 100644 --- a/lib/setup_once.h +++ b/lib/setup_once.h @@ -378,6 +378,14 @@ typedef int sig_atomic_t; #endif +/* + * We use this ZERO_NULL to avoid picky compiler warnings, + * when assigning a NULL pointer to a function pointer var. + */ + +#define ZERO_NULL 0 + + #if defined (__LP64__) && defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED) #include <sys/socket.h> /* HP-UX has this oddity where it features a few functions that don't work @@ -460,5 +468,6 @@ inline static ssize_t Curl_hp_recvfrom(int s, void *buf, size_t len, int flags, #endif /* HPUX work-around */ + #endif /* __SETUP_ONCE_H */ @@ -155,16 +155,16 @@ static CURLcode Curl_sftp_doing(struct connectdata *conn, const struct Curl_handler Curl_handler_scp = { "SCP", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_scp_do, /* do_it */ Curl_scp_done, /* done */ - NULL, /* do_more */ + ZERO_NULL, /* do_more */ Curl_ssh_connect, /* connect_it */ Curl_ssh_multi_statemach, /* connecting */ Curl_scp_doing, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_SSH, /* defport */ PROT_SCP /* protocol */ }; @@ -176,16 +176,16 @@ const struct Curl_handler Curl_handler_scp = { const struct Curl_handler Curl_handler_sftp = { "SFTP", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_sftp_do, /* do_it */ Curl_sftp_done, /* done */ - NULL, /* do_more */ + ZERO_NULL, /* do_more */ Curl_ssh_connect, /* connect_it */ Curl_ssh_multi_statemach, /* connecting */ Curl_sftp_doing, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_SSH, /* defport */ PROT_SFTP /* protocol */ }; diff --git a/lib/telnet.c b/lib/telnet.c index b7c470125..03d5e4df0 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -181,16 +181,16 @@ struct TELNET { const struct Curl_handler Curl_handler_telnet = { "TELNET", /* scheme */ - NULL, /* setup_connection */ + ZERO_NULL, /* setup_connection */ Curl_telnet, /* do_it */ Curl_telnet_done, /* done */ - NULL, /* do_more */ - NULL, /* connect_it */ - NULL, /* connecting */ - NULL, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* do_more */ + ZERO_NULL, /* connect_it */ + ZERO_NULL, /* connecting */ + ZERO_NULL, /* doing */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_TELNET, /* defport */ PROT_TELNET /* protocol */ }; diff --git a/lib/tftp.c b/lib/tftp.c index 81cd938c5..ba7842280 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -167,13 +167,13 @@ const struct Curl_handler Curl_handler_tftp = { Curl_tftp_setup_connection, /* setup_connection */ Curl_tftp, /* do_it */ Curl_tftp_done, /* done */ - NULL, /* do_more */ + ZERO_NULL, /* do_more */ Curl_tftp_connect, /* connect_it */ - NULL, /* connecting */ - NULL, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* connecting */ + ZERO_NULL, /* doing */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ PORT_TFTP, /* defport */ PROT_TFTP /* protocol */ }; @@ -175,14 +175,6 @@ static void flush_cookies(struct SessionHandle *data, int cleanup); #define MAX_PIPELINE_LENGTH 5 -/* - * We use this ZERO_NULL to avoid picky compiler warnings, - * when assigning a NULL pointer to a function pointer var. - */ - -#define ZERO_NULL 0 - - #ifndef USE_ARES /* not for ares builds */ @@ -268,16 +260,16 @@ static const struct Curl_handler * const protocols[] = { static const struct Curl_handler Curl_handler_dummy = { "<no protocol>", /* scheme */ - NULL, /* setup_connection */ - NULL, /* do_it */ - NULL, /* done */ - NULL, /* do_more */ - NULL, /* connect_it */ - NULL, /* connecting */ - NULL, /* doing */ - NULL, /* proto_getsock */ - NULL, /* doing_getsock */ - NULL, /* disconnect */ + ZERO_NULL, /* setup_connection */ + ZERO_NULL, /* do_it */ + ZERO_NULL, /* done */ + ZERO_NULL, /* do_more */ + ZERO_NULL, /* connect_it */ + ZERO_NULL, /* connecting */ + ZERO_NULL, /* doing */ + ZERO_NULL, /* proto_getsock */ + ZERO_NULL, /* doing_getsock */ + ZERO_NULL, /* disconnect */ 0, /* defport */ 0 /* protocol */ }; |