mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Fixed compilation warnings
This commit is contained in:
parent
307e6b7ac9
commit
22ecd4428a
19
main/SAPI.h
19
main/SAPI.h
@ -272,7 +272,6 @@ struct _sapi_module_struct {
|
|||||||
unsigned int (*input_filter_init)(void);
|
unsigned int (*input_filter_init)(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct _sapi_post_entry {
|
struct _sapi_post_entry {
|
||||||
char *content_type;
|
char *content_type;
|
||||||
uint content_type_len;
|
uint content_type_len;
|
||||||
@ -305,7 +304,23 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data);
|
|||||||
SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter);
|
SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter);
|
||||||
END_EXTERN_C()
|
END_EXTERN_C()
|
||||||
|
|
||||||
#define STANDARD_SAPI_MODULE_PROPERTIES
|
#define STANDARD_SAPI_MODULE_PROPERTIES \
|
||||||
|
NULL, /* php_ini_path_override */ \
|
||||||
|
NULL, /* default_post_reader */ \
|
||||||
|
NULL, /* treat_data */ \
|
||||||
|
NULL, /* executable_location */ \
|
||||||
|
0, /* php_ini_ignore */ \
|
||||||
|
0, /* php_ini_ignore_cwd */ \
|
||||||
|
NULL, /* get_fd */ \
|
||||||
|
NULL, /* force_http_10 */ \
|
||||||
|
NULL, /* get_target_uid */ \
|
||||||
|
NULL, /* get_target_gid */ \
|
||||||
|
NULL, /* input_filter */ \
|
||||||
|
NULL, /* ini_defaults */ \
|
||||||
|
0, /* phpinfo_as_text; */ \
|
||||||
|
NULL, /* ini_entries; */ \
|
||||||
|
NULL, /* additional_functions */ \
|
||||||
|
NULL /* input_filter_init */
|
||||||
|
|
||||||
#endif /* SAPI_H */
|
#endif /* SAPI_H */
|
||||||
|
|
||||||
|
@ -734,7 +734,7 @@ int fcgi_listen(const char *path, int backlog)
|
|||||||
#else
|
#else
|
||||||
int path_len = strlen(path);
|
int path_len = strlen(path);
|
||||||
|
|
||||||
if (path_len >= sizeof(sa.sa_unix.sun_path)) {
|
if (path_len >= (int)sizeof(sa.sa_unix.sun_path)) {
|
||||||
fcgi_log(FCGI_ERROR, "Listening socket's path name is too long.\n");
|
fcgi_log(FCGI_ERROR, "Listening socket's path name is too long.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1587,7 +1587,7 @@ int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int l
|
|||||||
}
|
}
|
||||||
memcpy(req->out_pos, str, len);
|
memcpy(req->out_pos, str, len);
|
||||||
req->out_pos += len;
|
req->out_pos += len;
|
||||||
} else if (len - limit < sizeof(req->out_buf) - sizeof(fcgi_header)) {
|
} else if (len - limit < (int)(sizeof(req->out_buf) - sizeof(fcgi_header))) {
|
||||||
if (!req->out_hdr) {
|
if (!req->out_hdr) {
|
||||||
open_packet(req, type);
|
open_packet(req, type);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define FCGI_HASH_FUNC(var, var_len) \
|
#define FCGI_HASH_FUNC(var, var_len) \
|
||||||
(UNEXPECTED(var_len < 3) ? var_len : \
|
(UNEXPECTED(var_len < 3) ? (unsigned int)var_len : \
|
||||||
(((unsigned int)var[3]) << 2) + \
|
(((unsigned int)var[3]) << 2) + \
|
||||||
(((unsigned int)var[var_len-2]) << 4) + \
|
(((unsigned int)var[var_len-2]) << 4) + \
|
||||||
(((unsigned int)var[var_len-1]) << 2) + \
|
(((unsigned int)var[var_len-1]) << 2) + \
|
||||||
|
@ -969,7 +969,7 @@ ZEND_END_ARG_INFO()
|
|||||||
|
|
||||||
static const zend_function_entry additional_functions[] = {
|
static const zend_function_entry additional_functions[] = {
|
||||||
ZEND_FE(dl, arginfo_dl)
|
ZEND_FE(dl, arginfo_dl)
|
||||||
{NULL, NULL, NULL}
|
PHP_FE_END
|
||||||
};
|
};
|
||||||
|
|
||||||
/* {{{ php_cgi_usage
|
/* {{{ php_cgi_usage
|
||||||
@ -1716,7 +1716,7 @@ const zend_function_entry cgi_functions[] = {
|
|||||||
PHP_FE(apache_request_headers, arginfo_no_args)
|
PHP_FE(apache_request_headers, arginfo_no_args)
|
||||||
PHP_FE(apache_response_headers, arginfo_no_args)
|
PHP_FE(apache_response_headers, arginfo_no_args)
|
||||||
PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args)
|
PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args)
|
||||||
{NULL, NULL, NULL}
|
PHP_FE_END
|
||||||
};
|
};
|
||||||
|
|
||||||
static zend_module_entry cgi_module_entry = {
|
static zend_module_entry cgi_module_entry = {
|
||||||
|
@ -271,11 +271,7 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, size_t str_length) /*
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cli_shell_callbacks.cli_shell_write) {
|
if (cli_shell_callbacks.cli_shell_write) {
|
||||||
size_t shell_wrote;
|
cli_shell_callbacks.cli_shell_write(str, str_length);
|
||||||
shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length);
|
|
||||||
if (shell_wrote > -1) {
|
|
||||||
return shell_wrote;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PHP_WRITE_STDOUT
|
#ifdef PHP_WRITE_STDOUT
|
||||||
@ -491,7 +487,7 @@ static const zend_function_entry additional_functions[] = {
|
|||||||
ZEND_FE(dl, arginfo_dl)
|
ZEND_FE(dl, arginfo_dl)
|
||||||
PHP_FE(cli_set_process_title, arginfo_cli_set_process_title)
|
PHP_FE(cli_set_process_title, arginfo_cli_set_process_title)
|
||||||
PHP_FE(cli_get_process_title, arginfo_cli_get_process_title)
|
PHP_FE(cli_get_process_title, arginfo_cli_get_process_title)
|
||||||
{NULL, NULL, NULL}
|
PHP_FE_END
|
||||||
};
|
};
|
||||||
|
|
||||||
/* {{{ php_cli_usage
|
/* {{{ php_cli_usage
|
||||||
|
@ -482,7 +482,7 @@ const zend_function_entry server_additional_functions[] = {
|
|||||||
PHP_FE(apache_request_headers, arginfo_no_args)
|
PHP_FE(apache_request_headers, arginfo_no_args)
|
||||||
PHP_FE(apache_response_headers, arginfo_no_args)
|
PHP_FE(apache_response_headers, arginfo_no_args)
|
||||||
PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args)
|
PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args)
|
||||||
{NULL, NULL, NULL}
|
PHP_FE_END
|
||||||
};
|
};
|
||||||
|
|
||||||
static int sapi_cli_server_startup(sapi_module_struct *sapi_module) /* {{{ */
|
static int sapi_cli_server_startup(sapi_module_struct *sapi_module) /* {{{ */
|
||||||
@ -1005,7 +1005,11 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen
|
|||||||
if (nbytes_sent < 0) {
|
if (nbytes_sent < 0) {
|
||||||
*nbytes_sent_total = _nbytes_sent_total;
|
*nbytes_sent_total = _nbytes_sent_total;
|
||||||
return php_socket_errno();
|
return php_socket_errno();
|
||||||
|
#ifdef PHP_WIN32
|
||||||
} else if (nbytes_sent == chunk->data.heap.len) {
|
} else if (nbytes_sent == chunk->data.heap.len) {
|
||||||
|
#else
|
||||||
|
} else if (nbytes_sent == (ssize_t)chunk->data.heap.len) {
|
||||||
|
#endif
|
||||||
php_cli_server_chunk_dtor(chunk);
|
php_cli_server_chunk_dtor(chunk);
|
||||||
pefree(chunk, 1);
|
pefree(chunk, 1);
|
||||||
sender->buffer.first = next;
|
sender->buffer.first = next;
|
||||||
@ -1028,7 +1032,11 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen
|
|||||||
if (nbytes_sent < 0) {
|
if (nbytes_sent < 0) {
|
||||||
*nbytes_sent_total = _nbytes_sent_total;
|
*nbytes_sent_total = _nbytes_sent_total;
|
||||||
return php_socket_errno();
|
return php_socket_errno();
|
||||||
|
#ifdef PHP_WIN32
|
||||||
} else if (nbytes_sent == chunk->data.immortal.len) {
|
} else if (nbytes_sent == chunk->data.immortal.len) {
|
||||||
|
#else
|
||||||
|
} else if (nbytes_sent == (ssize_t)chunk->data.immortal.len) {
|
||||||
|
#endif
|
||||||
php_cli_server_chunk_dtor(chunk);
|
php_cli_server_chunk_dtor(chunk);
|
||||||
pefree(chunk, 1);
|
pefree(chunk, 1);
|
||||||
sender->buffer.first = next;
|
sender->buffer.first = next;
|
||||||
@ -1705,7 +1713,7 @@ static int php_cli_server_client_read_request(php_cli_server_client *client, cha
|
|||||||
}
|
}
|
||||||
client->parser.data = client;
|
client->parser.data = client;
|
||||||
nbytes_consumed = php_http_parser_execute(&client->parser, &settings, buf, nbytes_read);
|
nbytes_consumed = php_http_parser_execute(&client->parser, &settings, buf, nbytes_read);
|
||||||
if (nbytes_consumed != nbytes_read) {
|
if (nbytes_consumed != (size_t)nbytes_read) {
|
||||||
if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) {
|
if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) {
|
||||||
*errstr = estrdup("Unsupported SSL request");
|
*errstr = estrdup("Unsupported SSL request");
|
||||||
} else {
|
} else {
|
||||||
|
@ -1539,7 +1539,7 @@ size_t php_http_parser_execute (php_http_parser *parser,
|
|||||||
p += to_read - 1;
|
p += to_read - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (to_read == parser->content_length) {
|
if (to_read == (size_t)parser->content_length) {
|
||||||
state = s_chunk_data_almost_done;
|
state = s_chunk_data_almost_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -857,7 +857,7 @@ static int fpm_conf_process_all_pools() /* {{{ */
|
|||||||
|
|
||||||
/* status */
|
/* status */
|
||||||
if (wp->config->pm_status_path && *wp->config->pm_status_path) {
|
if (wp->config->pm_status_path && *wp->config->pm_status_path) {
|
||||||
int i;
|
size_t i;
|
||||||
char *status = wp->config->pm_status_path;
|
char *status = wp->config->pm_status_path;
|
||||||
|
|
||||||
if (*status != '/') {
|
if (*status != '/') {
|
||||||
@ -881,7 +881,7 @@ static int fpm_conf_process_all_pools() /* {{{ */
|
|||||||
/* ping */
|
/* ping */
|
||||||
if (wp->config->ping_path && *wp->config->ping_path) {
|
if (wp->config->ping_path && *wp->config->ping_path) {
|
||||||
char *ping = wp->config->ping_path;
|
char *ping = wp->config->ping_path;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (*ping != '/') {
|
if (*ping != '/') {
|
||||||
zlog(ZLOG_ERROR, "[pool %s] the ping path '%s' must start with a '/'", wp->config->name, ping);
|
zlog(ZLOG_ERROR, "[pool %s] the ping path '%s' must start with a '/'", wp->config->name, ping);
|
||||||
@ -1254,7 +1254,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg) /* {{{ */
|
|||||||
#ifdef HAVE_GLOB
|
#ifdef HAVE_GLOB
|
||||||
glob_t g;
|
glob_t g;
|
||||||
#endif
|
#endif
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (!inc || !arg) return;
|
if (!inc || !arg) return;
|
||||||
if (*error) return; /* We got already an error. Switch to the end. */
|
if (*error) return; /* We got already an error. Switch to the end. */
|
||||||
|
@ -1549,7 +1549,7 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
|
|||||||
|
|
||||||
static const zend_function_entry cgi_fcgi_sapi_functions[] = {
|
static const zend_function_entry cgi_fcgi_sapi_functions[] = {
|
||||||
PHP_FE(fastcgi_finish_request, NULL)
|
PHP_FE(fastcgi_finish_request, NULL)
|
||||||
{NULL, NULL, NULL}
|
PHP_FE_END
|
||||||
};
|
};
|
||||||
|
|
||||||
static zend_module_entry cgi_module_entry = {
|
static zend_module_entry cgi_module_entry = {
|
||||||
|
@ -25,7 +25,7 @@ static float fpm_scoreboard_tick;
|
|||||||
int fpm_scoreboard_init_main() /* {{{ */
|
int fpm_scoreboard_init_main() /* {{{ */
|
||||||
{
|
{
|
||||||
struct fpm_worker_pool_s *wp;
|
struct fpm_worker_pool_s *wp;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
#ifdef HAVE_TIMES
|
#ifdef HAVE_TIMES
|
||||||
#if (defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK))
|
#if (defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK))
|
||||||
@ -173,7 +173,7 @@ struct fpm_scoreboard_proc_s *fpm_scoreboard_proc_get(struct fpm_scoreboard_s *s
|
|||||||
child_index = fpm_scoreboard_i;
|
child_index = fpm_scoreboard_i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (child_index < 0 || child_index >= scoreboard->nprocs) {
|
if (child_index < 0 || (unsigned int)child_index >= scoreboard->nprocs) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ void fpm_scoreboard_proc_release(struct fpm_scoreboard_proc_s *proc) /* {{{ */
|
|||||||
|
|
||||||
void fpm_scoreboard_free(struct fpm_scoreboard_s *scoreboard) /* {{{ */
|
void fpm_scoreboard_free(struct fpm_scoreboard_s *scoreboard) /* {{{ */
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (!scoreboard) {
|
if (!scoreboard) {
|
||||||
zlog(ZLOG_ERROR, "**scoreboard is NULL");
|
zlog(ZLOG_ERROR, "**scoreboard is NULL");
|
||||||
@ -270,7 +270,7 @@ void fpm_scoreboard_proc_free(struct fpm_scoreboard_s *scoreboard, int child_ind
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (child_index < 0 || child_index >= scoreboard->nprocs) {
|
if (child_index < 0 || (unsigned int)child_index >= scoreboard->nprocs) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ int fpm_scoreboard_proc_alloc(struct fpm_scoreboard_s *scoreboard, int *child_in
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* first try the slot which is supposed to be free */
|
/* first try the slot which is supposed to be free */
|
||||||
if (scoreboard->free_proc >= 0 && scoreboard->free_proc < scoreboard->nprocs) {
|
if (scoreboard->free_proc >= 0 && (unsigned int)scoreboard->free_proc < scoreboard->nprocs) {
|
||||||
if (scoreboard->procs[scoreboard->free_proc] && !scoreboard->procs[scoreboard->free_proc]->used) {
|
if (scoreboard->procs[scoreboard->free_proc] && !scoreboard->procs[scoreboard->free_proc]->used) {
|
||||||
i = scoreboard->free_proc;
|
i = scoreboard->free_proc;
|
||||||
}
|
}
|
||||||
@ -300,7 +300,7 @@ int fpm_scoreboard_proc_alloc(struct fpm_scoreboard_s *scoreboard, int *child_in
|
|||||||
|
|
||||||
if (i < 0) { /* the supposed free slot is not, let's search for a free slot */
|
if (i < 0) { /* the supposed free slot is not, let's search for a free slot */
|
||||||
zlog(ZLOG_DEBUG, "[pool %s] the proc->free_slot was not free. Let's search", scoreboard->pool);
|
zlog(ZLOG_DEBUG, "[pool %s] the proc->free_slot was not free. Let's search", scoreboard->pool);
|
||||||
for (i = 0; i < scoreboard->nprocs; i++) {
|
for (i = 0; i < (int)scoreboard->nprocs; i++) {
|
||||||
if (scoreboard->procs[i] && !scoreboard->procs[i]->used) { /* found */
|
if (scoreboard->procs[i] && !scoreboard->procs[i]->used) { /* found */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -308,7 +308,7 @@ int fpm_scoreboard_proc_alloc(struct fpm_scoreboard_s *scoreboard, int *child_in
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* no free slot */
|
/* no free slot */
|
||||||
if (i < 0 || i >= scoreboard->nprocs) {
|
if (i < 0 || i >= (int)scoreboard->nprocs) {
|
||||||
zlog(ZLOG_ERROR, "[pool %s] no free scoreboard slot", scoreboard->pool);
|
zlog(ZLOG_ERROR, "[pool %s] no free scoreboard slot", scoreboard->pool);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -317,7 +317,7 @@ int fpm_scoreboard_proc_alloc(struct fpm_scoreboard_s *scoreboard, int *child_in
|
|||||||
*child_index = i;
|
*child_index = i;
|
||||||
|
|
||||||
/* supposed next slot is free */
|
/* supposed next slot is free */
|
||||||
if (i + 1 >= scoreboard->nprocs) {
|
if (i + 1 >= (int)scoreboard->nprocs) {
|
||||||
scoreboard->free_proc = 0;
|
scoreboard->free_proc = 0;
|
||||||
} else {
|
} else {
|
||||||
scoreboard->free_proc = i + 1;
|
scoreboard->free_proc = i + 1;
|
||||||
|
@ -386,7 +386,8 @@ int fpm_status_handle_request(void) /* {{{ */
|
|||||||
|
|
||||||
/* no need to test the var 'full' */
|
/* no need to test the var 'full' */
|
||||||
if (full_syntax) {
|
if (full_syntax) {
|
||||||
int i, first;
|
unsigned int i;
|
||||||
|
int first;
|
||||||
zend_string *tmp_query_string;
|
zend_string *tmp_query_string;
|
||||||
char *query_string;
|
char *query_string;
|
||||||
struct timeval duration, now;
|
struct timeval duration, now;
|
||||||
|
@ -442,13 +442,8 @@ static sapi_module_struct lsapi_sapi_module =
|
|||||||
|
|
||||||
sapi_lsapi_register_variables, /* register server variables */
|
sapi_lsapi_register_variables, /* register server variables */
|
||||||
sapi_lsapi_log_message, /* Log message */
|
sapi_lsapi_log_message, /* Log message */
|
||||||
|
NULL, /* Get request time */
|
||||||
NULL, /* php.ini path override */
|
NULL, /* Child terminate */
|
||||||
NULL, /* default post reader */
|
|
||||||
NULL, /* treat data */
|
|
||||||
NULL, /* executable location */
|
|
||||||
|
|
||||||
0, /* php.ini ignore */
|
|
||||||
|
|
||||||
STANDARD_SAPI_MODULE_PROPERTIES
|
STANDARD_SAPI_MODULE_PROPERTIES
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user