From 5fa1cd224b3801a99790f367feca4d98b53771b7 Mon Sep 17 00:00:00 2001 From: Richard Fussenegger Date: Mon, 29 May 2017 21:42:59 +0200 Subject: Fixed php_socket_t to int conversion This warning was about a possible loss of data due to the downcast of `php_socket_t` to `int`. The former maps to a platform specific type, hence, it might downcast from a 64 bit integer to a 32 bit intger. Fixed possibly overflowing vars Due to the change from `int` to `php_socket_t` some variables might overflow now. Changed all variables that might be affected. Revert "Fixed possibly overflowing vars" This reverts commit bf64fd5984409a208ef32108990a6085b6556273. Use aliased PHP socket type Using the alias protects us from changes to the underlying type. Removed ignored nfds argument The `nfds` argument to the Win32 `select` function is always ignored, regardless of its actual value. Hence, we should not pass it in the first place. See https://msdn.microsoft.com/en-us/library/windows/desktop/ms740141(v=vs.85).aspx for reference. Target value is not a pointer Avoid overflow in loop --- sapi/cli/php_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 0ff8b4103f..07e8a8c803 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -248,7 +248,7 @@ static void print_extensions(void) /* {{{ */ #define STDERR_FILENO 2 #endif -static inline int sapi_cli_select(int fd) +static inline int sapi_cli_select(php_socket_t fd) { fd_set wfd, dfd; struct timeval tv; -- cgit v1.2.1