We use this ZERO_NULL to avoid picky compiler warnings,

when assigning a NULL pointer to a function pointer var.
This commit is contained in:
Yang Tse 2007-10-17 16:58:32 +00:00
parent 5360f88393
commit 92433e596b
11 changed files with 106 additions and 112 deletions

View File

@ -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 */
};

View File

@ -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 */
};

View File

@ -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 */
};

View File

@ -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 */
};

View File

@ -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 */
};

View File

@ -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 */

View File

@ -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 */
};

View File

@ -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 */
};

View File

@ -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 */
};

View File

@ -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 */
};

View File

@ -35,13 +35,6 @@
#define MAIN_LOOP_HANG_TIMEOUT 90 * 1000
#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
/*
* We use this ZERO_NULL to avoid picky compiler warnings,
* when assigning a NULL pointer to a function pointer var.
*/
#define ZERO_NULL 0
int portnum; /* the HTTPS port number we use */
typedef struct sslctxparm_st {