From: GITSRC <34047788+gitsrc@users.noreply.github.com> Date: Fri, 20 Dec 2019 14:15:15 +0000 (+0100) Subject: Simplify constant expression X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=269f44f682ad70957be3f761f7cdd2e92a539488;p=php Simplify constant expression Co-Authored-By: Christoph M. Becker --- diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index f2514d16d2..324bb27065 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -214,9 +214,8 @@ static int php_disk_free_space(char *path, double *space) /* {{{ */ PHP_WIN32_IOUTIL_CLEANUP_W() return FAILURE; } - - /* i know - this is ugly, but i works */ - *space = FreeBytesAvailableToCaller.HighPart * (double) (((zend_ulong)1) << 31) * 2.0 + FreeBytesAvailableToCaller.LowPart; + + *space = FreeBytesAvailableToCaller.HighPart * (double) (1ULL << 32) + FreeBytesAvailableToCaller.LowPart; PHP_WIN32_IOUTIL_CLEANUP_W()