com php-src: Fix some format specificers: ext/opcache/ZendAccelerator.c ext/opcache/zend_accelerator_module.c ext/standard/micr otime.c

From: Date: Sat, 16 Dec 2017 14:27:32 +0000
Subject: com php-src: Fix some format specificers: ext/opcache/ZendAccelerator.c ext/opcache/zend_accelerator_module.c ext/standard/micr otime.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-100608@lists.php.net to get a copy of this message
Commit: e251d9a6b2534e84248f31a23154c0721b7fba5a Author: David Carlier <devnexen@gmail.com> Sat, 9 Dec 2017 10:37:41 +0000 Committer: Nikita Popov <nikita.ppv@gmail.com> Sat, 16 Dec 2017 15:27:32 +0100 Parents: 5142a06506dd29896f4e3011f0c6c10f12bf6960 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e251d9a6b2534e84248f31a23154c0721b7fba5a Log: Fix some format specificers time_t is of 64 bits type on some systems as well. Changed paths: M ext/opcache/ZendAccelerator.c M ext/opcache/zend_accelerator_module.c M ext/standard/microtime.c Diff: diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index d765787...be15192 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 aa627f0..de3e4c9 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 aa63a6e..94d3a5c 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); } }

« previous php.cvs (#100608) next »