From: David Carlier Date: Sat, 9 Dec 2017 10:37:41 +0000 (+0000) Subject: Fix some format specificers X-Git-Tag: php-7.3.0alpha1~789 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e251d9a6b2534e84248f31a23154c0721b7fba5a;p=php Fix some format specificers time_t is of 64 bits type on some systems as well. --- diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index d765787a3c..be15192148 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -840,7 +840,7 @@ static inline int accel_is_inactive(void) if (ZCG(accel_directives).force_restart_timeout && ZCSG(force_restart_time) && time(NULL) >= ZCSG(force_restart_time)) { - zend_accel_error(ACCEL_LOG_WARNING, "Forced restart at %ld (after " ZEND_LONG_FMT " seconds), locked by %d", time(NULL), ZCG(accel_directives).force_restart_timeout, mem_usage_check.l_pid); + zend_accel_error(ACCEL_LOG_WARNING, "Forced restart at %ld (after " ZEND_LONG_FMT " seconds), locked by %d", (long)time(NULL), ZCG(accel_directives).force_restart_timeout, mem_usage_check.l_pid); kill_all_lockers(&mem_usage_check); return FAILURE; /* next request should be able to restart it */ diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index aa627f028b..de3e4c9ec0 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -487,14 +487,14 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS) php_info_print_table_row(2, "Cache misses", buf); snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZCG(accel_directives).memory_consumption-zend_shared_alloc_get_free_memory()-ZSMMG(wasted_shared_memory)); php_info_print_table_row(2, "Used memory", buf); - snprintf(buf, sizeof(buf), ZEND_LONG_FMT, zend_shared_alloc_get_free_memory()); + snprintf(buf, sizeof(buf), "%zu", zend_shared_alloc_get_free_memory()); php_info_print_table_row(2, "Free memory", buf); - snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ZSMMG(wasted_shared_memory)); + snprintf(buf, sizeof(buf), "%zu", ZSMMG(wasted_shared_memory)); php_info_print_table_row(2, "Wasted memory", buf); if (ZCSG(interned_strings).start && ZCSG(interned_strings).end) { - snprintf(buf, sizeof(buf), ZEND_LONG_FMT, (char*)ZCSG(interned_strings).top - (char*)ZCSG(interned_strings).start); + snprintf(buf, sizeof(buf), "%zu", (size_t)((char*)ZCSG(interned_strings).top - (char*)ZCSG(interned_strings).start)); php_info_print_table_row(2, "Interned Strings Used memory", buf); - snprintf(buf, sizeof(buf), ZEND_LONG_FMT, (char*)ZCSG(interned_strings).end - (char*)ZCSG(interned_strings).top); + snprintf(buf, sizeof(buf), "%zu", (size_t)((char*)ZCSG(interned_strings).end - (char*)ZCSG(interned_strings).top)); php_info_print_table_row(2, "Interned Strings Free memory", buf); } snprintf(buf, sizeof(buf), "%d", ZCSG(hash).num_direct_entries); diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index aa63a6e42e..94d3a5cd9d 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -82,7 +82,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode) } else { char ret[100]; - snprintf(ret, 100, "%.8F %ld", tp.tv_usec / MICRO_IN_SEC, tp.tv_sec); + snprintf(ret, 100, "%.8F %ld", tp.tv_usec / MICRO_IN_SEC, (long)tp.tv_sec); RETURN_STRING(ret); } }