diff options
-rw-r--r-- | Zend/zend_alloc.h | 10 | ||||
-rw-r--r-- | Zend/zend_execute.c | 8 | ||||
-rw-r--r-- | azure/i386/job.yml | 1 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_alloc.c | 151 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_connection.c | 2 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_portability.h | 59 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_ps_codec.c | 6 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_result.c | 2 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_statistics.c | 2 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_wireprotocol.c | 2 | ||||
-rw-r--r-- | ext/sockets/conversions.c | 5 | ||||
-rw-r--r-- | ext/standard/file.c | 4 | ||||
-rw-r--r-- | ext/standard/html.c | 41 | ||||
-rw-r--r-- | ext/xmlrpc/libxmlrpc/xmlrpc.c | 4 | ||||
-rw-r--r-- | ext/xmlrpc/xmlrpc-epi-php.c | 2 | ||||
-rw-r--r-- | main/snprintf.c | 6 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_env.c | 6 |
17 files changed, 93 insertions, 218 deletions
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index 075aac6561..c5838f2ac6 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -27,21 +27,21 @@ #include "zend.h" #ifndef ZEND_MM_ALIGNMENT -# define ZEND_MM_ALIGNMENT Z_L(8) +# define ZEND_MM_ALIGNMENT ((size_t) 8) # define ZEND_MM_ALIGNMENT_LOG2 Z_L(3) #elif ZEND_MM_ALIGNMENT < 4 # undef ZEND_MM_ALIGNMENT # undef ZEND_MM_ALIGNMENT_LOG2 -# define ZEND_MM_ALIGNMENT Z_L(4) +# define ZEND_MM_ALIGNMENT ((size_t) 4) # define ZEND_MM_ALIGNMENT_LOG2 Z_L(2) #endif -#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT - Z_L(1)) +#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT - 1) -#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - Z_L(1)) & ZEND_MM_ALIGNMENT_MASK) +#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK) #define ZEND_MM_ALIGNED_SIZE_EX(size, alignment) \ - (((size) + ((alignment) - Z_L(1))) & ~((alignment) - Z_L(1))) + (((size) + ((alignment) - 1)) & ~((alignment) - 1)) typedef struct _zend_leak_info { void *addr; diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index cd7f15ab51..3a5f2ea601 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -466,7 +466,7 @@ static zend_always_inline zval *_get_zval_ptr_deref(int op_type, znode_op node, } } -static zend_always_inline zval *_get_op_data_zval_ptr_deref_r(int op_type, znode_op node, zend_free_op *should_free EXECUTE_DATA_DC OPLINE_DC) +static zend_always_inline ZEND_ATTRIBUTE_UNUSED zval *_get_op_data_zval_ptr_deref_r(int op_type, znode_op node, zend_free_op *should_free EXECUTE_DATA_DC OPLINE_DC) { if (op_type & (IS_TMP_VAR|IS_VAR)) { if (op_type == IS_TMP_VAR) { @@ -532,7 +532,7 @@ static inline zval *_get_zval_ptr_ptr(int op_type, znode_op node, zend_free_op * } } -static inline zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC) +static inline ZEND_ATTRIBUTE_UNUSED zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC) { if (op_type == IS_UNUSED) { *should_free = NULL; @@ -541,7 +541,7 @@ static inline zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_free_op *sh return get_zval_ptr(op_type, op, should_free, type); } -static inline zval *_get_obj_zval_ptr_undef(int op_type, znode_op op, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC) +static inline ZEND_ATTRIBUTE_UNUSED zval *_get_obj_zval_ptr_undef(int op_type, znode_op op, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC) { if (op_type == IS_UNUSED) { *should_free = NULL; @@ -550,7 +550,7 @@ static inline zval *_get_obj_zval_ptr_undef(int op_type, znode_op op, zend_free_ return get_zval_ptr_undef(op_type, op, should_free, type); } -static inline zval *_get_obj_zval_ptr_ptr(int op_type, znode_op node, zend_free_op *should_free, int type EXECUTE_DATA_DC) +static inline ZEND_ATTRIBUTE_UNUSED zval *_get_obj_zval_ptr_ptr(int op_type, znode_op node, zend_free_op *should_free, int type EXECUTE_DATA_DC) { if (op_type == IS_UNUSED) { *should_free = NULL; diff --git a/azure/i386/job.yml b/azure/i386/job.yml index 4acf58c74f..d6138a8e87 100644 --- a/azure/i386/job.yml +++ b/azure/i386/job.yml @@ -60,6 +60,7 @@ jobs: --enable-sysvmsg \ --with-ffi \ --enable-zend-test \ + --enable-werror \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d displayName: 'Configure Build' diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c index 980dd07484..a1471dd557 100644 --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@ -82,26 +82,22 @@ static void * _mysqlnd_emalloc(size_t size MYSQLND_MEM_D) zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics); #if PHP_DEBUG zend_long * threshold = &MYSQLND_G(debug_emalloc_fail_threshold); -#endif TRACE_ALLOC_ENTER(mysqlnd_emalloc_name); -#if PHP_DEBUG { char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); } -#endif -#if PHP_DEBUG - /* -1 is also "true" */ - if (*threshold) { -#endif + if (*threshold == 0) { + ret = NULL; + } else { ret = emalloc_rel(REAL_SIZE(size)); -#if PHP_DEBUG --*threshold; - } else if (*threshold == 0) { - ret = NULL; } +#else + TRACE_ALLOC_ENTER(mysqlnd_emalloc_name); + ret = emalloc_rel(REAL_SIZE(size)); #endif TRACE_ALLOC_INF_FMT("size=%lu ptr=%p", size, ret); @@ -122,26 +118,22 @@ static void * _mysqlnd_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D) zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics); #if PHP_DEBUG zend_long * threshold = persistent? &MYSQLND_G(debug_malloc_fail_threshold):&MYSQLND_G(debug_emalloc_fail_threshold); -#endif TRACE_ALLOC_ENTER(mysqlnd_pemalloc_name); -#if PHP_DEBUG { char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); } -#endif -#if PHP_DEBUG - /* -1 is also "true" */ - if (*threshold) { -#endif + if (*threshold == 0) { + ret = NULL; + } else { ret = pemalloc_rel(REAL_SIZE(size), persistent); -#if PHP_DEBUG --*threshold; - } else if (*threshold == 0) { - ret = NULL; } +#else + TRACE_ALLOC_ENTER(mysqlnd_pemalloc_name); + ret = pemalloc_rel(REAL_SIZE(size), persistent); #endif TRACE_ALLOC_INF_FMT("size=%lu ptr=%p persistent=%u", size, ret, persistent); @@ -163,29 +155,26 @@ static void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D) { void *ret; zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics); -#if PHP_DEBUG zend_long * threshold = &MYSQLND_G(debug_ecalloc_fail_threshold); -#endif +#if PHP_DEBUG TRACE_ALLOC_ENTER(mysqlnd_ecalloc_name); -#if PHP_DEBUG { char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); } -#endif TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE)); -#if PHP_DEBUG - /* -1 is also "true" */ - if (*threshold) { -#endif + if (*threshold == 0) { + ret = NULL; + } else { ret = ecalloc_rel(nmemb, REAL_SIZE(size)); -#if PHP_DEBUG --*threshold; - } else if (*threshold == 0) { - ret = NULL; } +#else + TRACE_ALLOC_ENTER(mysqlnd_ecalloc_name); + TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(FALSE)); + ret = ecalloc_rel(nmemb, REAL_SIZE(size)); #endif TRACE_ALLOC_INF_FMT("after : %lu", zend_memory_usage(FALSE)); @@ -206,25 +195,21 @@ static void * _mysqlnd_pecalloc(unsigned int nmemb, size_t size, zend_bool persi zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics); #if PHP_DEBUG zend_long * threshold = persistent? &MYSQLND_G(debug_calloc_fail_threshold):&MYSQLND_G(debug_ecalloc_fail_threshold); -#endif TRACE_ALLOC_ENTER(mysqlnd_pecalloc_name); -#if PHP_DEBUG { char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); } -#endif -#if PHP_DEBUG - /* -1 is also "true" */ - if (*threshold) { -#endif + if (*threshold == 0) { + ret = NULL; + } else { ret = pecalloc_rel(nmemb, REAL_SIZE(size), persistent); -#if PHP_DEBUG --*threshold; - } else if (*threshold == 0) { - ret = NULL; } +#else + TRACE_ALLOC_ENTER(mysqlnd_pecalloc_name); + ret = pecalloc_rel(nmemb, REAL_SIZE(size), persistent); #endif TRACE_ALLOC_INF_FMT("size=%lu ptr=%p", size, ret); @@ -249,27 +234,24 @@ static void * _mysqlnd_erealloc(void *ptr, size_t new_size MYSQLND_MEM_D) size_t old_size = collect_memory_statistics && ptr? *(size_t *) (((char*)ptr) - sizeof(size_t)) : 0; #if PHP_DEBUG zend_long * threshold = &MYSQLND_G(debug_erealloc_fail_threshold); -#endif TRACE_ALLOC_ENTER(mysqlnd_erealloc_name); -#if PHP_DEBUG { char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); } -#endif TRACE_ALLOC_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size, new_size); -#if PHP_DEBUG - /* -1 is also "true" */ - if (*threshold) { -#endif + if (*threshold == 0) { + ret = NULL; + } else { ret = erealloc_rel(REAL_PTR(ptr), REAL_SIZE(new_size)); -#if PHP_DEBUG --*threshold; - } else if (*threshold == 0) { - ret = NULL; } +#else + TRACE_ALLOC_ENTER(mysqlnd_erealloc_name); + TRACE_ALLOC_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size, new_size); + ret = erealloc_rel(REAL_PTR(ptr), REAL_SIZE(new_size)); #endif TRACE_ALLOC_INF_FMT("new_ptr=%p", (char*)ret); @@ -290,27 +272,24 @@ static void * _mysqlnd_perealloc(void *ptr, size_t new_size, zend_bool persisten size_t old_size = collect_memory_statistics && ptr? *(size_t *) (((char*)ptr) - sizeof(size_t)) : 0; #if PHP_DEBUG zend_long * threshold = persistent? &MYSQLND_G(debug_realloc_fail_threshold):&MYSQLND_G(debug_erealloc_fail_threshold); -#endif TRACE_ALLOC_ENTER(mysqlnd_perealloc_name); -#if PHP_DEBUG { char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); } -#endif TRACE_ALLOC_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr, old_size, new_size, persistent); -#if PHP_DEBUG - /* -1 is also "true" */ - if (*threshold) { -#endif + if (*threshold == 0) { + ret = NULL; + } else { ret = perealloc_rel(REAL_PTR(ptr), REAL_SIZE(new_size), persistent); -#if PHP_DEBUG --*threshold; - } else if (*threshold == 0) { - ret = NULL; } +#else + TRACE_ALLOC_ENTER(mysqlnd_perealloc_name); + TRACE_ALLOC_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr, old_size, new_size, persistent); + ret = perealloc_rel(REAL_PTR(ptr), REAL_SIZE(new_size), persistent); #endif TRACE_ALLOC_INF_FMT("new_ptr=%p", (char*)ret); @@ -396,26 +375,22 @@ static void * _mysqlnd_malloc(size_t size MYSQLND_MEM_D) zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics); #if PHP_DEBUG zend_long * threshold = &MYSQLND_G(debug_malloc_fail_threshold); -#endif TRACE_ALLOC_ENTER(mysqlnd_malloc_name); -#if PHP_DEBUG { char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); } -#endif -#if PHP_DEBUG - /* -1 is also "true" */ - if (*threshold) { -#endif + if (*threshold == 0) { + ret = NULL; + } else { ret = malloc(REAL_SIZE(size)); -#if PHP_DEBUG --*threshold; - } else if (*threshold == 0) { - ret = NULL; } +#else + TRACE_ALLOC_ENTER(mysqlnd_malloc_name); + ret = malloc(REAL_SIZE(size)); #endif TRACE_ALLOC_INF_FMT("size=%lu ptr=%p", size, ret); @@ -435,26 +410,22 @@ static void * _mysqlnd_calloc(unsigned int nmemb, size_t size MYSQLND_MEM_D) zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics); #if PHP_DEBUG zend_long * threshold = &MYSQLND_G(debug_calloc_fail_threshold); -#endif TRACE_ALLOC_ENTER(mysqlnd_calloc_name); -#if PHP_DEBUG { char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); } -#endif -#if PHP_DEBUG - /* -1 is also "true" */ - if (*threshold) { -#endif + if (*threshold == 0) { + ret = NULL; + } else { ret = calloc(nmemb, REAL_SIZE(size)); -#if PHP_DEBUG --*threshold; - } else if (*threshold == 0) { - ret = NULL; } +#else + TRACE_ALLOC_ENTER(mysqlnd_calloc_name); + ret = calloc(nmemb, REAL_SIZE(size)); #endif TRACE_ALLOC_INF_FMT("size=%lu ptr=%p", size, ret); @@ -474,28 +445,26 @@ static void * _mysqlnd_realloc(void *ptr, size_t new_size MYSQLND_MEM_D) zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics); #if PHP_DEBUG zend_long * threshold = &MYSQLND_G(debug_realloc_fail_threshold); -#endif TRACE_ALLOC_ENTER(mysqlnd_realloc_name); -#if PHP_DEBUG { char * fn = strrchr(__zend_filename, PHP_DIR_SEPARATOR); TRACE_ALLOC_INF_FMT("file=%-15s line=%4d", fn? fn + 1:__zend_filename, __zend_lineno); } -#endif TRACE_ALLOC_INF_FMT("ptr=%p new_size=%lu ", new_size, ptr); TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(TRUE)); -#if PHP_DEBUG - /* -1 is also "true" */ - if (*threshold) { -#endif + if (*threshold == 0) { + ret = NULL; + } else { ret = realloc(REAL_PTR(ptr), REAL_SIZE(new_size)); -#if PHP_DEBUG --*threshold; - } else if (*threshold == 0) { - ret = NULL; } +#else + TRACE_ALLOC_ENTER(mysqlnd_realloc_name); + TRACE_ALLOC_INF_FMT("ptr=%p new_size=%lu ", new_size, ptr); + TRACE_ALLOC_INF_FMT("before: %lu", zend_memory_usage(TRUE)); + ret = realloc(REAL_PTR(ptr), REAL_SIZE(new_size)); #endif TRACE_ALLOC_INF_FMT("new_ptr=%p", (char*)ret); diff --git a/ext/mysqlnd/mysqlnd_connection.c b/ext/mysqlnd/mysqlnd_connection.c index 6075f09bb5..b285c9bd52 100644 --- a/ext/mysqlnd/mysqlnd_connection.c +++ b/ext/mysqlnd/mysqlnd_connection.c @@ -791,7 +791,7 @@ err: DBG_ERR_FMT("[%u] %.128s (trying to connect via %s)", conn->error_info->error_no, conn->error_info->error, conn->scheme.s); if (!conn->error_info->error_no) { - SET_CLIENT_ERROR(conn->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, conn->error_info->error? conn->error_info->error:"Unknown error"); + SET_CLIENT_ERROR(conn->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, conn->error_info->error); php_error_docref(NULL, E_WARNING, "[%u] %.128s (trying to connect via %s)", conn->error_info->error_no, conn->error_info->error, conn->scheme.s); } diff --git a/ext/mysqlnd/mysqlnd_portability.h b/ext/mysqlnd/mysqlnd_portability.h index 7736ae9fa8..622e31dcd4 100644 --- a/ext/mysqlnd/mysqlnd_portability.h +++ b/ext/mysqlnd/mysqlnd_portability.h @@ -56,71 +56,12 @@ This file is public domain and comes with NO WARRANTY of any kind */ #endif #ifdef PHP_WIN32 -#define MYSQLND_LLU_SPEC "%I64u" -#define MYSQLND_LL_SPEC "%I64d" #define MYSQLND_SZ_T_SPEC "%Id" #ifndef L64 #define L64(x) x##i64 #endif #else -#if __i386__ -#define MYSQLND_LL_SPEC "%lli" -#define MYSQLND_LLU_SPEC "%llu" -#endif - -#if __ia64__ -#define MYSQLND_LL_SPEC "%li" -#define MYSQLND_LLU_SPEC "%lu" -#endif - -#if __powerpc64__ || __ppc64__ -#define MYSQLND_LL_SPEC "%li" -#define MYSQLND_LLU_SPEC "%lu" -#endif - -#if (__powerpc__ || __ppc__ ) && !(__powerpc64__ || __ppc64__) -#define MYSQLND_LL_SPEC "%lli" -#define MYSQLND_LLU_SPEC "%llu" -#endif - -#if __x86_64__ -#define MYSQLND_LL_SPEC "%li" -#define MYSQLND_LLU_SPEC "%lu" -#endif - -#if __s390x__ -#define MYSQLND_LL_SPEC "%li" -#define MYSQLND_LLU_SPEC "%lu" -#endif - -#if __s390__ && !__s390x__ -#define MYSQLND_LL_SPEC "%lli" -#define MYSQLND_LLU_SPEC "%llu" -#endif - -#ifdef _AIX -#define MYSQLND_LL_SPEC "%lli" -#define MYSQLND_LLU_SPEC "%llu" -#endif - -#ifndef MYSQLND_LL_SPEC - #if SIZEOF_LONG == 8 - #define MYSQLND_LL_SPEC "%li" - #elif SIZEOF_LONG == 4 - #define MYSQLND_LL_SPEC "%lli" - #endif -#endif - -#ifndef MYSQLND_LLU_SPEC - #if SIZEOF_LONG == 8 - #define MYSQLND_LLU_SPEC "%lu" - #elif SIZEOF_LONG == 4 - #define MYSQLND_LLU_SPEC "%llu" - #endif -#endif /* MYSQLND_LLU_SPEC*/ - - #define MYSQLND_SZ_T_SPEC "%zd" #ifndef L64 #define L64(x) x##LL diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index 940bcf7ec3..12edd9a284 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -79,7 +79,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, const u #if SIZEOF_ZEND_LONG==4 if (uval > INT_MAX) { DBG_INF("stringify"); - tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval); + tmp_len = sprintf((char *)&tmp, "%" PRIu64, uval); } else #endif /* #if SIZEOF_LONG==4 */ { @@ -87,7 +87,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, const u ZVAL_LONG(zv, (zend_long) uval); /* the cast is safe, we are in the range */ } else { DBG_INF("stringify"); - tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval); + tmp_len = sprintf((char *)&tmp, "%" PRIu64, uval); DBG_INF_FMT("value=%s", tmp); } } @@ -109,7 +109,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, const u #if SIZEOF_ZEND_LONG==4 if ((L64(2147483647) < (int64_t) lval) || (L64(-2147483648) > (int64_t) lval)) { DBG_INF("stringify"); - tmp_len = sprintf((char *)&tmp, MYSQLND_LL_SPEC, lval); + tmp_len = sprintf((char *)&tmp, "%" PRIi64, lval); } else #endif /* SIZEOF */ { diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 5c6eeddd0b..0aa69a0d61 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -246,7 +246,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * cons { DBG_ENTER("mysqlnd_result_buffered::free_result"); - DBG_INF_FMT("Freeing "MYSQLND_LLU_SPEC" row(s)", set->row_count); + DBG_INF_FMT("Freeing "PRIu64" row(s)", set->row_count); mysqlnd_error_info_free_contents(&set->error_info); diff --git a/ext/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c index 6103f7f93b..2058441254 100644 --- a/ext/mysqlnd/mysqlnd_statistics.c +++ b/ext/mysqlnd/mysqlnd_statistics.c @@ -205,7 +205,7 @@ mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING for (i = 0; i < stats->count; i++) { char tmp[25]; - sprintf((char *)&tmp, MYSQLND_LLU_SPEC, stats->values[i]); + sprintf((char *)&tmp, "%" PRIu64, stats->values[i]); add_assoc_string_ex(return_value, names[i].s, names[i].l, tmp); } } diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index b56a92c152..6ef48a4a7d 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1661,7 +1661,7 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_ROW_BUFFER * row_buffer, zval * if (Z_TYPE_P(current_field) == IS_LONG && !as_int_or_float) { /* we are using the text protocol, so convert to string */ char tmp[22]; - const size_t tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, (uint64_t) Z_LVAL_P(current_field)); + const size_t tmp_len = sprintf((char *)&tmp, ZEND_ULONG_FMT, Z_LVAL_P(current_field)); ZVAL_STRINGL(current_field, tmp, tmp_len); } else if (Z_TYPE_P(current_field) == IS_STRING) { /* nothing to do here, as we want a string and ps_fetch_from_1_to_8_bytes() has given us one */ diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index f24e0926ce..7a1a4bb6bc 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -441,6 +441,8 @@ static void from_zval_write_sa_family(const zval *arr_value, char *field, ser_co ival = (sa_family_t)lval; memcpy(field, &ival, sizeof(ival)); } + +#ifdef SO_PASSCRED static void from_zval_write_pid_t(const zval *arr_value, char *field, ser_context *ctx) { zend_long lval; @@ -488,6 +490,7 @@ static void from_zval_write_uid_t(const zval *arr_value, char *field, ser_contex ival = (uid_t)lval; memcpy(field, &ival, sizeof(ival)); } +#endif void to_zval_read_int(const char *data, zval *zv, res_context *ctx) { @@ -524,6 +527,7 @@ static void to_zval_read_sa_family(const char *data, zval *zv, res_context *ctx) ZVAL_LONG(zv, (zend_long)ival); } +#ifdef SO_PASSCRED static void to_zval_read_pid_t(const char *data, zval *zv, res_context *ctx) { pid_t ival; @@ -538,6 +542,7 @@ static void to_zval_read_uid_t(const char *data, zval *zv, res_context *ctx) ZVAL_LONG(zv, (zend_long)ival); } +#endif /* CONVERSIONS for sockaddr */ static void from_zval_write_sin_addr(const zval *zaddr_str, char *inaddr, ser_context *ctx) diff --git a/ext/standard/file.c b/ext/standard/file.c index 32f21fbb0a..cf11faea91 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -661,7 +661,7 @@ PHP_FUNCTION(file_put_contents) if (Z_STRLEN_P(data)) { numbytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data)); if (numbytes != Z_STRLEN_P(data)) { - php_error_docref(NULL, E_WARNING, "Only "ZEND_LONG_FMT" of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data)); + php_error_docref(NULL, E_WARNING, "Only %zd of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data)); numbytes = -1; } } @@ -697,7 +697,7 @@ PHP_FUNCTION(file_put_contents) if (zend_std_cast_object_tostring(Z_OBJ_P(data), &out, IS_STRING) == SUCCESS) { numbytes = php_stream_write(stream, Z_STRVAL(out), Z_STRLEN(out)); if (numbytes != Z_STRLEN(out)) { - php_error_docref(NULL, E_WARNING, "Only "ZEND_LONG_FMT" of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN(out)); + php_error_docref(NULL, E_WARNING, "Only %zd of %zd bytes written, possibly out of free disk space", numbytes, Z_STRLEN(out)); numbytes = -1; } zval_ptr_dtor_str(&out); diff --git a/ext/standard/html.c b/ext/standard/html.c index 0cdfca6d85..0de4679788 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -494,47 +494,6 @@ static inline size_t php_utf32_utf8(unsigned char *buf, unsigned k) } /* }}} */ -/* {{{ php_mb2_int_to_char - * Convert back big endian int representation of sequence of one or two 8-bit code units. */ -static inline size_t php_mb2_int_to_char(unsigned char *buf, unsigned k) -{ - assert(k <= 0xFFFFU); - /* one or two bytes */ - if (k <= 0xFFU) { /* 1 */ - buf[0] = k; - return 1U; - } else { /* 2 */ - buf[0] = k >> 8; - buf[1] = k & 0xFFU; - return 2U; - } -} -/* }}} */ - -/* {{{ php_mb3_int_to_char - * Convert back big endian int representation of sequence of one to three 8-bit code units. - * For EUC-JP. */ -static inline size_t php_mb3_int_to_char(unsigned char *buf, unsigned k) -{ - assert(k <= 0xFFFFFFU); - /* one to three bytes */ - if (k <= 0xFFU) { /* 1 */ - buf[0] = k; - return 1U; - } else if (k <= 0xFFFFU) { /* 2 */ - buf[0] = k >> 8; - buf[1] = k & 0xFFU; - return 2U; - } else { - buf[0] = k >> 16; - buf[1] = (k >> 8) & 0xFFU; - buf[2] = k & 0xFFU; - return 3U; - } -} -/* }}} */ - - /* {{{ unimap_bsearc_cmp * Binary search of unicode code points in unicode <--> charset mapping. * Returns the code point in the target charset (whose mapping table was given) or 0 if diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c index 07fec0c698..3d6460be76 100644 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.c +++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c @@ -2242,7 +2242,7 @@ XMLRPC_VALUE_TYPE XMLRPC_GetValueType(XMLRPC_VALUE value) { * SOURCE */ XMLRPC_VECTOR_TYPE XMLRPC_GetVectorType(XMLRPC_VALUE value) { - return(value && value->v) ? value->v->type : xmlrpc_none; + return(value && value->v) ? value->v->type : xmlrpc_vector_none; } /*******/ @@ -2286,7 +2286,7 @@ XMLRPC_VALUE_TYPE_EASY XMLRPC_GetValueTypeEasy (XMLRPC_VALUE value) { return(XMLRPC_VALUE_TYPE_EASY) value->type; } } - return xmlrpc_none; + return xmlrpc_type_none; } /*******/ diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index 51dc647b19..64ae65eec8 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -1267,7 +1267,7 @@ XMLRPC_VECTOR_TYPE xmlrpc_str_as_vector_type(const char* str) /* {{{ */ } } } - return xmlrpc_none; + return xmlrpc_vector_none; } /* }}} */ diff --git a/main/snprintf.c b/main/snprintf.c index e3e0993ab5..61a5dfffce 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -568,7 +568,7 @@ typedef struct buf_area buffy; INS_CHAR( ch, sp, bep, cc ) ; \ width-- ; \ } \ - while ( width > len ) + while ( (size_t)width > len ) /* * Prefix the character ch to the string str @@ -1188,7 +1188,7 @@ fmt_error: s_len--; min_width--; } - PAD((size_t)min_width, s_len, pad_char); + PAD(min_width, s_len, pad_char); } /* * Print the string s. @@ -1199,7 +1199,7 @@ fmt_error: } if (adjust_width && adjust == LEFT && (size_t)min_width > s_len) - PAD((size_t)min_width, s_len, pad_char); + PAD(min_width, s_len, pad_char); if (free_zcopy) { zval_ptr_dtor_str(&zcopy); } diff --git a/sapi/fpm/fpm/fpm_env.c b/sapi/fpm/fpm/fpm_env.c index ef7c980efb..9931ab480c 100644 --- a/sapi/fpm/fpm/fpm_env.c +++ b/sapi/fpm/fpm/fpm_env.c @@ -199,9 +199,6 @@ static int fpm_env_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */ int fpm_env_init_main() /* {{{ */ { struct fpm_worker_pool_s *wp; - int i; - char *first = NULL; - char *last = NULL; char *title; for (wp = fpm_worker_all_pools; wp; wp = wp->next) { @@ -211,6 +208,9 @@ int fpm_env_init_main() /* {{{ */ } #ifndef HAVE_SETPROCTITLE #ifdef __linux__ + int i; + char *first = NULL; + char *last = NULL; /* * This piece of code has been inspirated from nginx and pureftpd code, which * are under BSD licence. |