Fixed some spaces used instead of tabs

This commit is contained in:
Patrick Allaert 2021-06-29 10:04:10 +02:00 committed by Patrick Allaert
parent a233bfc766
commit aff365871a
157 changed files with 1011 additions and 1014 deletions

View file

@ -229,11 +229,11 @@ TSRM_API void tsrm_shutdown(void)
/* {{{ */ /* {{{ */
/* environ lock api */ /* environ lock api */
TSRM_API void tsrm_env_lock(void) { TSRM_API void tsrm_env_lock(void) {
tsrm_mutex_lock(tsrm_env_mutex); tsrm_mutex_lock(tsrm_env_mutex);
} }
TSRM_API void tsrm_env_unlock(void) { TSRM_API void tsrm_env_unlock(void) {
tsrm_mutex_unlock(tsrm_env_mutex); tsrm_mutex_unlock(tsrm_env_mutex);
} /* }}} */ } /* }}} */
/* enlarge the arrays for the already active threads */ /* enlarge the arrays for the already active threads */
@ -768,7 +768,7 @@ TSRM_API uint8_t tsrm_is_main_thread(void)
TSRM_API uint8_t tsrm_is_shutdown(void) TSRM_API uint8_t tsrm_is_shutdown(void)
{/*{{{*/ {/*{{{*/
return is_thread_shutdown; return is_thread_shutdown;
}/*}}}*/ }/*}}}*/
TSRM_API const char *tsrm_api_name(void) TSRM_API const char *tsrm_api_name(void)

View file

@ -188,7 +188,7 @@ static int is_allocation_def(zend_op_array *op_array, zend_ssa *ssa, int def, in
} }
break; break;
} }
} else if (ssa_op->op1_def == var) { } else if (ssa_op->op1_def == var) {
switch (opline->opcode) { switch (opline->opcode) {
case ZEND_ASSIGN: case ZEND_ASSIGN:
if (opline->op2_type == IS_CONST if (opline->op2_type == IS_CONST
@ -208,7 +208,7 @@ static int is_allocation_def(zend_op_array *op_array, zend_ssa *ssa, int def, in
} }
} }
return 0; return 0;
} }
/* }}} */ /* }}} */

View file

@ -59,12 +59,12 @@ void zend_optimize_temporary_variables(zend_op_array *op_array, zend_optimizer_c
valid_T = (zend_bitset) zend_arena_alloc(&ctx->arena, bitset_len * ZEND_BITSET_ELM_SIZE); valid_T = (zend_bitset) zend_arena_alloc(&ctx->arena, bitset_len * ZEND_BITSET_ELM_SIZE);
map_T = (int *) zend_arena_alloc(&ctx->arena, T * sizeof(int)); map_T = (int *) zend_arena_alloc(&ctx->arena, T * sizeof(int));
end = op_array->opcodes; end = op_array->opcodes;
opline = &op_array->opcodes[op_array->last - 1]; opline = &op_array->opcodes[op_array->last - 1];
/* Find T definition points */ /* Find T definition points */
while (opline >= end) { while (opline >= end) {
if (opline->result_type & (IS_VAR | IS_TMP_VAR)) { if (opline->result_type & (IS_VAR | IS_TMP_VAR)) {
start_of_T[VAR_NUM(opline->result.var) - offset] = opline; start_of_T[VAR_NUM(opline->result.var) - offset] = opline;
} }
opline--; opline--;
@ -73,10 +73,10 @@ void zend_optimize_temporary_variables(zend_op_array *op_array, zend_optimizer_c
zend_bitset_clear(valid_T, bitset_len); zend_bitset_clear(valid_T, bitset_len);
zend_bitset_clear(taken_T, bitset_len); zend_bitset_clear(taken_T, bitset_len);
end = op_array->opcodes; end = op_array->opcodes;
opline = &op_array->opcodes[op_array->last - 1]; opline = &op_array->opcodes[op_array->last - 1];
while (opline >= end) { while (opline >= end) {
if ((opline->op1_type & (IS_VAR | IS_TMP_VAR))) { if ((opline->op1_type & (IS_VAR | IS_TMP_VAR))) {
currT = VAR_NUM(opline->op1.var) - offset; currT = VAR_NUM(opline->op1.var) - offset;
if (opline->opcode == ZEND_ROPE_END) { if (opline->opcode == ZEND_ROPE_END) {

View file

@ -35,7 +35,7 @@ static void zend_op_array_calc(zend_op_array *op_array, void *context)
static void zend_op_array_collect(zend_op_array *op_array, void *context) static void zend_op_array_collect(zend_op_array *op_array, void *context)
{ {
zend_call_graph *call_graph = context; zend_call_graph *call_graph = context;
zend_func_info *func_info = call_graph->func_infos + call_graph->op_arrays_count; zend_func_info *func_info = call_graph->func_infos + call_graph->op_arrays_count;
ZEND_SET_FUNC_INFO(op_array, func_info); ZEND_SET_FUNC_INFO(op_array, func_info);
call_graph->op_arrays[call_graph->op_arrays_count] = op_array; call_graph->op_arrays[call_graph->op_arrays_count] = op_array;

View file

@ -3285,7 +3285,7 @@ static zend_always_inline int _zend_update_type_info(
if (opline->opcode == ZEND_FETCH_DIM_W || if (opline->opcode == ZEND_FETCH_DIM_W ||
opline->opcode == ZEND_FETCH_DIM_RW || opline->opcode == ZEND_FETCH_DIM_RW ||
opline->opcode == ZEND_FETCH_DIM_FUNC_ARG || opline->opcode == ZEND_FETCH_DIM_FUNC_ARG ||
opline->opcode == ZEND_FETCH_LIST_W) { opline->opcode == ZEND_FETCH_LIST_W) {
if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) { if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
if (opline->opcode != ZEND_FETCH_DIM_FUNC_ARG) { if (opline->opcode != ZEND_FETCH_DIM_FUNC_ARG) {
tmp &= ~(MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE); tmp &= ~(MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE);

View file

@ -645,7 +645,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
ZEND_ASSERT(opline->op1.var == var); ZEND_ASSERT(opline->op1.var == var);
break; break;
} }
default: default:
break; break;
} }

View file

@ -196,9 +196,9 @@ ZEND_INI_BEGIN()
ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting) ZEND_INI_ENTRY("error_reporting", NULL, ZEND_INI_ALL, OnUpdateErrorReporting)
STD_ZEND_INI_ENTRY("zend.assertions", "1", ZEND_INI_ALL, OnUpdateAssertions, assertions, zend_executor_globals, executor_globals) STD_ZEND_INI_ENTRY("zend.assertions", "1", ZEND_INI_ALL, OnUpdateAssertions, assertions, zend_executor_globals, executor_globals)
ZEND_INI_ENTRY3_EX("zend.enable_gc", "1", ZEND_INI_ALL, OnUpdateGCEnabled, NULL, NULL, NULL, zend_gc_enabled_displayer_cb) ZEND_INI_ENTRY3_EX("zend.enable_gc", "1", ZEND_INI_ALL, OnUpdateGCEnabled, NULL, NULL, NULL, zend_gc_enabled_displayer_cb)
STD_ZEND_INI_BOOLEAN("zend.multibyte", "0", ZEND_INI_PERDIR, OnUpdateBool, multibyte, zend_compiler_globals, compiler_globals) STD_ZEND_INI_BOOLEAN("zend.multibyte", "0", ZEND_INI_PERDIR, OnUpdateBool, multibyte, zend_compiler_globals, compiler_globals)
ZEND_INI_ENTRY("zend.script_encoding", NULL, ZEND_INI_ALL, OnUpdateScriptEncoding) ZEND_INI_ENTRY("zend.script_encoding", NULL, ZEND_INI_ALL, OnUpdateScriptEncoding)
STD_ZEND_INI_BOOLEAN("zend.detect_unicode", "1", ZEND_INI_ALL, OnUpdateBool, detect_unicode, zend_compiler_globals, compiler_globals) STD_ZEND_INI_BOOLEAN("zend.detect_unicode", "1", ZEND_INI_ALL, OnUpdateBool, detect_unicode, zend_compiler_globals, compiler_globals)
#ifdef ZEND_SIGNALS #ifdef ZEND_SIGNALS
STD_ZEND_INI_BOOLEAN("zend.signal_check", SIGNAL_CHECK_DEFAULT, ZEND_INI_SYSTEM, OnUpdateBool, check, zend_signal_globals_t, zend_signal_globals) STD_ZEND_INI_BOOLEAN("zend.signal_check", SIGNAL_CHECK_DEFAULT, ZEND_INI_SYSTEM, OnUpdateBool, check, zend_signal_globals_t, zend_signal_globals)
#endif #endif

View file

@ -377,7 +377,7 @@ static ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_entr
zend_throw_error(error_ce, "%s(): Argument #%d%s%s%s %s", zend_throw_error(error_ce, "%s(): Argument #%d%s%s%s %s",
ZSTR_VAL(func_name), arg_num, ZSTR_VAL(func_name), arg_num,
arg_name ? " ($" : "", arg_name ? arg_name : "", arg_name ? ")" : "", message arg_name ? " ($" : "", arg_name ? arg_name : "", arg_name ? ")" : "", message
); );
efree(message); efree(message);
zend_string_release(func_name); zend_string_release(func_name);
} }
@ -1548,12 +1548,12 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
ZEND_API void object_properties_load(zend_object *object, HashTable *properties) /* {{{ */ ZEND_API void object_properties_load(zend_object *object, HashTable *properties) /* {{{ */
{ {
zval *prop, tmp; zval *prop, tmp;
zend_string *key; zend_string *key;
zend_long h; zend_long h;
zend_property_info *property_info; zend_property_info *property_info;
ZEND_HASH_FOREACH_KEY_VAL(properties, h, key, prop) { ZEND_HASH_FOREACH_KEY_VAL(properties, h, key, prop) {
if (key) { if (key) {
if (ZSTR_VAL(key)[0] == '\0') { if (ZSTR_VAL(key)[0] == '\0') {
const char *class_name, *prop_name; const char *class_name, *prop_name;

View file

@ -323,17 +323,17 @@ struct _zend_mm_huge_list {
#define _BIN_DATA_SIZE(num, size, elements, pages, x, y) size, #define _BIN_DATA_SIZE(num, size, elements, pages, x, y) size,
static const uint32_t bin_data_size[] = { static const uint32_t bin_data_size[] = {
ZEND_MM_BINS_INFO(_BIN_DATA_SIZE, x, y) ZEND_MM_BINS_INFO(_BIN_DATA_SIZE, x, y)
}; };
#define _BIN_DATA_ELEMENTS(num, size, elements, pages, x, y) elements, #define _BIN_DATA_ELEMENTS(num, size, elements, pages, x, y) elements,
static const uint32_t bin_elements[] = { static const uint32_t bin_elements[] = {
ZEND_MM_BINS_INFO(_BIN_DATA_ELEMENTS, x, y) ZEND_MM_BINS_INFO(_BIN_DATA_ELEMENTS, x, y)
}; };
#define _BIN_DATA_PAGES(num, size, elements, pages, x, y) pages, #define _BIN_DATA_PAGES(num, size, elements, pages, x, y) pages,
static const uint32_t bin_pages[] = { static const uint32_t bin_pages[] = {
ZEND_MM_BINS_INFO(_BIN_DATA_PAGES, x, y) ZEND_MM_BINS_INFO(_BIN_DATA_PAGES, x, y)
}; };
#if ZEND_DEBUG #if ZEND_DEBUG
@ -1186,8 +1186,8 @@ static zend_always_inline int zend_mm_small_size_to_bin(size_t size)
static zend_never_inline void *zend_mm_alloc_small_slow(zend_mm_heap *heap, uint32_t bin_num ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) static zend_never_inline void *zend_mm_alloc_small_slow(zend_mm_heap *heap, uint32_t bin_num ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{ {
zend_mm_chunk *chunk; zend_mm_chunk *chunk;
int page_num; int page_num;
zend_mm_bin *bin; zend_mm_bin *bin;
zend_mm_free_slot *p, *end; zend_mm_free_slot *p, *end;
@ -1275,9 +1275,9 @@ static zend_always_inline void zend_mm_free_small(zend_mm_heap *heap, void *ptr,
} while (0); } while (0);
#endif #endif
p = (zend_mm_free_slot*)ptr; p = (zend_mm_free_slot*)ptr;
p->next_free_slot = heap->free_slot[bin_num]; p->next_free_slot = heap->free_slot[bin_num];
heap->free_slot[bin_num] = p; heap->free_slot[bin_num] = p;
} }
/********/ /********/
@ -2015,7 +2015,7 @@ ZEND_API size_t zend_mm_gc(zend_mm_heap *heap)
static zend_long zend_mm_find_leaks_small(zend_mm_chunk *p, uint32_t i, uint32_t j, zend_leak_info *leak) static zend_long zend_mm_find_leaks_small(zend_mm_chunk *p, uint32_t i, uint32_t j, zend_leak_info *leak)
{ {
int empty = 1; int empty = 1;
zend_long count = 0; zend_long count = 0;
int bin_num = ZEND_MM_SRUN_BIN_NUM(p->map[i]); int bin_num = ZEND_MM_SRUN_BIN_NUM(p->map[i]);
zend_mm_debug_info *dbg = (zend_mm_debug_info*)((char*)p + ZEND_MM_PAGE_SIZE * i + bin_data_size[bin_num] * (j + 1) - ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_debug_info))); zend_mm_debug_info *dbg = (zend_mm_debug_info*)((char*)p + ZEND_MM_PAGE_SIZE * i + bin_data_size[bin_num] * (j + 1) - ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_debug_info)));
@ -2426,7 +2426,7 @@ static ZEND_COLD void ZEND_FASTCALL _efree_custom(void *ptr ZEND_FILE_LINE_DC ZE
AG(mm_heap)->custom_heap.debug._free(ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); AG(mm_heap)->custom_heap.debug._free(ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
} else { } else {
AG(mm_heap)->custom_heap.std._free(ptr); AG(mm_heap)->custom_heap.std._free(ptr);
} }
} }
static ZEND_COLD void* ZEND_FASTCALL _realloc_custom(void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) static ZEND_COLD void* ZEND_FASTCALL _realloc_custom(void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
@ -2924,9 +2924,9 @@ ZEND_API void zend_mm_get_custom_handlers(zend_mm_heap *heap,
#if ZEND_DEBUG #if ZEND_DEBUG
ZEND_API void zend_mm_set_custom_debug_handlers(zend_mm_heap *heap, ZEND_API void zend_mm_set_custom_debug_handlers(zend_mm_heap *heap,
void* (*_malloc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), void* (*_malloc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
void (*_free)(void* ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), void (*_free)(void* ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
void* (*_realloc)(void*, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)) void* (*_realloc)(void*, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC))
{ {
#if ZEND_MM_CUSTOM #if ZEND_MM_CUSTOM
zend_mm_heap *_heap = (zend_mm_heap*)heap; zend_mm_heap *_heap = (zend_mm_heap*)heap;

View file

@ -474,7 +474,7 @@ static zend_result zend_ast_add_array_element(zval *result, zval *offset, zval *
default: default:
zend_type_error("Illegal offset type"); zend_type_error("Illegal offset type");
return FAILURE; return FAILURE;
} }
return SUCCESS; return SUCCESS;
} }

View file

@ -492,7 +492,7 @@ ZEND_FUNCTION(define)
if (non_cs) { if (non_cs) {
zend_error(E_WARNING, "define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported"); zend_error(E_WARNING, "define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported");
} }
ZVAL_UNDEF(&val_free); ZVAL_UNDEF(&val_free);
@ -1018,7 +1018,7 @@ static inline void class_exists_impl(INTERNAL_FUNCTION_PARAMETERS, int flags, in
ce = zend_lookup_class(name); ce = zend_lookup_class(name);
} }
if (ce) { if (ce) {
RETURN_BOOL(((ce->ce_flags & flags) == flags) && !(ce->ce_flags & skip_flags)); RETURN_BOOL(((ce->ce_flags & flags) == flags) && !(ce->ce_flags & skip_flags));
} else { } else {
RETURN_FALSE; RETURN_FALSE;

View file

@ -757,7 +757,7 @@ void zend_do_free(znode *op1) /* {{{ */
} else { } else {
while (opline >= CG(active_op_array)->opcodes) { while (opline >= CG(active_op_array)->opcodes) {
if ((opline->opcode == ZEND_FETCH_LIST_R || if ((opline->opcode == ZEND_FETCH_LIST_R ||
opline->opcode == ZEND_FETCH_LIST_W) && opline->opcode == ZEND_FETCH_LIST_W) &&
opline->op1_type == IS_VAR && opline->op1_type == IS_VAR &&
opline->op1.var == op1->u.op.var) { opline->op1.var == op1->u.op.var) {
zend_emit_op(NULL, ZEND_FREE, op1, NULL); zend_emit_op(NULL, ZEND_FREE, op1, NULL);
@ -3819,7 +3819,7 @@ static zend_result zend_compile_func_is_scalar(znode *result, zend_ast_list *arg
zend_compile_expr(&arg_node, args->child[0]); zend_compile_expr(&arg_node, args->child[0]);
opline = zend_emit_op_tmp(result, ZEND_TYPE_CHECK, &arg_node, NULL); opline = zend_emit_op_tmp(result, ZEND_TYPE_CHECK, &arg_node, NULL);
opline->extended_value = (1 << IS_FALSE | 1 << IS_TRUE | 1 << IS_DOUBLE | 1 << IS_LONG | 1 << IS_STRING); opline->extended_value = (1 << IS_FALSE | 1 << IS_TRUE | 1 << IS_DOUBLE | 1 << IS_LONG | 1 << IS_STRING);
return SUCCESS; return SUCCESS;
} }

View file

@ -89,7 +89,7 @@ ZEND_API zend_class_entry *zend_get_exception_base(zend_object *object) /* {{{ *
void zend_exception_set_previous(zend_object *exception, zend_object *add_previous) /* {{{ */ void zend_exception_set_previous(zend_object *exception, zend_object *add_previous) /* {{{ */
{ {
zval *previous, *ancestor, *ex; zval *previous, *ancestor, *ex;
zval pv, zv, rv; zval pv, zv, rv;
zend_class_entry *base_ce; zend_class_entry *base_ce;

View file

@ -2789,7 +2789,7 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
zend_object *zobj; zend_object *zobj;
zend_string *name, *tmp_name; zend_string *name, *tmp_name;
if (container_op_type != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if (container_op_type != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
do { do {
if (Z_ISREF_P(container) && Z_TYPE_P(Z_REFVAL_P(container)) == IS_OBJECT) { if (Z_ISREF_P(container) && Z_TYPE_P(Z_REFVAL_P(container)) == IS_OBJECT) {
container = Z_REFVAL_P(container); container = Z_REFVAL_P(container);
@ -3726,7 +3726,7 @@ ZEND_API void zend_init_func_execute_data(zend_execute_data *ex, zend_op_array *
i_init_func_execute_data(op_array, return_value, 1 EXECUTE_DATA_CC); i_init_func_execute_data(op_array, return_value, 1 EXECUTE_DATA_CC);
#if defined(ZEND_VM_IP_GLOBAL_REG) && ((ZEND_VM_KIND == ZEND_VM_KIND_CALL) || (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)) #if defined(ZEND_VM_IP_GLOBAL_REG) && ((ZEND_VM_KIND == ZEND_VM_KIND_CALL) || (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID))
EX(opline) = opline; EX(opline) = opline;
opline = orig_opline; opline = orig_opline;
#endif #endif
#if defined(ZEND_VM_FP_GLOBAL_REG) && ((ZEND_VM_KIND == ZEND_VM_KIND_CALL) || (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)) #if defined(ZEND_VM_FP_GLOBAL_REG) && ((ZEND_VM_KIND == ZEND_VM_KIND_CALL) || (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID))

View file

@ -1274,7 +1274,7 @@ ZEND_API ZEND_NORETURN void ZEND_FASTCALL zend_timeout(void) /* {{{ */
static void zend_timeout_handler(int dummy) /* {{{ */ static void zend_timeout_handler(int dummy) /* {{{ */
{ {
#ifndef ZTS #ifndef ZTS
if (EG(timed_out)) { if (EG(timed_out)) {
/* Die on hard timeout */ /* Die on hard timeout */
const char *error_filename = NULL; const char *error_filename = NULL;
uint32_t error_lineno = 0; uint32_t error_lineno = 0;
@ -1302,7 +1302,7 @@ static void zend_timeout_handler(int dummy) /* {{{ */
zend_quiet_write(2, log_buffer, MIN(output_len, sizeof(log_buffer))); zend_quiet_write(2, log_buffer, MIN(output_len, sizeof(log_buffer)));
} }
_exit(124); _exit(124);
} }
#endif #endif
if (zend_on_timeout) { if (zend_on_timeout) {
@ -1538,7 +1538,7 @@ zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, zend_string
ZEND_API zend_result zend_delete_global_variable(zend_string *name) /* {{{ */ ZEND_API zend_result zend_delete_global_variable(zend_string *name) /* {{{ */
{ {
return zend_hash_del_ind(&EG(symbol_table), name); return zend_hash_del_ind(&EG(symbol_table), name);
} }
/* }}} */ /* }}} */

View file

@ -615,7 +615,7 @@ ZEND_METHOD(Fiber, start)
RETURN_THROWS(); RETURN_THROWS();
} }
if (fiber->context.status != ZEND_FIBER_STATUS_INIT) { if (fiber->context.status != ZEND_FIBER_STATUS_INIT) {
zend_throw_error(zend_ce_fiber_error, "Cannot start a fiber that has already been started"); zend_throw_error(zend_ce_fiber_error, "Cannot start a fiber that has already been started");
RETURN_THROWS(); RETURN_THROWS();
} }
@ -657,7 +657,7 @@ ZEND_METHOD(Fiber, suspend)
RETURN_THROWS(); RETURN_THROWS();
} }
ZEND_ASSERT(fiber->context.status == ZEND_FIBER_STATUS_RUNNING || fiber->context.status == ZEND_FIBER_STATUS_SUSPENDED); ZEND_ASSERT(fiber->context.status == ZEND_FIBER_STATUS_RUNNING || fiber->context.status == ZEND_FIBER_STATUS_SUSPENDED);
fiber->execute_data = EG(current_execute_data); fiber->execute_data = EG(current_execute_data);
fiber->stack_bottom->prev_execute_data = NULL; fiber->stack_bottom->prev_execute_data = NULL;

View file

@ -426,17 +426,17 @@ ZEND_API void ZEND_FASTCALL zend_hash_discard(HashTable *ht, uint32_t nNumUsed)
static uint32_t zend_array_recalc_elements(HashTable *ht) static uint32_t zend_array_recalc_elements(HashTable *ht)
{ {
zval *val; zval *val;
uint32_t num = ht->nNumOfElements; uint32_t num = ht->nNumOfElements;
ZEND_HASH_FOREACH_VAL(ht, val) { ZEND_HASH_FOREACH_VAL(ht, val) {
if (Z_TYPE_P(val) == IS_INDIRECT) { if (Z_TYPE_P(val) == IS_INDIRECT) {
if (UNEXPECTED(Z_TYPE_P(Z_INDIRECT_P(val)) == IS_UNDEF)) { if (UNEXPECTED(Z_TYPE_P(Z_INDIRECT_P(val)) == IS_UNDEF)) {
num--; num--;
} }
} }
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
return num; return num;
} }
/* }}} */ /* }}} */
@ -1872,7 +1872,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_fu
ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument) ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument)
{ {
uint32_t idx; uint32_t idx;
Bucket *p; Bucket *p;
int result; int result;
@ -1955,7 +1955,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t
ZEND_API void ZEND_FASTCALL zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor) ZEND_API void ZEND_FASTCALL zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor)
{ {
uint32_t idx; uint32_t idx;
Bucket *p; Bucket *p;
zval *new_entry, *data; zval *new_entry, *data;
@ -2170,7 +2170,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, bool overwrite) ZEND_API void ZEND_FASTCALL zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, bool overwrite)
{ {
uint32_t idx; uint32_t idx;
Bucket *p; Bucket *p;
zval *t, *s; zval *t, *s;
@ -2393,9 +2393,9 @@ ZEND_API zend_result ZEND_FASTCALL zend_hash_move_backwards_ex(HashTable *ht, Ha
} }
} }
*pos = ht->nNumUsed; *pos = ht->nNumUsed;
return SUCCESS; return SUCCESS;
} else { } else {
return FAILURE; return FAILURE;
} }
} }

View file

@ -238,7 +238,7 @@ ZEND_API zend_result zend_register_ini_entries(const zend_ini_entry_def *ini_ent
return FAILURE; return FAILURE;
} }
if (((default_value = zend_get_configuration_directive(p->name)) != NULL) && if (((default_value = zend_get_configuration_directive(p->name)) != NULL) &&
(!p->on_modify || p->on_modify(p, Z_STR_P(default_value), p->mh_arg1, p->mh_arg2, p->mh_arg3, ZEND_INI_STAGE_STARTUP) == SUCCESS)) { (!p->on_modify || p->on_modify(p, Z_STR_P(default_value), p->mh_arg1, p->mh_arg2, p->mh_arg3, ZEND_INI_STAGE_STARTUP) == SUCCESS)) {
p->value = zend_new_interned_string(zend_string_copy(Z_STR_P(default_value))); p->value = zend_new_interned_string(zend_string_copy(Z_STR_P(default_value)));
} else { } else {
@ -284,8 +284,8 @@ ZEND_API zend_result zend_alter_ini_entry(zend_string *name, zend_string *new_va
ZEND_API zend_result zend_alter_ini_entry_chars(zend_string *name, const char *value, size_t value_length, int modify_type, int stage) /* {{{ */ ZEND_API zend_result zend_alter_ini_entry_chars(zend_string *name, const char *value, size_t value_length, int modify_type, int stage) /* {{{ */
{ {
zend_result ret; zend_result ret;
zend_string *new_value; zend_string *new_value;
new_value = zend_string_init(value, value_length, !(stage & ZEND_INI_STAGE_IN_REQUEST)); new_value = zend_string_init(value, value_length, !(stage & ZEND_INI_STAGE_IN_REQUEST));
ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0); ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0);
@ -296,8 +296,8 @@ ZEND_API zend_result zend_alter_ini_entry_chars(zend_string *name, const char *v
ZEND_API zend_result zend_alter_ini_entry_chars_ex(zend_string *name, const char *value, size_t value_length, int modify_type, int stage, int force_change) /* {{{ */ ZEND_API zend_result zend_alter_ini_entry_chars_ex(zend_string *name, const char *value, size_t value_length, int modify_type, int stage, int force_change) /* {{{ */
{ {
zend_result ret; zend_result ret;
zend_string *new_value; zend_string *new_value;
new_value = zend_string_init(value, value_length, !(stage & ZEND_INI_STAGE_IN_REQUEST)); new_value = zend_string_init(value, value_length, !(stage & ZEND_INI_STAGE_IN_REQUEST));
ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, force_change); ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, force_change);

View file

@ -3156,8 +3156,9 @@ ZEND_API zend_string* ZEND_FASTCALL zend_i64_to_str(int64_t num)
} }
} }
ZEND_API zend_uchar ZEND_FASTCALL is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval) /* {{{ */ { ZEND_API zend_uchar ZEND_FASTCALL is_numeric_str_function(const zend_string *str, zend_long *lval, double *dval) /* {{{ */
return is_numeric_string(ZSTR_VAL(str), ZSTR_LEN(str), lval, dval, false); {
return is_numeric_string(ZSTR_VAL(str), ZSTR_LEN(str), lval, dval, false);
} }
/* }}} */ /* }}} */

View file

@ -24,9 +24,9 @@
/* {{{ data structure */ /* {{{ data structure */
enum strm_status { enum strm_status {
PHP_BZ2_UNINITIALIZED, PHP_BZ2_UNINITIALIZED,
PHP_BZ2_RUNNING, PHP_BZ2_RUNNING,
PHP_BZ2_FINISHED PHP_BZ2_FINISHED
}; };
typedef struct _php_bz2_filter_data { typedef struct _php_bz2_filter_data {

View file

@ -112,7 +112,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, zend_long gm)
} else { /* return the days after March 21 */ } else { /* return the days after March 21 */
result = easter; result = easter;
} }
ZVAL_LONG(return_value, result); ZVAL_LONG(return_value, result);
} }
/* {{{ Return the timestamp of midnight on Easter of a given year (defaults to current year) */ /* {{{ Return the timestamp of midnight on Easter of a given year (defaults to current year) */

View file

@ -135,10 +135,10 @@ static ZEND_INI_MH(OnAutoregisterCasesensitive)
} }
PHP_INI_BEGIN() PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("com.allow_dcom", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_dcom, zend_com_dotnet_globals, com_dotnet_globals) STD_PHP_INI_BOOLEAN("com.allow_dcom", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_dcom, zend_com_dotnet_globals, com_dotnet_globals)
STD_PHP_INI_BOOLEAN("com.autoregister_verbose", "0", PHP_INI_ALL, OnUpdateBool, autoreg_verbose, zend_com_dotnet_globals, com_dotnet_globals) STD_PHP_INI_BOOLEAN("com.autoregister_verbose", "0", PHP_INI_ALL, OnUpdateBool, autoreg_verbose, zend_com_dotnet_globals, com_dotnet_globals)
STD_PHP_INI_BOOLEAN("com.autoregister_typelib", "0", PHP_INI_ALL, OnUpdateBool, autoreg_on, zend_com_dotnet_globals, com_dotnet_globals) STD_PHP_INI_BOOLEAN("com.autoregister_typelib", "0", PHP_INI_ALL, OnUpdateBool, autoreg_on, zend_com_dotnet_globals, com_dotnet_globals)
STD_PHP_INI_ENTRY("com.autoregister_casesensitive", "1", PHP_INI_ALL, OnAutoregisterCasesensitive, autoreg_case_sensitive, zend_com_dotnet_globals, com_dotnet_globals) STD_PHP_INI_ENTRY("com.autoregister_casesensitive", "1", PHP_INI_ALL, OnAutoregisterCasesensitive, autoreg_case_sensitive, zend_com_dotnet_globals, com_dotnet_globals)
STD_PHP_INI_ENTRY("com.code_page", "", PHP_INI_ALL, OnUpdateLong, code_page, zend_com_dotnet_globals, com_dotnet_globals) STD_PHP_INI_ENTRY("com.code_page", "", PHP_INI_ALL, OnUpdateLong, code_page, zend_com_dotnet_globals, com_dotnet_globals)
PHP_INI_ENTRY("com.typelib_file", "", PHP_INI_SYSTEM, OnTypeLibFileUpdate) PHP_INI_ENTRY("com.typelib_file", "", PHP_INI_SYSTEM, OnTypeLibFileUpdate)
PHP_INI_ENTRY("com.dotnet_version", NULL, PHP_INI_SYSTEM, NULL) PHP_INI_ENTRY("com.dotnet_version", NULL, PHP_INI_SYSTEM, NULL)

View file

@ -384,14 +384,14 @@ PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar)
} else { } else {
V_BOOL(dstvar) = V_BOOL(srcvar); V_BOOL(dstvar) = V_BOOL(srcvar);
} }
break; break;
case VT_BSTR: case VT_BSTR:
if (V_VT(dstvar) & VT_BYREF) { if (V_VT(dstvar) & VT_BYREF) {
*V_BSTRREF(dstvar) = V_BSTR(srcvar); *V_BSTRREF(dstvar) = V_BSTR(srcvar);
} else { } else {
V_BSTR(dstvar) = V_BSTR(srcvar); V_BSTR(dstvar) = V_BSTR(srcvar);
} }
break; break;
case VT_UNKNOWN: case VT_UNKNOWN:

View file

@ -43,7 +43,7 @@ zend_module_entry ctype_module_entry = {
NULL, NULL,
NULL, NULL,
PHP_MINFO(ctype), PHP_MINFO(ctype),
PHP_CTYPE_VERSION, PHP_CTYPE_VERSION,
STANDARD_MODULE_PROPERTIES STANDARD_MODULE_PROPERTIES
}; };
/* }}} */ /* }}} */

View file

@ -61,8 +61,8 @@ ZEND_METHOD(CURLFile, __construct)
/* {{{ Create the CURLFile object */ /* {{{ Create the CURLFile object */
PHP_FUNCTION(curl_file_create) PHP_FUNCTION(curl_file_create)
{ {
object_init_ex( return_value, curl_CURLFile_class ); object_init_ex( return_value, curl_CURLFile_class );
curlfile_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU); curlfile_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
} }
/* }}} */ /* }}} */

View file

@ -394,7 +394,7 @@ static int _php_server_push_callback(CURL *parent_ch, CURL *easy, size_t num_hea
for(i=0; i<num_headers; i++) { for(i=0; i<num_headers; i++) {
header = curl_pushheader_bynum(push_headers, i); header = curl_pushheader_bynum(push_headers, i);
add_next_index_string(&headers, header); add_next_index_string(&headers, header);
} }
zend_fcall_info_init(&t->func_name, 0, &fci, &t->fci_cache, NULL, NULL); zend_fcall_info_init(&t->func_name, 0, &fci, &t->fci_cache, NULL, NULL);

View file

@ -58,16 +58,16 @@ static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i;
PHPAPI time_t php_time(void) PHPAPI time_t php_time(void)
{ {
#ifdef HAVE_GETTIMEOFDAY #ifdef HAVE_GETTIMEOFDAY
struct timeval tm; struct timeval tm;
if (UNEXPECTED(gettimeofday(&tm, NULL) != SUCCESS)) { if (UNEXPECTED(gettimeofday(&tm, NULL) != SUCCESS)) {
/* fallback, can't reasonably happen */ /* fallback, can't reasonably happen */
return time(NULL); return time(NULL);
} }
return tm.tv_sec; return tm.tv_sec;
#else #else
return time(NULL); return time(NULL);
#endif #endif
} }
@ -1775,9 +1775,9 @@ static HashTable *date_object_get_gc(zend_object *object, zval **table, int *n)
static HashTable *date_object_get_gc_timezone(zend_object *object, zval **table, int *n) /* {{{ */ static HashTable *date_object_get_gc_timezone(zend_object *object, zval **table, int *n) /* {{{ */
{ {
*table = NULL; *table = NULL;
*n = 0; *n = 0;
return zend_std_get_properties(object); return zend_std_get_properties(object);
} /* }}} */ } /* }}} */
static HashTable *date_object_get_properties_for(zend_object *object, zend_prop_purpose purpose) /* {{{ */ static HashTable *date_object_get_properties_for(zend_object *object, zend_prop_purpose purpose) /* {{{ */
@ -2090,11 +2090,11 @@ static zend_object *date_object_clone_period(zend_object *this_ptr) /* {{{ */
new_obj->current = timelib_time_clone(old_obj->current); new_obj->current = timelib_time_clone(old_obj->current);
} }
if (old_obj->end) { if (old_obj->end) {
new_obj->end = timelib_time_clone(old_obj->end); new_obj->end = timelib_time_clone(old_obj->end);
} }
if (old_obj->interval) { if (old_obj->interval) {
new_obj->interval = timelib_rel_time_clone(old_obj->interval); new_obj->interval = timelib_rel_time_clone(old_obj->interval);
} }
return &new_obj->std; return &new_obj->std;
} /* }}} */ } /* }}} */
@ -4269,27 +4269,27 @@ PHP_METHOD(DatePeriod, getStartDate)
/* {{{ Get end date. */ /* {{{ Get end date. */
PHP_METHOD(DatePeriod, getEndDate) PHP_METHOD(DatePeriod, getEndDate)
{ {
php_period_obj *dpobj; php_period_obj *dpobj;
php_date_obj *dateobj; php_date_obj *dateobj;
ZEND_PARSE_PARAMETERS_NONE(); ZEND_PARSE_PARAMETERS_NONE();
dpobj = Z_PHPPERIOD_P(ZEND_THIS); dpobj = Z_PHPPERIOD_P(ZEND_THIS);
if (!dpobj->end) { if (!dpobj->end) {
return; return;
} }
php_date_instantiate(dpobj->start_ce, return_value); php_date_instantiate(dpobj->start_ce, return_value);
dateobj = Z_PHPDATE_P(return_value); dateobj = Z_PHPDATE_P(return_value);
dateobj->time = timelib_time_ctor(); dateobj->time = timelib_time_ctor();
*dateobj->time = *dpobj->end; *dateobj->time = *dpobj->end;
if (dpobj->end->tz_abbr) { if (dpobj->end->tz_abbr) {
dateobj->time->tz_abbr = timelib_strdup(dpobj->end->tz_abbr); dateobj->time->tz_abbr = timelib_strdup(dpobj->end->tz_abbr);
} }
if (dpobj->end->tz_info) { if (dpobj->end->tz_info) {
dateobj->time->tz_info = dpobj->end->tz_info; dateobj->time->tz_info = dpobj->end->tz_info;
} }
} }
/* }}} */ /* }}} */

View file

@ -236,7 +236,7 @@ static dba_handler handler[] = {
DBA_HND(cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */ DBA_HND(cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */
#endif #endif
#if DBA_CDB_BUILTIN #if DBA_CDB_BUILTIN
DBA_NAMED_HND(cdb_make, cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */ DBA_NAMED_HND(cdb_make, cdb, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */
#endif #endif
#if DBA_DB1 #if DBA_DB1
DBA_HND(db1, DBA_LOCK_ALL) /* No lock in lib */ DBA_HND(db1, DBA_LOCK_ALL) /* No lock in lib */
@ -404,7 +404,7 @@ ZEND_INI_MH(OnUpdateDefaultHandler)
} }
PHP_INI_BEGIN() PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("dba.default_handler", DBA_DEFAULT, PHP_INI_ALL, OnUpdateDefaultHandler, default_handler, zend_dba_globals, dba_globals) STD_PHP_INI_ENTRY("dba.default_handler", DBA_DEFAULT, PHP_INI_ALL, OnUpdateDefaultHandler, default_handler, zend_dba_globals, dba_globals)
PHP_INI_END() PHP_INI_END()
/* }}} */ /* }}} */
@ -448,10 +448,10 @@ PHP_MINFO_FUNCTION(dba)
for(hptr = handler; hptr->name; hptr++) { for(hptr = handler; hptr->name; hptr++) {
smart_str_appends(&handlers, hptr->name); smart_str_appends(&handlers, hptr->name);
smart_str_appendc(&handlers, ' '); smart_str_appendc(&handlers, ' ');
} }
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "DBA support", "enabled"); php_info_print_table_row(2, "DBA support", "enabled");
if (handlers.s) { if (handlers.s) {
smart_str_0(&handlers); smart_str_0(&handlers);
php_info_print_table_row(2, "Supported handlers", ZSTR_VAL(handlers.s)); php_info_print_table_row(2, "Supported handlers", ZSTR_VAL(handlers.s));
@ -1172,7 +1172,7 @@ PHP_FUNCTION(dba_handlers)
} else { } else {
add_next_index_string(return_value, hptr->name); add_next_index_string(return_value, hptr->name);
} }
} }
} }
/* }}} */ /* }}} */

View file

@ -154,16 +154,16 @@ zend_result dom_document_encoding_write(dom_object *obj, zval *newval)
handler = xmlFindCharEncodingHandler(ZSTR_VAL(str)); handler = xmlFindCharEncodingHandler(ZSTR_VAL(str));
if (handler != NULL) { if (handler != NULL) {
xmlCharEncCloseFunc(handler); xmlCharEncCloseFunc(handler);
if (docp->encoding != NULL) { if (docp->encoding != NULL) {
xmlFree((xmlChar *)docp->encoding); xmlFree((xmlChar *)docp->encoding);
} }
docp->encoding = xmlStrdup((const xmlChar *) ZSTR_VAL(str)); docp->encoding = xmlStrdup((const xmlChar *) ZSTR_VAL(str));
} else { } else {
zend_value_error("Invalid document encoding"); zend_value_error("Invalid document encoding");
return FAILURE; return FAILURE;
} }
zend_string_release_ex(str, 0); zend_string_release_ex(str, 0);
return SUCCESS; return SUCCESS;
@ -1166,8 +1166,8 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t source_len, size_t options) /* {{{ */ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t source_len, size_t options) /* {{{ */
{ {
xmlDocPtr ret; xmlDocPtr ret;
xmlParserCtxtPtr ctxt = NULL; xmlParserCtxtPtr ctxt = NULL;
dom_doc_propsptr doc_props; dom_doc_propsptr doc_props;
dom_object *intern; dom_object *intern;
php_libxml_ref_obj *document = NULL; php_libxml_ref_obj *document = NULL;

View file

@ -61,10 +61,10 @@ PHP_METHOD(DOMDocumentFragment, __construct)
needed for hack in appendXML due to libxml bug - no need to share this function */ needed for hack in appendXML due to libxml bug - no need to share this function */
static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) /* {{{ */ static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) /* {{{ */
{ {
xmlAttrPtr prop; xmlAttrPtr prop;
xmlNodePtr cur; xmlNodePtr cur;
if (tree) { if (tree) {
if(tree->type == XML_ELEMENT_NODE) { if(tree->type == XML_ELEMENT_NODE) {
prop = tree->properties; prop = tree->properties;
while (prop != NULL) { while (prop != NULL) {
@ -87,7 +87,7 @@ static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) /* {{{ */
} }
} }
tree->doc = doc; tree->doc = doc;
} }
} }
/* }}} */ /* }}} */

View file

@ -61,9 +61,9 @@ xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const
xmlEntityPtr ret; xmlEntityPtr ret;
ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity)); ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
memset(ret, 0, sizeof(xmlEntity)); memset(ret, 0, sizeof(xmlEntity));
ret->type = XML_NOTATION_NODE; ret->type = XML_NOTATION_NODE;
ret->name = xmlStrdup(name); ret->name = xmlStrdup(name);
ret->ExternalID = xmlStrdup(ExternalID); ret->ExternalID = xmlStrdup(ExternalID);
ret->SystemID = xmlStrdup(SystemID); ret->SystemID = xmlStrdup(SystemID);
ret->length = 0; ret->length = 0;

View file

@ -152,8 +152,8 @@ int dom_element_schema_type_info_read(dom_object *obj, zval *retval)
static xmlNodePtr dom_get_dom1_attribute(xmlNodePtr elem, xmlChar *name) /* {{{ */ static xmlNodePtr dom_get_dom1_attribute(xmlNodePtr elem, xmlChar *name) /* {{{ */
{ {
int len; int len;
const xmlChar *nqname; const xmlChar *nqname;
nqname = xmlSplitQName3(name, &len); nqname = xmlSplitQName3(name, &len);
if (nqname != NULL) { if (nqname != NULL) {
@ -570,9 +570,9 @@ PHP_METHOD(DOMElement, getAttributeNS)
static xmlNsPtr _dom_new_reconNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) /* {{{ */ static xmlNsPtr _dom_new_reconNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) /* {{{ */
{ {
xmlNsPtr def; xmlNsPtr def;
xmlChar prefix[50]; xmlChar prefix[50];
int counter = 1; int counter = 1;
if ((tree == NULL) || (ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) { if ((tree == NULL) || (ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) {
return NULL; return NULL;
@ -883,12 +883,12 @@ PHP_METHOD(DOMElement, setAttributeNodeNS)
RETURN_FALSE; RETURN_FALSE;
} }
nsp = attrp->ns; nsp = attrp->ns;
if (nsp != NULL) { if (nsp != NULL) {
existattrp = xmlHasNsProp(nodep, nsp->href, attrp->name); existattrp = xmlHasNsProp(nodep, nsp->href, attrp->name);
} else { } else {
existattrp = xmlHasProp(nodep, attrp->name); existattrp = xmlHasProp(nodep, attrp->name);
} }
if (existattrp != NULL && existattrp->type != XML_ATTRIBUTE_DECL) { if (existattrp != NULL && existattrp->type != XML_ATTRIBUTE_DECL) {
if ((oldobj = php_dom_object_get_data((xmlNodePtr) existattrp)) != NULL && if ((oldobj = php_dom_object_get_data((xmlNodePtr) existattrp)) != NULL &&

View file

@ -1665,7 +1665,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
buf = xmlAllocOutputBuffer(NULL); buf = xmlAllocOutputBuffer(NULL);
} }
if (buf != NULL) { if (buf != NULL) {
ret = xmlC14NDocSaveTo(docp, nodeset, exclusive, inclusive_ns_prefixes, ret = xmlC14NDocSaveTo(docp, nodeset, exclusive, inclusive_ns_prefixes,
with_comments, buf); with_comments, buf);
} }
@ -1680,9 +1680,9 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
xmlXPathFreeContext(ctxp); xmlXPathFreeContext(ctxp);
} }
if (buf == NULL || ret < 0) { if (buf == NULL || ret < 0) {
RETVAL_FALSE; RETVAL_FALSE;
} else { } else {
if (mode == 0) { if (mode == 0) {
#ifdef LIBXML2_NEW_BUFFER #ifdef LIBXML2_NEW_BUFFER
ret = xmlOutputBufferGetSize(buf); ret = xmlOutputBufferGetSize(buf);
@ -1699,7 +1699,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
RETVAL_EMPTY_STRING(); RETVAL_EMPTY_STRING();
} }
} }
} }
if (buf) { if (buf) {
int bytes; int bytes;

View file

@ -429,7 +429,7 @@ static HashTable* dom_get_debug_info_helper(zend_object *object, int *is_temp) /
static HashTable* dom_get_debug_info(zend_object *object, int *is_temp) /* {{{ */ static HashTable* dom_get_debug_info(zend_object *object, int *is_temp) /* {{{ */
{ {
return dom_get_debug_info_helper(object, is_temp); return dom_get_debug_info_helper(object, is_temp);
} }
/* }}} */ /* }}} */
@ -440,7 +440,7 @@ void *php_dom_export_node(zval *object) /* {{{ */
intern = (php_libxml_node_object *) Z_DOMOBJ_P(object); intern = (php_libxml_node_object *) Z_DOMOBJ_P(object);
if (intern->node) { if (intern->node) {
nodep = intern->node->node; nodep = intern->node->node;
} }
return nodep; return nodep;
@ -1244,7 +1244,7 @@ int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child)
nodep = nodep->parent; nodep = nodep->parent;
} }
return SUCCESS; return SUCCESS;
} }
/* }}} end dom_hierarchy */ /* }}} end dom_hierarchy */

View file

@ -383,8 +383,8 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
} }
ctxp->namespaces = ns; ctxp->namespaces = ns;
ctxp->nsNr = nsnbr; ctxp->nsNr = nsnbr;
xpathobjp = xmlXPathEvalExpression((xmlChar *) expr, ctxp); xpathobjp = xmlXPathEvalExpression((xmlChar *) expr, ctxp);
ctxp->node = NULL; ctxp->node = NULL;

View file

@ -134,12 +134,12 @@ ZEND_INI_MH(OnUpdateDecode)
} }
PHP_INI_BEGIN() PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("exif.encode_unicode", "ISO-8859-15", PHP_INI_ALL, OnUpdateEncode, encode_unicode, zend_exif_globals, exif_globals) STD_PHP_INI_ENTRY("exif.encode_unicode", "ISO-8859-15", PHP_INI_ALL, OnUpdateEncode, encode_unicode, zend_exif_globals, exif_globals)
STD_PHP_INI_ENTRY("exif.decode_unicode_motorola", "UCS-2BE", PHP_INI_ALL, OnUpdateDecode, decode_unicode_be, zend_exif_globals, exif_globals) STD_PHP_INI_ENTRY("exif.decode_unicode_motorola", "UCS-2BE", PHP_INI_ALL, OnUpdateDecode, decode_unicode_be, zend_exif_globals, exif_globals)
STD_PHP_INI_ENTRY("exif.decode_unicode_intel", "UCS-2LE", PHP_INI_ALL, OnUpdateDecode, decode_unicode_le, zend_exif_globals, exif_globals) STD_PHP_INI_ENTRY("exif.decode_unicode_intel", "UCS-2LE", PHP_INI_ALL, OnUpdateDecode, decode_unicode_le, zend_exif_globals, exif_globals)
STD_PHP_INI_ENTRY("exif.encode_jis", "", PHP_INI_ALL, OnUpdateEncode, encode_jis, zend_exif_globals, exif_globals) STD_PHP_INI_ENTRY("exif.encode_jis", "", PHP_INI_ALL, OnUpdateEncode, encode_jis, zend_exif_globals, exif_globals)
STD_PHP_INI_ENTRY("exif.decode_jis_motorola", "JIS", PHP_INI_ALL, OnUpdateDecode, decode_jis_be, zend_exif_globals, exif_globals) STD_PHP_INI_ENTRY("exif.decode_jis_motorola", "JIS", PHP_INI_ALL, OnUpdateDecode, decode_jis_be, zend_exif_globals, exif_globals)
STD_PHP_INI_ENTRY("exif.decode_jis_intel", "JIS", PHP_INI_ALL, OnUpdateDecode, decode_jis_le, zend_exif_globals, exif_globals) STD_PHP_INI_ENTRY("exif.decode_jis_intel", "JIS", PHP_INI_ALL, OnUpdateDecode, decode_jis_le, zend_exif_globals, exif_globals)
PHP_INI_END() PHP_INI_END()
/* }}} */ /* }}} */
@ -4654,7 +4654,7 @@ PHP_FUNCTION(exif_read_data)
exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Height", ImageInfo.Thumbnail.height); exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Height", ImageInfo.Thumbnail.height);
exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Width", ImageInfo.Thumbnail.width); exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "Thumbnail.Width", ImageInfo.Thumbnail.width);
} }
EFREE_IF(sections_str); EFREE_IF(sections_str);
#ifdef EXIF_DEBUG #ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Adding image infos"); exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Adding image infos");
@ -4779,7 +4779,7 @@ PHP_FUNCTION(exif_imagetype)
char *imagefile; char *imagefile;
size_t imagefile_len; size_t imagefile_len;
php_stream * stream; php_stream * stream;
int itype = 0; int itype = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &imagefile, &imagefile_len) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &imagefile, &imagefile_len) == FAILURE) {
RETURN_THROWS(); RETURN_THROWS();

View file

@ -382,7 +382,7 @@ static ffi_type *zend_ffi_get_type(zend_ffi_type *type) /* {{{ */
zend_ffi_type_kind kind = type->kind; zend_ffi_type_kind kind = type->kind;
again: again:
switch (kind) { switch (kind) {
case ZEND_FFI_TYPE_FLOAT: case ZEND_FFI_TYPE_FLOAT:
return &ffi_type_float; return &ffi_type_float;
case ZEND_FFI_TYPE_DOUBLE: case ZEND_FFI_TYPE_DOUBLE:
@ -685,7 +685,7 @@ static zend_always_inline int zend_ffi_zval_to_cdata(void *ptr, zend_ffi_type *t
zend_ffi_type_kind kind = type->kind; zend_ffi_type_kind kind = type->kind;
again: again:
switch (kind) { switch (kind) {
case ZEND_FFI_TYPE_FLOAT: case ZEND_FFI_TYPE_FLOAT:
dval = zval_get_double(value); dval = zval_get_double(value);
*(float*)ptr = dval; *(float*)ptr = dval;
@ -1948,7 +1948,7 @@ static HashTable *zend_ffi_cdata_get_debug_info(zend_object *obj, int *is_temp)
return NULL; return NULL;
} }
switch (type->kind) { switch (type->kind) {
case ZEND_FFI_TYPE_BOOL: case ZEND_FFI_TYPE_BOOL:
case ZEND_FFI_TYPE_CHAR: case ZEND_FFI_TYPE_CHAR:
case ZEND_FFI_TYPE_ENUM: case ZEND_FFI_TYPE_ENUM:
@ -2444,7 +2444,7 @@ static int zend_ffi_pass_arg(zval *arg, zend_ffi_type *type, ffi_type **pass_typ
ZVAL_DEREF(arg); ZVAL_DEREF(arg);
again: again:
switch (kind) { switch (kind) {
case ZEND_FFI_TYPE_FLOAT: case ZEND_FFI_TYPE_FLOAT:
dval = zval_get_double(arg); dval = zval_get_double(arg);
*pass_type = &ffi_type_float; *pass_type = &ffi_type_float;
@ -3160,7 +3160,7 @@ static zend_ffi *zend_ffi_load(const char *filename, bool preload) /* {{{ */
if (fd < 0 || read(fd, code, code_size) != code_size) { if (fd < 0 || read(fd, code, code_size) != code_size) {
if (preload) { if (preload) {
zend_error(E_WARNING, "FFI: Failed pre-loading '%s', cannot read_file", filename); zend_error(E_WARNING, "FFI: Failed pre-loading '%s', cannot read_file", filename);
} else { } else {
zend_throw_error(zend_ffi_exception_ce, "Failed loading '%s', cannot read_file", filename); zend_throw_error(zend_ffi_exception_ce, "Failed loading '%s', cannot read_file", filename);
} }
efree(code); efree(code);
@ -4594,27 +4594,27 @@ static ZEND_COLD zend_never_inline void zend_bad_array_access(zend_class_entry *
static ZEND_COLD zval *zend_fake_read_dimension(zend_object *obj, zval *offset, int type, zval *rv) /* {{{ */ static ZEND_COLD zval *zend_fake_read_dimension(zend_object *obj, zval *offset, int type, zval *rv) /* {{{ */
{ {
zend_bad_array_access(obj->ce); zend_bad_array_access(obj->ce);
return NULL; return NULL;
} }
/* }}} */ /* }}} */
static ZEND_COLD void zend_fake_write_dimension(zend_object *obj, zval *offset, zval *value) /* {{{ */ static ZEND_COLD void zend_fake_write_dimension(zend_object *obj, zval *offset, zval *value) /* {{{ */
{ {
zend_bad_array_access(obj->ce); zend_bad_array_access(obj->ce);
} }
/* }}} */ /* }}} */
static ZEND_COLD int zend_fake_has_dimension(zend_object *obj, zval *offset, int check_empty) /* {{{ */ static ZEND_COLD int zend_fake_has_dimension(zend_object *obj, zval *offset, int check_empty) /* {{{ */
{ {
zend_bad_array_access(obj->ce); zend_bad_array_access(obj->ce);
return 0; return 0;
} }
/* }}} */ /* }}} */
static ZEND_COLD void zend_fake_unset_dimension(zend_object *obj, zval *offset) /* {{{ */ static ZEND_COLD void zend_fake_unset_dimension(zend_object *obj, zval *offset) /* {{{ */
{ {
zend_bad_array_access(obj->ce); zend_bad_array_access(obj->ce);
} }
/* }}} */ /* }}} */
@ -4626,28 +4626,28 @@ static ZEND_COLD zend_never_inline void zend_bad_property_access(zend_class_entr
static ZEND_COLD zval *zend_fake_read_property(zend_object *obj, zend_string *member, int type, void **cache_slot, zval *rv) /* {{{ */ static ZEND_COLD zval *zend_fake_read_property(zend_object *obj, zend_string *member, int type, void **cache_slot, zval *rv) /* {{{ */
{ {
zend_bad_property_access(obj->ce); zend_bad_property_access(obj->ce);
return &EG(uninitialized_zval); return &EG(uninitialized_zval);
} }
/* }}} */ /* }}} */
static ZEND_COLD zval *zend_fake_write_property(zend_object *obj, zend_string *member, zval *value, void **cache_slot) /* {{{ */ static ZEND_COLD zval *zend_fake_write_property(zend_object *obj, zend_string *member, zval *value, void **cache_slot) /* {{{ */
{ {
zend_bad_array_access(obj->ce); zend_bad_array_access(obj->ce);
return value; return value;
} }
/* }}} */ /* }}} */
static ZEND_COLD int zend_fake_has_property(zend_object *obj, zend_string *member, int has_set_exists, void **cache_slot) /* {{{ */ static ZEND_COLD int zend_fake_has_property(zend_object *obj, zend_string *member, int has_set_exists, void **cache_slot) /* {{{ */
{ {
zend_bad_array_access(obj->ce); zend_bad_array_access(obj->ce);
return 0; return 0;
} }
/* }}} */ /* }}} */
static ZEND_COLD void zend_fake_unset_property(zend_object *obj, zend_string *member, void **cache_slot) /* {{{ */ static ZEND_COLD void zend_fake_unset_property(zend_object *obj, zend_string *member, void **cache_slot) /* {{{ */
{ {
zend_bad_array_access(obj->ce); zend_bad_array_access(obj->ce);
} }
/* }}} */ /* }}} */

View file

@ -34,7 +34,7 @@
/* {{{ FETCH_DOUBLE_OPTION(var_name, option_name) */ /* {{{ FETCH_DOUBLE_OPTION(var_name, option_name) */
#define FETCH_DOUBLE_OPTION(var_name, option_name) \ #define FETCH_DOUBLE_OPTION(var_name, option_name) \
var_name = 0; \ var_name = 0; \
var_name##_set = 0; \ var_name##_set = 0; \
if (option_array) { \ if (option_array) { \
if ((option_val = zend_hash_str_find(Z_ARRVAL_P(option_array), option_name, sizeof(option_name) - 1)) != NULL) { \ if ((option_val = zend_hash_str_find(Z_ARRVAL_P(option_array), option_name, sizeof(option_name) - 1)) != NULL) { \
@ -46,7 +46,7 @@
/* {{{ FETCH_LONG_OPTION(var_name, option_name) */ /* {{{ FETCH_LONG_OPTION(var_name, option_name) */
#define FETCH_LONG_OPTION(var_name, option_name) \ #define FETCH_LONG_OPTION(var_name, option_name) \
var_name = 0; \ var_name = 0; \
var_name##_set = 0; \ var_name##_set = 0; \
if (option_array) { \ if (option_array) { \
if ((option_val = zend_hash_str_find(Z_ARRVAL_P(option_array), option_name, sizeof(option_name) - 1)) != NULL) { \ if ((option_val = zend_hash_str_find(Z_ARRVAL_P(option_array), option_name, sizeof(option_name) - 1)) != NULL) { \
@ -770,7 +770,7 @@ static int _php_filter_validate_ipv6(char *str, size_t str_len) /* {{{ */
/* check for bundled IPv4 */ /* check for bundled IPv4 */
ipv4 = memchr(str, '.', str_len); ipv4 = memchr(str, '.', str_len);
if (ipv4) { if (ipv4) {
while (ipv4 > str && *(ipv4-1) != ':') { while (ipv4 > str && *(ipv4-1) != ':') {
ipv4--; ipv4--;
} }

View file

@ -1428,8 +1428,8 @@ int single_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t size) {
int int
my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len)
{ {
zend_long size, sent; zend_long size, sent;
int n; int n;
size = len; size = len;
while (size) { while (size) {

View file

@ -1856,7 +1856,7 @@ ZEND_FUNCTION(gmp_com)
/* {{{ Finds next prime of a */ /* {{{ Finds next prime of a */
ZEND_FUNCTION(gmp_nextprime) ZEND_FUNCTION(gmp_nextprime)
{ {
gmp_unary_op(mpz_nextprime); gmp_unary_op(mpz_nextprime);
} }
/* }}} */ /* }}} */
@ -1883,10 +1883,10 @@ ZEND_FUNCTION(gmp_setbit)
zend_argument_value_error(2, "must be greater than or equal to 0"); zend_argument_value_error(2, "must be greater than or equal to 0");
RETURN_THROWS(); RETURN_THROWS();
} }
if (index / GMP_NUMB_BITS >= INT_MAX) { if (index / GMP_NUMB_BITS >= INT_MAX) {
zend_argument_value_error(2, "must be less than %d * %d", INT_MAX, GMP_NUMB_BITS); zend_argument_value_error(2, "must be less than %d * %d", INT_MAX, GMP_NUMB_BITS);
RETURN_THROWS(); RETURN_THROWS();
} }
gmpnum_a = GET_GMP_FROM_ZVAL(a_arg); gmpnum_a = GET_GMP_FROM_ZVAL(a_arg);

View file

@ -79,14 +79,14 @@ PHP_HASH_API void PHP_JOAATFinal(unsigned char digest[4], PHP_JOAAT_CTX * contex
static uint32_t static uint32_t
joaat_buf(void *buf, size_t len, uint32_t hval) joaat_buf(void *buf, size_t len, uint32_t hval)
{ {
size_t i; size_t i;
unsigned char *input = (unsigned char *)buf; unsigned char *input = (unsigned char *)buf;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
hval += input[i]; hval += input[i];
hval += (hval << 10); hval += (hval << 10);
hval ^= (hval >> 6); hval ^= (hval >> 6);
} }
return hval; return hval;
} }

View file

@ -412,14 +412,14 @@ static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd
#ifdef ICONV_BROKEN_IGNORE #ifdef ICONV_BROKEN_IGNORE
static int _php_check_ignore(const char *charset) static int _php_check_ignore(const char *charset)
{ {
size_t clen = strlen(charset); size_t clen = strlen(charset);
if (clen >= 9 && strcmp("//IGNORE", charset+clen-8) == 0) { if (clen >= 9 && strcmp("//IGNORE", charset+clen-8) == 0) {
return 1; return 1;
} }
if (clen >= 19 && strcmp("//IGNORE//TRANSLIT", charset+clen-18) == 0) { if (clen >= 19 && strcmp("//IGNORE//TRANSLIT", charset+clen-18) == 0) {
return 1; return 1;
} }
return 0; return 0;
} }
#else #else
#define _php_check_ignore(x) (0) #define _php_check_ignore(x) (0)

View file

@ -72,15 +72,15 @@ static void php_converter_default_callback(zval *return_value, zval *zobj, zend_
char chars[127]; char chars[127];
int8_t chars_len = sizeof(chars); int8_t chars_len = sizeof(chars);
UErrorCode uerror = U_ZERO_ERROR; UErrorCode uerror = U_ZERO_ERROR;
if(!objval->src) { if(!objval->src) {
php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initialized yet"); php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initialized yet");
chars[0] = 0x1A; chars[0] = 0x1A;
chars[1] = 0; chars[1] = 0;
chars_len = 1; chars_len = 1;
ZEND_TRY_ASSIGN_REF_LONG(error, U_INVALID_STATE_ERROR); ZEND_TRY_ASSIGN_REF_LONG(error, U_INVALID_STATE_ERROR);
RETVAL_STRINGL(chars, chars_len); RETVAL_STRINGL(chars, chars_len);
return; return;
} }
/* Yes, this is fairly wasteful at first glance, /* Yes, this is fairly wasteful at first glance,
* but considering that the alternative is to store * but considering that the alternative is to store
@ -197,7 +197,7 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode
} }
default: default:
php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR, php_converter_throw_failure(objval, U_ILLEGAL_ARGUMENT_ERROR,
"toUCallback() specified illegal type for substitution character"); "toUCallback() specified illegal type for substitution character");
} }
} }
/* }}} */ /* }}} */
@ -345,7 +345,7 @@ static inline bool php_converter_set_callbacks(php_converter_object *objval, UCo
} }
ucnv_setToUCallBack(cnv, (UConverterToUCallback)php_converter_to_u_callback, (const void*)objval, ucnv_setToUCallBack(cnv, (UConverterToUCallback)php_converter_to_u_callback, (const void*)objval,
NULL, NULL, &error); NULL, NULL, &error);
if (U_FAILURE(error)) { if (U_FAILURE(error)) {
THROW_UFAILURE(objval, "ucnv_setToUCallBack", error); THROW_UFAILURE(objval, "ucnv_setToUCallBack", error);
ret = 0; ret = 0;
@ -353,7 +353,7 @@ static inline bool php_converter_set_callbacks(php_converter_object *objval, UCo
error = U_ZERO_ERROR; error = U_ZERO_ERROR;
ucnv_setFromUCallBack(cnv, (UConverterFromUCallback)php_converter_from_u_callback, (const void*)objval, ucnv_setFromUCallBack(cnv, (UConverterFromUCallback)php_converter_from_u_callback, (const void*)objval,
NULL, NULL, &error); NULL, NULL, &error);
if (U_FAILURE(error)) { if (U_FAILURE(error)) {
THROW_UFAILURE(objval, "ucnv_setFromUCallBack", error); THROW_UFAILURE(objval, "ucnv_setFromUCallBack", error);
ret = 0; ret = 0;
@ -364,9 +364,8 @@ static inline bool php_converter_set_callbacks(php_converter_object *objval, UCo
/* {{{ php_converter_set_encoding */ /* {{{ php_converter_set_encoding */
static bool php_converter_set_encoding(php_converter_object *objval, static bool php_converter_set_encoding(php_converter_object *objval,
UConverter **pcnv, UConverter **pcnv,
const char *enc, size_t enc_len const char *enc, size_t enc_len) {
) {
UErrorCode error = U_ZERO_ERROR; UErrorCode error = U_ZERO_ERROR;
UConverter *cnv = ucnv_open(enc, &error); UConverter *cnv = ucnv_open(enc, &error);
@ -461,8 +460,8 @@ PHP_METHOD(UConverter, getSourceEncoding) {
/* {{{ */ /* {{{ */
PHP_METHOD(UConverter, getDestinationEncoding) { PHP_METHOD(UConverter, getDestinationEncoding) {
php_converter_object *objval = CONV_GET(ZEND_THIS); php_converter_object *objval = CONV_GET(ZEND_THIS);
php_converter_do_get_encoding(objval, objval->dest, INTERNAL_FUNCTION_PARAM_PASSTHRU); php_converter_do_get_encoding(objval, objval->dest, INTERNAL_FUNCTION_PARAM_PASSTHRU);
} }
/* }}} */ /* }}} */
@ -701,7 +700,7 @@ PHP_METHOD(UConverter, reasonText) {
/* {{{ */ /* {{{ */
PHP_METHOD(UConverter, convert) { PHP_METHOD(UConverter, convert) {
php_converter_object *objval = CONV_GET(ZEND_THIS); php_converter_object *objval = CONV_GET(ZEND_THIS);
char *str; char *str;
size_t str_len; size_t str_len;
zend_string *ret; zend_string *ret;

View file

@ -739,7 +739,7 @@ PHP_FUNCTION(grapheme_extract)
ZVAL_DEREF(next); ZVAL_DEREF(next);
/* initialize next */ /* initialize next */
zval_ptr_dtor(next); zval_ptr_dtor(next);
ZVAL_LONG(next, lstart); ZVAL_LONG(next, lstart);
} }
} }
@ -794,7 +794,7 @@ PHP_FUNCTION(grapheme_extract)
*/ */
if ( -1 != grapheme_ascii_check((unsigned char *)pstr, MIN(size + 1, str_len)) ) { if ( -1 != grapheme_ascii_check((unsigned char *)pstr, MIN(size + 1, str_len)) ) {
size_t nsize = MIN(size, str_len); size_t nsize = MIN(size, str_len);
if ( NULL != next ) { if ( NULL != next ) {
ZVAL_LONG(next, start+nsize); ZVAL_LONG(next, start+nsize);
} }

View file

@ -50,39 +50,39 @@ grapheme_close_global_iterator( void )
void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char **sub_str, int32_t *sub_str_len) void grapheme_substr_ascii(char *str, size_t str_len, int32_t f, int32_t l, char **sub_str, int32_t *sub_str_len)
{ {
int32_t str_len2 = (int32_t)str_len; /* in order to avoid signed/unsigned problems */ int32_t str_len2 = (int32_t)str_len; /* in order to avoid signed/unsigned problems */
*sub_str = NULL; *sub_str = NULL;
if(str_len > INT32_MAX) { if(str_len > INT32_MAX) {
/* We can not return long strings from ICU functions, so we won't here too */ /* We can not return long strings from ICU functions, so we won't here too */
return; return;
} }
/* if "from" position is negative, count start position from the end /* if "from" position is negative, count start position from the end
* of the string * of the string
*/ */
if (f < 0) { if (f < 0) {
f = str_len2 + f; f = str_len2 + f;
if (f < 0) { if (f < 0) {
f = 0; f = 0;
} }
} else if (f > str_len2) { } else if (f > str_len2) {
f = str_len2; f = str_len2;
} }
/* if "length" position is negative, set it to the length /* if "length" position is negative, set it to the length
* needed to stop that many chars from the end of the string * needed to stop that many chars from the end of the string
*/ */
if (l < 0) { if (l < 0) {
l = (str_len2 - f) + l; l = (str_len2 - f) + l;
if (l < 0) { if (l < 0) {
l = 0; l = 0;
} }
} else if (l > str_len2 - f) { } else if (l > str_len2 - f) {
l = str_len2 - f; l = str_len2 - f;
} }
*sub_str = str + f; *sub_str = str + f;
*sub_str_len = l; *sub_str_len = l;
} }
/* }}} */ /* }}} */
@ -317,8 +317,7 @@ int32_t grapheme_get_haystack_offset(UBreakIterator* bi, int32_t offset)
/* }}} */ /* }}} */
/* {{{ grapheme_strrpos_ascii: borrowed from the php ext/standard/string.c */ /* {{{ grapheme_strrpos_ascii: borrowed from the php ext/standard/string.c */
zend_long zend_long grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset)
grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset)
{ {
char *p, *e; char *p, *e;

View file

@ -392,7 +392,7 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name ,&loc_name_len ) == FAILURE) { &loc_name ,&loc_name_len ) == FAILURE) {
RETURN_THROWS(); RETURN_THROWS();
} }
if(loc_name_len == 0) { if(loc_name_len == 0) {
loc_name = intl_locale_get_default(); loc_name = intl_locale_get_default();
@ -473,7 +473,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
zend_string* u8str; zend_string* u8str;
char* msg = NULL; char* msg = NULL;
intl_error_reset( NULL ); intl_error_reset( NULL );
@ -484,13 +484,13 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
RETURN_THROWS(); RETURN_THROWS();
} }
if(loc_name_len > ULOC_FULLNAME_CAPACITY) { if(loc_name_len > ULOC_FULLNAME_CAPACITY) {
/* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */ /* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */
spprintf(&msg , 0, "locale_get_display_%s : name too long", tag_name ); spprintf(&msg , 0, "locale_get_display_%s : name too long", tag_name );
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 ); intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 );
efree(msg); efree(msg);
RETURN_FALSE; RETURN_FALSE;
} }
if(loc_name_len == 0) { if(loc_name_len == 0) {
loc_name = intl_locale_get_default(); loc_name = intl_locale_get_default();
@ -519,10 +519,10 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
free_loc_name = 1; free_loc_name = 1;
} }
/* Get the disp_value for the given locale */ /* Get the disp_value for the given locale */
do{ do{
disp_name = erealloc( disp_name , buflen * sizeof(UChar) ); disp_name = erealloc( disp_name , buflen * sizeof(UChar) );
disp_name_len = buflen; disp_name_len = buflen;
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){ if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
buflen = uloc_getDisplayLanguage ( mod_loc_name , disp_loc_name , disp_name , disp_name_len , &status); buflen = uloc_getDisplayLanguage ( mod_loc_name , disp_loc_name , disp_name , disp_name_len , &status);
@ -587,28 +587,28 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
/* {{{ gets the name for the $locale in $in_locale or default_locale */ /* {{{ gets the name for the $locale in $in_locale or default_locale */
PHP_FUNCTION(locale_get_display_name) PHP_FUNCTION(locale_get_display_name)
{ {
get_icu_disp_value_src_php( DISP_NAME , INTERNAL_FUNCTION_PARAM_PASSTHRU ); get_icu_disp_value_src_php( DISP_NAME , INTERNAL_FUNCTION_PARAM_PASSTHRU );
} }
/* }}} */ /* }}} */
/* {{{ gets the language for the $locale in $in_locale or default_locale */ /* {{{ gets the language for the $locale in $in_locale or default_locale */
PHP_FUNCTION(locale_get_display_language) PHP_FUNCTION(locale_get_display_language)
{ {
get_icu_disp_value_src_php( LOC_LANG_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU ); get_icu_disp_value_src_php( LOC_LANG_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU );
} }
/* }}} */ /* }}} */
/* {{{ gets the script for the $locale in $in_locale or default_locale */ /* {{{ gets the script for the $locale in $in_locale or default_locale */
PHP_FUNCTION(locale_get_display_script) PHP_FUNCTION(locale_get_display_script)
{ {
get_icu_disp_value_src_php( LOC_SCRIPT_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU ); get_icu_disp_value_src_php( LOC_SCRIPT_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU );
} }
/* }}} */ /* }}} */
/* {{{ gets the region for the $locale in $in_locale or default_locale */ /* {{{ gets the region for the $locale in $in_locale or default_locale */
PHP_FUNCTION(locale_get_display_region) PHP_FUNCTION(locale_get_display_region)
{ {
get_icu_disp_value_src_php( LOC_REGION_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU ); get_icu_disp_value_src_php( LOC_REGION_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU );
} }
/* }}} */ /* }}} */
@ -622,7 +622,7 @@ PHP_FUNCTION(locale_get_display_region)
*/ */
PHP_FUNCTION(locale_get_display_variant) PHP_FUNCTION(locale_get_display_variant)
{ {
get_icu_disp_value_src_php( LOC_VARIANT_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU ); get_icu_disp_value_src_php( LOC_VARIANT_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU );
} }
/* }}} */ /* }}} */
@ -634,33 +634,32 @@ PHP_FUNCTION(locale_get_display_variant)
*/ */
PHP_FUNCTION( locale_get_keywords ) PHP_FUNCTION( locale_get_keywords )
{ {
UEnumeration* e = NULL; UEnumeration* e = NULL;
UErrorCode status = U_ZERO_ERROR; UErrorCode status = U_ZERO_ERROR;
const char* kw_key = NULL; const char* kw_key = NULL;
int32_t kw_key_len = 0; int32_t kw_key_len = 0;
const char* loc_name = NULL; const char* loc_name = NULL;
size_t loc_name_len = 0; size_t loc_name_len = 0;
intl_error_reset( NULL ); intl_error_reset( NULL );
if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE) &loc_name, &loc_name_len ) == FAILURE)
{ {
RETURN_THROWS(); RETURN_THROWS();
} }
INTL_CHECK_LOCALE_LEN(strlen(loc_name)); INTL_CHECK_LOCALE_LEN(strlen(loc_name));
if(loc_name_len == 0) { if(loc_name_len == 0) {
loc_name = intl_locale_get_default(); loc_name = intl_locale_get_default();
} }
/* Get the keywords */ /* Get the keywords */
e = uloc_openKeywords( loc_name, &status ); e = uloc_openKeywords( loc_name, &status );
if( e != NULL ) if( e != NULL ) {
{
/* /*
ICU expects the buffer to be allocated before calling the function ICU expects the buffer to be allocated before calling the function
and so the buffer size has been explicitly specified and so the buffer size has been explicitly specified
@ -669,10 +668,10 @@ PHP_FUNCTION( locale_get_keywords )
*/ */
/* Traverse it, filling the return array. */ /* Traverse it, filling the return array. */
array_init( return_value ); array_init( return_value );
while( ( kw_key = uenum_next( e, &kw_key_len, &status ) ) != NULL ){ while( ( kw_key = uenum_next( e, &kw_key_len, &status ) ) != NULL ){
int32_t kw_value_len = 100; int32_t kw_value_len = 100;
zend_string *kw_value_str = zend_string_alloc(kw_value_len, 0); zend_string *kw_value_str = zend_string_alloc(kw_value_len, 0);
/* Get the keyword value for each keyword */ /* Get the keyword value for each keyword */
@ -690,15 +689,15 @@ PHP_FUNCTION( locale_get_keywords )
zend_string_efree( kw_value_str ); zend_string_efree( kw_value_str );
} }
zend_array_destroy(Z_ARR_P(return_value)); zend_array_destroy(Z_ARR_P(return_value));
RETURN_FALSE; RETURN_FALSE;
} }
add_assoc_str( return_value, (char *)kw_key, kw_value_str); add_assoc_str( return_value, (char *)kw_key, kw_value_str);
} /* end of while */ } /* end of while */
} /* end of if e!=NULL */ } /* end of if e!=NULL */
uenum_close( e ); uenum_close( e );
} }
/* }}} */ /* }}} */
@ -1032,23 +1031,23 @@ static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name)
/* {{{ parses a locale-id into an array the different parts of it */ /* {{{ parses a locale-id into an array the different parts of it */
PHP_FUNCTION(locale_parse) PHP_FUNCTION(locale_parse)
{ {
const char* loc_name = NULL; const char* loc_name = NULL;
size_t loc_name_len = 0; size_t loc_name_len = 0;
int grOffset = 0; int grOffset = 0;
intl_error_reset( NULL ); intl_error_reset( NULL );
if(zend_parse_parameters( ZEND_NUM_ARGS(), "s", if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE) &loc_name, &loc_name_len ) == FAILURE)
{ {
RETURN_THROWS(); RETURN_THROWS();
} }
INTL_CHECK_LOCALE_LEN(strlen(loc_name)); INTL_CHECK_LOCALE_LEN(strlen(loc_name));
if(loc_name_len == 0) { if(loc_name_len == 0) {
loc_name = intl_locale_get_default(); loc_name = intl_locale_get_default();
} }
array_init( return_value ); array_init( return_value );
@ -1108,7 +1107,7 @@ PHP_FUNCTION(locale_get_all_variants)
add_next_index_stringl( return_value, token , strlen(token)); add_next_index_stringl( return_value, token , strlen(token));
/* tokenize on the "_" or "-" and stop at singleton if any */ /* tokenize on the "_" or "-" and stop at singleton if any */
while( (token = php_strtok_r(NULL , DELIMITER, &saved_ptr)) && (strlen(token)>1) ){ while( (token = php_strtok_r(NULL , DELIMITER, &saved_ptr)) && (strlen(token)>1) ){
add_next_index_stringl( return_value, token , strlen(token)); add_next_index_stringl( return_value, token , strlen(token));
} }
} }
if( variant ){ if( variant ){
@ -1127,27 +1126,27 @@ static int strToMatch(const char* str ,char *retstr)
const char* anchor1 = NULL; const char* anchor1 = NULL;
int result = 0; int result = 0;
if( (!str) || str[0] == '\0'){ if( (!str) || str[0] == '\0'){
return result; return result;
} else { } else {
anchor = retstr; anchor = retstr;
anchor1 = str; anchor1 = str;
while( (*str)!='\0' ){ while( (*str)!='\0' ){
if( *str == '-' ){ if( *str == '-' ){
*retstr = '_'; *retstr = '_';
} else { } else {
*retstr = tolower(*str); *retstr = tolower(*str);
}
str++;
retstr++;
} }
str++; *retstr = '\0';
retstr++; retstr= anchor;
str= anchor1;
result = 1;
} }
*retstr = '\0';
retstr= anchor;
str= anchor1;
result = 1;
}
return(result); return(result);
} }
/* }}} */ /* }}} */

View file

@ -306,10 +306,10 @@ PHP_FUNCTION( normalizer_get_raw_decomposition )
UChar32 codepoint = -1; UChar32 codepoint = -1;
int32_t offset = 0; int32_t offset = 0;
UErrorCode status = U_ZERO_ERROR; UErrorCode status = U_ZERO_ERROR;
const UNormalizer2 *norm; const UNormalizer2 *norm;
UChar decomposition[32]; UChar decomposition[32];
int32_t decomposition_length; int32_t decomposition_length;
zend_long form = NORMALIZER_DEFAULT; zend_long form = NORMALIZER_DEFAULT;

View file

@ -98,8 +98,8 @@ const char *intl_locale_get_default( void )
/* {{{ INI Settings */ /* {{{ INI Settings */
PHP_INI_BEGIN() PHP_INI_BEGIN()
STD_PHP_INI_ENTRY(LOCALE_INI_NAME, NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_locale, zend_intl_globals, intl_globals) STD_PHP_INI_ENTRY(LOCALE_INI_NAME, NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_locale, zend_intl_globals, intl_globals)
STD_PHP_INI_ENTRY("intl.error_level", "0", PHP_INI_ALL, OnUpdateLong, error_level, zend_intl_globals, intl_globals) STD_PHP_INI_ENTRY("intl.error_level", "0", PHP_INI_ALL, OnUpdateLong, error_level, zend_intl_globals, intl_globals)
STD_PHP_INI_BOOLEAN("intl.use_exceptions", "0", PHP_INI_ALL, OnUpdateBool, use_exceptions, zend_intl_globals, intl_globals) STD_PHP_INI_BOOLEAN("intl.use_exceptions", "0", PHP_INI_ALL, OnUpdateBool, use_exceptions, zend_intl_globals, intl_globals)
PHP_INI_END() PHP_INI_END()
/* }}} */ /* }}} */
@ -250,15 +250,15 @@ PHP_MINIT_FUNCTION( intl )
PHP_MSHUTDOWN_FUNCTION( intl ) PHP_MSHUTDOWN_FUNCTION( intl )
{ {
const char *cleanup; const char *cleanup;
/* For the default locale php.ini setting */ /* For the default locale php.ini setting */
UNREGISTER_INI_ENTRIES(); UNREGISTER_INI_ENTRIES();
cleanup = getenv(EXPLICIT_CLEANUP_ENV_VAR); cleanup = getenv(EXPLICIT_CLEANUP_ENV_VAR);
if (cleanup != NULL && !(cleanup[0] == '0' && cleanup[1] == '\0')) { if (cleanup != NULL && !(cleanup[0] == '0' && cleanup[1] == '\0')) {
u_cleanup(); u_cleanup();
} }
return SUCCESS; return SUCCESS;
} }
/* }}} */ /* }}} */
@ -306,7 +306,7 @@ PHP_MINFO_FUNCTION( intl )
php_info_print_table_row( 2, "ICU Unicode version", U_UNICODE_VERSION ); php_info_print_table_row( 2, "ICU Unicode version", U_UNICODE_VERSION );
php_info_print_table_end(); php_info_print_table_end();
/* For the default locale php.ini setting */ /* For the default locale php.ini setting */
DISPLAY_INI_ENTRIES() ; DISPLAY_INI_ENTRIES() ;
} }
/* }}} */ /* }}} */

View file

@ -167,8 +167,8 @@ static void resourcebundle_array_fetch(zend_object *object, zval *offset, zval *
{ {
int32_t meindex = 0; int32_t meindex = 0;
char * mekey = NULL; char * mekey = NULL;
bool is_numeric = 0; bool is_numeric = 0;
char *pbuf; char *pbuf;
ResourceBundle_object *rb; ResourceBundle_object *rb;
rb = php_intl_resourcebundle_fetch_object(object); rb = php_intl_resourcebundle_fetch_object(object);

View file

@ -66,8 +66,8 @@ static zend_object *spoofchecker_clone_obj(zend_object *object) /* {{{ */
zend_object *new_obj_val; zend_object *new_obj_val;
Spoofchecker_object *sfo, *new_sfo; Spoofchecker_object *sfo, *new_sfo;
sfo = php_intl_spoofchecker_fetch_object(object); sfo = php_intl_spoofchecker_fetch_object(object);
intl_error_reset(SPOOFCHECKER_ERROR_P(sfo)); intl_error_reset(SPOOFCHECKER_ERROR_P(sfo));
new_obj_val = Spoofchecker_ce_ptr->create_object(object->ce); new_obj_val = Spoofchecker_ce_ptr->create_object(object->ce);
new_sfo = php_intl_spoofchecker_fetch_object(new_obj_val); new_sfo = php_intl_spoofchecker_fetch_object(new_obj_val);

View file

@ -114,7 +114,7 @@ static zend_object *Transliterator_object_create( zend_class_entry *ce )
intern = zend_object_alloc(sizeof(Transliterator_object), ce); intern = zend_object_alloc(sizeof(Transliterator_object), ce);
zend_object_std_init( &intern->zo, ce ); zend_object_std_init( &intern->zo, ce );
object_properties_init( &intern->zo, ce ); object_properties_init( &intern->zo, ce );
transliterator_object_init( intern ); transliterator_object_init( intern );
intern->zo.handlers = &Transliterator_handlers; intern->zo.handlers = &Transliterator_handlers;

View file

@ -179,7 +179,7 @@ PHP_FUNCTION( transliterator_create_from_rules )
} }
zval_ptr_dtor( return_value ); zval_ptr_dtor( return_value );
RETURN_NULL(); RETURN_NULL();
} }
transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) ); transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) );
/* no need to close the transliterator manually on construction error */ /* no need to close the transliterator manually on construction error */
INTL_METHOD_CHECK_STATUS_OR_NULL( to, "transliterator_create_from_rules: internal constructor call failed" ); INTL_METHOD_CHECK_STATUS_OR_NULL( to, "transliterator_create_from_rules: internal constructor call failed" );

View file

@ -105,9 +105,9 @@ MBSTRING_API int php_unicode_is_prop(unsigned long code, ...)
} }
static inline unsigned mph_hash(unsigned d, unsigned x) { static inline unsigned mph_hash(unsigned d, unsigned x) {
x ^= d; x ^= d;
x = ((x >> 16) ^ x) * 0x45d9f3b; x = ((x >> 16) ^ x) * 0x45d9f3b;
return x; return x;
} }
#define CODE_NOT_FOUND ((unsigned) -1) #define CODE_NOT_FOUND ((unsigned) -1)

View file

@ -44,7 +44,7 @@ if (!obj->ptr || !(MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { \
return FAILURE; \ return FAILURE; \
} else { \ } else { \
CHECK_STATUS(statusval, quiet);\ CHECK_STATUS(statusval, quiet);\
p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql;\ p = (MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql;\
} }
#define MYSQLI_GET_RESULT(statusval) \ #define MYSQLI_GET_RESULT(statusval) \
@ -173,8 +173,8 @@ static int link_affected_rows_read(mysqli_object *obj, zval *retval, bool quiet)
CHECK_STATUS(MYSQLI_STATUS_VALID, quiet); CHECK_STATUS(MYSQLI_STATUS_VALID, quiet);
mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
ZEND_ASSERT(mysql); ZEND_ASSERT(mysql);
rc = mysql_affected_rows(mysql->mysql); rc = mysql_affected_rows(mysql->mysql);
@ -200,7 +200,7 @@ static int link_error_list_read(mysqli_object *obj, zval *retval, bool quiet)
CHECK_STATUS(MYSQLI_STATUS_VALID, quiet); CHECK_STATUS(MYSQLI_STATUS_VALID, quiet);
mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
if (mysql) { if (mysql) {
array_init(retval); array_init(retval);
@ -260,7 +260,7 @@ static int result_type_read(mysqli_object *obj, zval *retval, bool quiet)
MYSQL_RES *p; MYSQL_RES *p;
CHECK_STATUS(MYSQLI_STATUS_VALID, quiet); CHECK_STATUS(MYSQLI_STATUS_VALID, quiet);
p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; p = (MYSQL_RES *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
ZEND_ASSERT(p); ZEND_ASSERT(p);
ZVAL_LONG(retval, mysqli_result_is_unbuffered(p) ? MYSQLI_USE_RESULT:MYSQLI_STORE_RESULT); ZVAL_LONG(retval, mysqli_result_is_unbuffered(p) ? MYSQLI_USE_RESULT:MYSQLI_STORE_RESULT);
@ -312,7 +312,7 @@ static int stmt_id_read(mysqli_object *obj, zval *retval, bool quiet)
CHECK_STATUS(MYSQLI_STATUS_VALID, quiet); CHECK_STATUS(MYSQLI_STATUS_VALID, quiet);
p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
ZEND_ASSERT(p); ZEND_ASSERT(p);
ZVAL_LONG(retval, mysqli_stmt_get_id(p->stmt)); ZVAL_LONG(retval, mysqli_stmt_get_id(p->stmt));
@ -329,7 +329,7 @@ static int stmt_affected_rows_read(mysqli_object *obj, zval *retval, bool quiet)
CHECK_STATUS(MYSQLI_STATUS_VALID, quiet); CHECK_STATUS(MYSQLI_STATUS_VALID, quiet);
p = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; p = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
ZEND_ASSERT(p); ZEND_ASSERT(p);
rc = mysql_stmt_affected_rows(p->stmt); rc = mysql_stmt_affected_rows(p->stmt);
@ -356,7 +356,7 @@ static int stmt_error_list_read(mysqli_object *obj, zval *retval, bool quiet)
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED, quiet); CHECK_STATUS(MYSQLI_STATUS_INITIALIZED, quiet);
stmt = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; stmt = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
if (stmt && stmt->stmt) { if (stmt && stmt->stmt) {
array_init(retval); array_init(retval);
#ifdef MYSQLI_USE_MYSQLND #ifdef MYSQLI_USE_MYSQLND

View file

@ -424,9 +424,9 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
auth_packet.auth_data_len = auth_plugin_data_len; auth_packet.auth_data_len = auth_plugin_data_len;
auth_packet.auth_plugin_name = auth_protocol; auth_packet.auth_plugin_name = auth_protocol;
if (conn->server_capabilities & CLIENT_CONNECT_ATTRS) { if (conn->server_capabilities & CLIENT_CONNECT_ATTRS) {
auth_packet.connect_attr = conn->options->connect_attr; auth_packet.connect_attr = conn->options->connect_attr;
} }
if (conn->m->get_server_version(conn) >= 50123) { if (conn->m->get_server_version(conn) >= 50123) {
auth_packet.charset_no = conn->charset->nr; auth_packet.charset_no = conn->charset->nr;

View file

@ -410,7 +410,7 @@ static unsigned int check_mb_utf16(const char * const start, const char * const
static uint32_t mysqlnd_mbcharlen_utf16(const unsigned int utf16) static uint32_t mysqlnd_mbcharlen_utf16(const unsigned int utf16)
{ {
return UTF16_HIGH_HEAD(utf16) ? 4 : 2; return UTF16_HIGH_HEAD(utf16) ? 4 : 2;
} }
/* }}} */ /* }}} */

View file

@ -514,7 +514,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags)(MYSQLND_CONN_DATA *
} }
#endif #endif
if (conn->options->connect_attr && zend_hash_num_elements(conn->options->connect_attr)) { if (conn->options->connect_attr && zend_hash_num_elements(conn->options->connect_attr)) {
mysql_flags |= CLIENT_CONNECT_ATTRS; mysql_flags |= CLIENT_CONNECT_ATTRS;
} }
@ -814,9 +814,9 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle,
if (PASS == conn->m->local_tx_start(conn, this_func)) { if (PASS == conn->m->local_tx_start(conn, this_func)) {
mysqlnd_options4(conn_handle, MYSQL_OPT_CONNECT_ATTR_ADD, "_client_name", "mysqlnd"); mysqlnd_options4(conn_handle, MYSQL_OPT_CONNECT_ATTR_ADD, "_client_name", "mysqlnd");
if (hostname.l > 0) { if (hostname.l > 0) {
mysqlnd_options4(conn_handle, MYSQL_OPT_CONNECT_ATTR_ADD, "_server_host", hostname.s); mysqlnd_options4(conn_handle, MYSQL_OPT_CONNECT_ATTR_ADD, "_server_host", hostname.s);
} }
ret = conn->m->connect(conn, hostname, username, password, database, port, socket_or_pipe, mysql_flags); ret = conn->m->connect(conn, hostname, username, password, database, port, socket_or_pipe, mysql_flags);
conn->m->local_tx_end(conn, this_func, FAIL); conn->m->local_tx_end(conn, this_func, FAIL);

View file

@ -237,14 +237,14 @@ ps_fetch_time(zval * zv, const MYSQLND_FIELD * const field, const unsigned int p
t.time_type = MYSQLND_TIMESTAMP_TIME; t.time_type = MYSQLND_TIMESTAMP_TIME;
} }
if (field->decimals > 0 && field->decimals < 7) { if (field->decimals > 0 && field->decimals < 7) {
ZVAL_STR(zv, zend_strpprintf(0, "%s%02u:%02u:%02u.%0*u", ZVAL_STR(zv, zend_strpprintf(0, "%s%02u:%02u:%02u.%0*u",
(t.neg ? "-" : ""), t.hour, t.minute, t.second, field->decimals, (t.neg ? "-" : ""), t.hour, t.minute, t.second, field->decimals,
(uint32_t) (t.second_part / pow(10, 6 - field->decimals)))); (uint32_t) (t.second_part / pow(10, 6 - field->decimals))));
} else { } else {
ZVAL_STR(zv, zend_strpprintf(0, "%s%02u:%02u:%02u", ZVAL_STR(zv, zend_strpprintf(0, "%s%02u:%02u:%02u",
(t.neg ? "-" : ""), t.hour, t.minute, t.second)); (t.neg ? "-" : ""), t.hour, t.minute, t.second));
} }
DBG_VOID_RETURN; DBG_VOID_RETURN;
} }
/* }}} */ /* }}} */
@ -315,14 +315,14 @@ ps_fetch_datetime(zval * zv, const MYSQLND_FIELD * const field, const unsigned i
t.time_type = MYSQLND_TIMESTAMP_DATETIME; t.time_type = MYSQLND_TIMESTAMP_DATETIME;
} }
if (field->decimals > 0 && field->decimals < 7) { if (field->decimals > 0 && field->decimals < 7) {
ZVAL_STR(zv, zend_strpprintf(0, "%04u-%02u-%02u %02u:%02u:%02u.%0*u", ZVAL_STR(zv, zend_strpprintf(0, "%04u-%02u-%02u %02u:%02u:%02u.%0*u",
t.year, t.month, t.day, t.hour, t.minute, t.second, field->decimals, t.year, t.month, t.day, t.hour, t.minute, t.second, field->decimals,
(uint32_t) (t.second_part / pow(10, 6 - field->decimals)))); (uint32_t) (t.second_part / pow(10, 6 - field->decimals))));
} else { } else {
ZVAL_STR(zv, zend_strpprintf(0, "%04u-%02u-%02u %02u:%02u:%02u", ZVAL_STR(zv, zend_strpprintf(0, "%04u-%02u-%02u %02u:%02u:%02u",
t.year, t.month, t.day, t.hour, t.minute, t.second)); t.year, t.month, t.day, t.hour, t.minute, t.second));
} }
DBG_VOID_RETURN; DBG_VOID_RETURN;
} }
/* }}} */ /* }}} */

View file

@ -417,7 +417,7 @@ php_mysqlnd_greet_read(MYSQLND_CONN_DATA * conn, void * _packet)
/* backtrack one byte, the 0x0 at the end of the scramble in 5.1 and previous */ /* backtrack one byte, the 0x0 at the end of the scramble in 5.1 and previous */
p--; p--;
/* Additional 16 bits for server capabilities */ /* Additional 16 bits for server capabilities */
DBG_INF_FMT("additional 5.5+ caps=%u\n", (uint32_t) uint2korr(pad_start)); DBG_INF_FMT("additional 5.5+ caps=%u\n", (uint32_t) uint2korr(pad_start));
packet->server_capabilities |= ((uint32_t) uint2korr(pad_start)) << 16; packet->server_capabilities |= ((uint32_t) uint2korr(pad_start)) << 16;
/* And a length of the server scramble in one byte */ /* And a length of the server scramble in one byte */

View file

@ -640,7 +640,7 @@ void php_oci_define_hash_dtor(zval *data)
zval_ptr_dtor(&define->val); zval_ptr_dtor(&define->val);
efree(define); efree(define);
} }
/* }}} */ /* }}} */
@ -1885,7 +1885,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
} else { } else {
RETURN_FALSE; RETURN_FALSE;
} }
} }
#endif /* OCI_MAJOR_VERSION */ #endif /* OCI_MAJOR_VERSION */
if (placeholder == NULL) { if (placeholder == NULL) {
@ -2046,7 +2046,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus); OCI_G(errcode) = php_oci_error(OCI_G(err), errstatus);
iserror = 1; iserror = 1;
goto exit_create_spool; goto exit_create_spool;
} }
/* }}} */ /* }}} */
/* {{{ Set the edition attribute on the auth handle */ /* {{{ Set the edition attribute on the auth handle */

View file

@ -663,8 +663,8 @@ void php_oci_lob_free (php_oci_descriptor *descriptor)
if (zend_hash_num_elements(descriptor->connection->descriptors) == 0) { if (zend_hash_num_elements(descriptor->connection->descriptors) == 0) {
descriptor->connection->descriptor_count = 0; descriptor->connection->descriptor_count = 0;
} else { } else {
/* delete descriptor from the hash */ /* delete descriptor from the hash */
zend_hash_index_del(descriptor->connection->descriptors, descriptor->index); zend_hash_index_del(descriptor->connection->descriptors, descriptor->index);
if (descriptor->index + 1 == descriptor->connection->descriptor_count) { if (descriptor->index + 1 == descriptor->connection->descriptor_count) {
/* If the descriptor being freed is the end-most one /* If the descriptor being freed is the end-most one
* allocated, then the descriptor_count is reduced so * allocated, then the descriptor_count is reduced so
@ -752,7 +752,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename)
return 0; return 0;
} }
/* }}} */ /* }}} */
/* {{{ php_oci_lob_append() /* {{{ php_oci_lob_append()
Append data to the end of the LOB */ Append data to the end of the LOB */

View file

@ -258,7 +258,7 @@ int php_oci_statement_fetch(php_oci_statement *statement, ub4 nrows)
if (statement->has_descr && statement->columns) { if (statement->has_descr && statement->columns) {
zend_hash_apply(statement->columns, php_oci_cleanup_pre_fetch); zend_hash_apply(statement->columns, php_oci_cleanup_pre_fetch);
} }
#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) #if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2)))
PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch2, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, 0, OCI_DEFAULT)); PHP_OCI_CALL_RETURN(errstatus, OCIStmtFetch2, (statement->stmt, statement->err, nrows, OCI_FETCH_NEXT, 0, OCI_DEFAULT));

View file

@ -1150,7 +1150,7 @@ PHP_FUNCTION(odbc_cursor)
SQLUSMALLINT max_len; SQLUSMALLINT max_len;
SQLSMALLINT len; SQLSMALLINT len;
char *cursorname; char *cursorname;
odbc_result *result; odbc_result *result;
RETCODE rc; RETCODE rc;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
@ -2063,7 +2063,7 @@ PHP_FUNCTION(odbc_result_all)
break; break;
} }
} }
php_printf("</tr>\n"); php_printf("</tr>\n");
#ifdef HAVE_SQL_EXTENDED_FETCH #ifdef HAVE_SQL_EXTENDED_FETCH
if (result->fetch_abs) if (result->fetch_abs)

View file

@ -214,7 +214,7 @@ static inline zend_string* accel_getcwd(void)
void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason) void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason)
{ {
if ((((double) ZSMMG(wasted_shared_memory)) / ZCG(accel_directives).memory_consumption) >= ZCG(accel_directives).max_wasted_percentage) { if ((((double) ZSMMG(wasted_shared_memory)) / ZCG(accel_directives).memory_consumption) >= ZCG(accel_directives).max_wasted_percentage) {
zend_accel_schedule_restart(reason); zend_accel_schedule_restart(reason);
} }
} }
@ -936,7 +936,7 @@ static accel_time_t zend_get_file_handle_timestamp_win(zend_file_handle *file_ha
SystemTimeToFileTime (&st, &utc_base_ft); SystemTimeToFileTime (&st, &utc_base_ft);
utc_base = (((unsigned __int64)utc_base_ft.dwHighDateTime) << 32) + utc_base_ft.dwLowDateTime; utc_base = (((unsigned __int64)utc_base_ft.dwHighDateTime) << 32) + utc_base_ft.dwLowDateTime;
} }
if (file_handle->opened_path && GetFileAttributesEx(file_handle->opened_path->val, GetFileExInfoStandard, &fdata) != 0) { if (file_handle->opened_path && GetFileAttributesEx(file_handle->opened_path->val, GetFileExInfoStandard, &fdata) != 0) {
unsigned __int64 ftime; unsigned __int64 ftime;
@ -1145,16 +1145,16 @@ zend_string *accel_make_persistent_key(zend_string *str)
ZSTR_LEN(&ZCG(key)) = 0; ZSTR_LEN(&ZCG(key)) = 0;
/* CWD and include_path don't matter for absolute file names and streams */ /* CWD and include_path don't matter for absolute file names and streams */
if (IS_ABSOLUTE_PATH(path, path_length)) { if (IS_ABSOLUTE_PATH(path, path_length)) {
/* pass */ /* pass */
} else if (UNEXPECTED(is_stream_path(path))) { } else if (UNEXPECTED(is_stream_path(path))) {
if (!is_cacheable_stream_path(path)) { if (!is_cacheable_stream_path(path)) {
return NULL; return NULL;
} }
/* pass */ /* pass */
} else if (UNEXPECTED(!ZCG(accel_directives).use_cwd)) { } else if (UNEXPECTED(!ZCG(accel_directives).use_cwd)) {
/* pass */ /* pass */
} else { } else {
const char *include_path = NULL, *cwd = NULL; const char *include_path = NULL, *cwd = NULL;
int include_path_len = 0, cwd_len = 0; int include_path_len = 0, cwd_len = 0;
zend_string *parent_script = NULL; zend_string *parent_script = NULL;
@ -1703,9 +1703,9 @@ static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handl
accel_time_t timestamp = 0; accel_time_t timestamp = 0;
uint32_t orig_compiler_options = 0; uint32_t orig_compiler_options = 0;
/* Try to open file */ /* Try to open file */
if (file_handle->type == ZEND_HANDLE_FILENAME) { if (file_handle->type == ZEND_HANDLE_FILENAME) {
if (accelerator_orig_zend_stream_open_function(file_handle) != SUCCESS) { if (accelerator_orig_zend_stream_open_function(file_handle) != SUCCESS) {
*op_array_p = NULL; *op_array_p = NULL;
if (!EG(exception)) { if (!EG(exception)) {
if (type == ZEND_REQUIRE) { if (type == ZEND_REQUIRE) {
@ -1715,8 +1715,8 @@ static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handl
} }
} }
return NULL; return NULL;
} }
} }
/* check blacklist right after ensuring that file was opened */ /* check blacklist right after ensuring that file was opened */
if (file_handle->opened_path && zend_accel_blacklist_is_blacklisted(&accel_blacklist, ZSTR_VAL(file_handle->opened_path), ZSTR_LEN(file_handle->opened_path))) { if (file_handle->opened_path && zend_accel_blacklist_is_blacklisted(&accel_blacklist, ZSTR_VAL(file_handle->opened_path), ZSTR_LEN(file_handle->opened_path))) {
@ -1824,8 +1824,8 @@ static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handl
efree(op_array); /* we have valid persistent_script, so it's safe to free op_array */ efree(op_array); /* we have valid persistent_script, so it's safe to free op_array */
/* Fill in the ping_auto_globals_mask for the new script. If jit for auto globals is enabled we /* Fill in the ping_auto_globals_mask for the new script. If jit for auto globals is enabled we
will have to ping the used auto global variables before execution */ will have to ping the used auto global variables before execution */
if (PG(auto_globals_jit)) { if (PG(auto_globals_jit)) {
new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals(); new_persistent_script->ping_auto_globals_mask = zend_accel_get_auto_globals();
} }
@ -1924,27 +1924,26 @@ zend_op_array *file_cache_compile_file(zend_file_handle *file_handle, int type)
int check_persistent_script_access(zend_persistent_script *persistent_script) int check_persistent_script_access(zend_persistent_script *persistent_script)
{ {
char *phar_path, *ptr; char *phar_path, *ptr;
int ret; int ret;
if ((ZSTR_LEN(persistent_script->script.filename)<sizeof("phar://.phar")) || if ((ZSTR_LEN(persistent_script->script.filename)<sizeof("phar://.phar")) ||
memcmp(ZSTR_VAL(persistent_script->script.filename), "phar://", sizeof("phar://")-1)) { memcmp(ZSTR_VAL(persistent_script->script.filename), "phar://", sizeof("phar://")-1)) {
return access(ZSTR_VAL(persistent_script->script.filename), R_OK) != 0; return access(ZSTR_VAL(persistent_script->script.filename), R_OK) != 0;
} else { } else {
/* we got a cached file from .phar, so we have to strip prefix and path inside .phar to check access() */ /* we got a cached file from .phar, so we have to strip prefix and path inside .phar to check access() */
phar_path = estrdup(ZSTR_VAL(persistent_script->script.filename)+sizeof("phar://")-1); phar_path = estrdup(ZSTR_VAL(persistent_script->script.filename)+sizeof("phar://")-1);
if ((ptr = strstr(phar_path, ".phar/")) != NULL) if ((ptr = strstr(phar_path, ".phar/")) != NULL)
{ {
*(ptr+sizeof(".phar/")-2) = 0; /* strip path inside .phar file */ *(ptr+sizeof(".phar/")-2) = 0; /* strip path inside .phar file */
} }
ret = access(phar_path, R_OK) != 0; ret = access(phar_path, R_OK) != 0;
efree(phar_path); efree(phar_path);
return ret; return ret;
} }
} }
/* zend_compile() replacement */ /* zend_compile() replacement */
zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type) zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
{ {
@ -2160,9 +2159,9 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
SHM_UNPROTECT(); SHM_UNPROTECT();
/* Try and cache the script and assume that it is returned from_shared_memory. /* Try and cache the script and assume that it is returned from_shared_memory.
* If it isn't compile_and_cache_file() changes the flag to 0 * If it isn't compile_and_cache_file() changes the flag to 0
*/ */
from_shared_memory = 0; from_shared_memory = 0;
if (persistent_script) { if (persistent_script) {
persistent_script = cache_script_in_shared_memory(persistent_script, key, &from_shared_memory); persistent_script = cache_script_in_shared_memory(persistent_script, key, &from_shared_memory);
} }
@ -2228,8 +2227,8 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
SHM_PROTECT(); SHM_PROTECT();
HANDLE_UNBLOCK_INTERRUPTIONS(); HANDLE_UNBLOCK_INTERRUPTIONS();
/* Fetch jit auto globals used in the script before execution */ /* Fetch jit auto globals used in the script before execution */
if (persistent_script->ping_auto_globals_mask & ~ZCG(auto_globals_mask)) { if (persistent_script->ping_auto_globals_mask & ~ZCG(auto_globals_mask)) {
zend_accel_set_auto_globals(persistent_script->ping_auto_globals_mask & ~ZCG(auto_globals_mask)); zend_accel_set_auto_globals(persistent_script->ping_auto_globals_mask & ~ZCG(auto_globals_mask));
} }
@ -2324,7 +2323,7 @@ static zend_class_entry* zend_accel_inheritance_cache_add(zend_class_entry *ce,
ZEND_ASSERT(ce->ce_flags & ZEND_ACC_LINKED); ZEND_ASSERT(ce->ce_flags & ZEND_ACC_LINKED);
if (!ZCG(accelerator_enabled) || if (!ZCG(accelerator_enabled) ||
(ZCSG(restart_in_progress) && accel_restart_is_active())) { (ZCSG(restart_in_progress) && accel_restart_is_active())) {
return NULL; return NULL;
} }
@ -2781,8 +2780,8 @@ static int accelerator_remove_cb(zend_extension *element1, zend_extension *eleme
element1->op_array_handler = NULL; element1->op_array_handler = NULL;
#ifdef __DEBUG_MESSAGES__ #ifdef __DEBUG_MESSAGES__
fprintf(stderr, ACCELERATOR_PRODUCT_NAME " is disabled: %s\n", (zps_failure_reason ? zps_failure_reason : "unknown error")); fprintf(stderr, ACCELERATOR_PRODUCT_NAME " is disabled: %s\n", (zps_failure_reason ? zps_failure_reason : "unknown error"));
fflush(stderr); fflush(stderr);
#endif #endif
} }
@ -3457,7 +3456,7 @@ static void preload_shutdown(void)
zval *zv; zval *zv;
#if 0 #if 0
if (EG(zend_constants)) { if (EG(zend_constants)) {
ZEND_HASH_REVERSE_FOREACH_VAL(EG(zend_constants), zv) { ZEND_HASH_REVERSE_FOREACH_VAL(EG(zend_constants), zv) {
zend_constant *c = Z_PTR_P(zv); zend_constant *c = Z_PTR_P(zv);
if (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) { if (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) {
@ -3467,7 +3466,7 @@ static void preload_shutdown(void)
} }
#endif #endif
if (EG(function_table)) { if (EG(function_table)) {
ZEND_HASH_REVERSE_FOREACH_VAL(EG(function_table), zv) { ZEND_HASH_REVERSE_FOREACH_VAL(EG(function_table), zv) {
zend_function *func = Z_PTR_P(zv); zend_function *func = Z_PTR_P(zv);
if (func->type == ZEND_INTERNAL_FUNCTION) { if (func->type == ZEND_INTERNAL_FUNCTION) {
@ -5094,7 +5093,7 @@ ZEND_EXT_API zend_extension zend_extension_entry = {
NULL, /* shutdown */ NULL, /* shutdown */
NULL, /* per-script activation */ NULL, /* per-script activation */
#ifdef HAVE_JIT #ifdef HAVE_JIT
accel_deactivate, /* per-script deactivation */ accel_deactivate, /* per-script deactivation */
#else #else
NULL, /* per-script deactivation */ NULL, /* per-script deactivation */
#endif #endif

View file

@ -1280,7 +1280,7 @@ static int zend_jit_op_array_analyze1(const zend_op_array *op_array, zend_script
} }
#endif #endif
/* TODO: move this to zend_cfg.c ? */ /* TODO: move this to zend_cfg.c ? */
if (!op_array->function_name) { if (!op_array->function_name) {
ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; ssa->cfg.flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS;
} }

View file

@ -491,7 +491,7 @@ static zend_ssa *zend_jit_trace_build_ssa(const zend_op_array *op_array, zend_sc
jit_extension = jit_extension =
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array); (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
jit_extension->func_info.num = 0; jit_extension->func_info.num = 0;
jit_extension->func_info.flags &= ZEND_FUNC_JIT_ON_FIRST_EXEC jit_extension->func_info.flags &= ZEND_FUNC_JIT_ON_FIRST_EXEC
| ZEND_FUNC_JIT_ON_PROF_REQUEST | ZEND_FUNC_JIT_ON_PROF_REQUEST
| ZEND_FUNC_JIT_ON_HOT_COUNTERS | ZEND_FUNC_JIT_ON_HOT_COUNTERS

View file

@ -771,7 +771,7 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
opline = EX(opline); opline = EX(opline);
#endif #endif
op_array = &EX(func)->op_array; op_array = &EX(func)->op_array;
jit_extension = jit_extension =
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array); (zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
if (UNEXPECTED(!jit_extension) if (UNEXPECTED(!jit_extension)

View file

@ -53,7 +53,7 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
fd = VM_MAKE_TAG(251U); fd = VM_MAKE_TAG(251U);
#endif #endif
#ifdef PROT_MAX #ifdef PROT_MAX
flags |= PROT_MAX(PROT_READ | PROT_WRITE | PROT_EXEC); flags |= PROT_MAX(PROT_READ | PROT_WRITE | PROT_EXEC);
#endif #endif
#ifdef MAP_HUGETLB #ifdef MAP_HUGETLB
size_t huge_page_size = 2 * 1024 * 1024; size_t huge_page_size = 2 * 1024 * 1024;

View file

@ -54,14 +54,14 @@ static void zend_win_error_message(int type, char *msg, int err)
ev_msgs[0] = msg; ev_msgs[0] = msg;
ev_msgs[1] = buf; ev_msgs[1] = buf;
ReportEvent(h, // event log handle ReportEvent(h, // event log handle
EVENTLOG_ERROR_TYPE, // event type EVENTLOG_ERROR_TYPE, // event type
0, // category zero 0, // category zero
err, // event identifier err, // event identifier
NULL, // no user security identifier NULL, // no user security identifier
2, // one substitution string 2, // one substitution string
0, // no data 0, // no data
ev_msgs, // pointer to string array ev_msgs, // pointer to string array
NULL); // pointer to data NULL); // pointer to data
DeregisterEventSource(h); DeregisterEventSource(h);
zend_accel_error(type, "%s", msg); zend_accel_error(type, "%s", msg);

View file

@ -191,9 +191,9 @@ zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, z
int zend_accel_hash_unlink(zend_accel_hash *accel_hash, zend_string *key) int zend_accel_hash_unlink(zend_accel_hash *accel_hash, zend_string *key)
{ {
zend_ulong hash_value; zend_ulong hash_value;
zend_ulong index; zend_ulong index;
zend_accel_hash_entry *entry, *last_entry=NULL; zend_accel_hash_entry *entry, *last_entry=NULL;
hash_value = zend_string_hash_val(key); hash_value = zend_string_hash_val(key);
#ifndef ZEND_WIN32 #ifndef ZEND_WIN32

View file

@ -56,7 +56,7 @@
zend_string_hash_val(str); \ zend_string_hash_val(str); \
zend_set_str_gc_flags(str); \ zend_set_str_gc_flags(str); \
} \ } \
} while (0) } while (0)
#define zend_accel_memdup_string(str) do { \ #define zend_accel_memdup_string(str) do { \
zend_string *new_str = zend_shared_alloc_get_xlat_entry(str); \ zend_string *new_str = zend_shared_alloc_get_xlat_entry(str); \
if (new_str) { \ if (new_str) { \
@ -67,7 +67,7 @@
zend_string_hash_val(str); \ zend_string_hash_val(str); \
zend_set_str_gc_flags(str); \ zend_set_str_gc_flags(str); \
} \ } \
} while (0) } while (0)
#define zend_accel_store_interned_string(str) do { \ #define zend_accel_store_interned_string(str) do { \
if (!IS_ACCEL_INTERNED(str)) { \ if (!IS_ACCEL_INTERNED(str)) { \
zend_accel_store_string(str); \ zend_accel_store_string(str); \
@ -522,12 +522,12 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
orig_literals = op_array->literals; orig_literals = op_array->literals;
#if ZEND_USE_ABS_CONST_ADDR #if ZEND_USE_ABS_CONST_ADDR
p = zend_shared_memdup_put_free(op_array->literals, sizeof(zval) * op_array->last_literal); p = zend_shared_memdup_put_free(op_array->literals, sizeof(zval) * op_array->last_literal);
#else #else
p = zend_shared_memdup_put(op_array->literals, sizeof(zval) * op_array->last_literal); p = zend_shared_memdup_put(op_array->literals, sizeof(zval) * op_array->last_literal);
#endif #endif
end = p + op_array->last_literal; end = p + op_array->last_literal;
op_array->literals = p; op_array->literals = p;
while (p < end) { while (p < end) {
zend_persist_zval(p); zend_persist_zval(p);
p++; p++;
@ -1131,7 +1131,7 @@ void zend_update_parent_ce(zend_class_entry *ce)
ce->iterator_funcs_ptr->zf_key = zend_hash_str_find_ptr(&ce->function_table, "key", sizeof("key") - 1); ce->iterator_funcs_ptr->zf_key = zend_hash_str_find_ptr(&ce->function_table, "key", sizeof("key") - 1);
ce->iterator_funcs_ptr->zf_current = zend_hash_str_find_ptr(&ce->function_table, "current", sizeof("current") - 1); ce->iterator_funcs_ptr->zf_current = zend_hash_str_find_ptr(&ce->function_table, "current", sizeof("current") - 1);
ce->iterator_funcs_ptr->zf_next = zend_hash_str_find_ptr(&ce->function_table, "next", sizeof("next") - 1); ce->iterator_funcs_ptr->zf_next = zend_hash_str_find_ptr(&ce->function_table, "next", sizeof("next") - 1);
} }
} }
} }
@ -1243,13 +1243,13 @@ static void zend_accel_persist_class_table(HashTable *class_table)
JIT_G(on) = 0; JIT_G(on) = 0;
#endif #endif
zend_hash_persist(class_table); zend_hash_persist(class_table);
ZEND_HASH_FOREACH_BUCKET(class_table, p) { ZEND_HASH_FOREACH_BUCKET(class_table, p) {
ZEND_ASSERT(p->key != NULL); ZEND_ASSERT(p->key != NULL);
zend_accel_store_interned_string(p->key); zend_accel_store_interned_string(p->key);
Z_CE(p->val) = zend_persist_class_entry(Z_CE(p->val)); Z_CE(p->val) = zend_persist_class_entry(Z_CE(p->val));
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
ZEND_HASH_FOREACH_BUCKET(class_table, p) { ZEND_HASH_FOREACH_BUCKET(class_table, p) {
if (EXPECTED(Z_TYPE(p->val) != IS_ALIAS_PTR)) { if (EXPECTED(Z_TYPE(p->val) != IS_ALIAS_PTR)) {
ce = Z_PTR(p->val); ce = Z_PTR(p->val);
zend_update_parent_ce(ce); zend_update_parent_ce(ce);

View file

@ -193,7 +193,7 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array)
&& !zend_shared_alloc_get_xlat_entry(&op_array->function_name)) { && !zend_shared_alloc_get_xlat_entry(&op_array->function_name)) {
zend_shared_alloc_register_xlat_entry(&op_array->function_name, old_name); zend_shared_alloc_register_xlat_entry(&op_array->function_name, old_name);
} }
} }
if (op_array->scope) { if (op_array->scope) {
if (zend_shared_alloc_get_xlat_entry(op_array->opcodes)) { if (zend_shared_alloc_get_xlat_entry(op_array->opcodes)) {

View file

@ -78,7 +78,7 @@ void zend_shared_alloc_create_lock(char *lockfile_path)
int val; int val;
#ifdef ZTS #ifdef ZTS
zts_lock = tsrm_mutex_alloc(); zts_lock = tsrm_mutex_alloc();
#endif #endif
snprintf(lockfile_name, sizeof(lockfile_name), "%s/%sXXXXXX", lockfile_path, SEM_FILENAME_PREFIX); snprintf(lockfile_name, sizeof(lockfile_name), "%s/%sXXXXXX", lockfile_path, SEM_FILENAME_PREFIX);

View file

@ -130,28 +130,28 @@ static void pcre_handle_exec_error(int pcre_code) /* {{{ */
static const char *php_pcre_get_error_msg(php_pcre_error_code error_code) /* {{{ */ static const char *php_pcre_get_error_msg(php_pcre_error_code error_code) /* {{{ */
{ {
switch (error_code) { switch (error_code) {
case PHP_PCRE_NO_ERROR: case PHP_PCRE_NO_ERROR:
return "No error"; return "No error";
case PHP_PCRE_INTERNAL_ERROR: case PHP_PCRE_INTERNAL_ERROR:
return "Internal error"; return "Internal error";
case PHP_PCRE_BAD_UTF8_ERROR: case PHP_PCRE_BAD_UTF8_ERROR:
return "Malformed UTF-8 characters, possibly incorrectly encoded"; return "Malformed UTF-8 characters, possibly incorrectly encoded";
case PHP_PCRE_BAD_UTF8_OFFSET_ERROR: case PHP_PCRE_BAD_UTF8_OFFSET_ERROR:
return "The offset did not correspond to the beginning of a valid UTF-8 code point"; return "The offset did not correspond to the beginning of a valid UTF-8 code point";
case PHP_PCRE_BACKTRACK_LIMIT_ERROR: case PHP_PCRE_BACKTRACK_LIMIT_ERROR:
return "Backtrack limit exhausted"; return "Backtrack limit exhausted";
case PHP_PCRE_RECURSION_LIMIT_ERROR: case PHP_PCRE_RECURSION_LIMIT_ERROR:
return "Recursion limit exhausted"; return "Recursion limit exhausted";
#ifdef HAVE_PCRE_JIT_SUPPORT #ifdef HAVE_PCRE_JIT_SUPPORT
case PHP_PCRE_JIT_STACKLIMIT_ERROR: case PHP_PCRE_JIT_STACKLIMIT_ERROR:
return "JIT stack limit exhausted"; return "JIT stack limit exhausted";
#endif #endif
default: default:
return "Unknown error"; return "Unknown error";
} }
} }
/* }}} */ /* }}} */
@ -736,8 +736,8 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
case 'U': coptions |= PCRE2_UNGREEDY; break; case 'U': coptions |= PCRE2_UNGREEDY; break;
case 'u': coptions |= PCRE2_UTF; case 'u': coptions |= PCRE2_UTF;
/* In PCRE, by default, \d, \D, \s, \S, \w, and \W recognize only ASCII /* In PCRE, by default, \d, \D, \s, \S, \w, and \W recognize only ASCII
characters, even in UTF-8 mode. However, this can be changed by setting characters, even in UTF-8 mode. However, this can be changed by setting
the PCRE2_UCP option. */ the PCRE2_UCP option. */
#ifdef PCRE2_UCP #ifdef PCRE2_UCP
coptions |= PCRE2_UCP; coptions |= PCRE2_UCP;
#endif #endif
@ -2982,9 +2982,9 @@ PHP_FUNCTION(preg_last_error)
/* {{{ Returns the error message of the last regexp execution. */ /* {{{ Returns the error message of the last regexp execution. */
PHP_FUNCTION(preg_last_error_msg) PHP_FUNCTION(preg_last_error_msg)
{ {
ZEND_PARSE_PARAMETERS_NONE(); ZEND_PARSE_PARAMETERS_NONE();
RETURN_STRING(php_pcre_get_error_msg(PCRE_G(error_code))); RETURN_STRING(php_pcre_get_error_msg(PCRE_G(error_code)));
} }
/* }}} */ /* }}} */
@ -2992,7 +2992,7 @@ PHP_FUNCTION(preg_last_error_msg)
zend_module_entry pcre_module_entry = { zend_module_entry pcre_module_entry = {
STANDARD_MODULE_HEADER, STANDARD_MODULE_HEADER,
"pcre", "pcre",
ext_functions, ext_functions,
PHP_MINIT(pcre), PHP_MINIT(pcre),
PHP_MSHUTDOWN(pcre), PHP_MSHUTDOWN(pcre),

View file

@ -464,7 +464,7 @@ static bool pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val)
} }
if (lval < 0) { if (lval < 0) {
/* TODO: Johannes, can we throw a warning here? */ /* TODO: Johannes, can we throw a warning here? */
((pdo_mysql_db_handle *)dbh->driver_data)->max_buffer_size = 1024*1024; ((pdo_mysql_db_handle *)dbh->driver_data)->max_buffer_size = 1024*1024;
PDO_DBG_INF_FMT("Adjusting invalid buffer size to =%l", ((pdo_mysql_db_handle *)dbh->driver_data)->max_buffer_size); PDO_DBG_INF_FMT("Adjusting invalid buffer size to =%l", ((pdo_mysql_db_handle *)dbh->driver_data)->max_buffer_size);
} else { } else {
((pdo_mysql_db_handle *)dbh->driver_data)->max_buffer_size = lval; ((pdo_mysql_db_handle *)dbh->driver_data)->max_buffer_size = lval;

View file

@ -717,48 +717,48 @@ static char *type_to_name_native(int type) /* {{{ */
{ {
#define PDO_MYSQL_NATIVE_TYPE_NAME(x) case FIELD_TYPE_##x: return #x; #define PDO_MYSQL_NATIVE_TYPE_NAME(x) case FIELD_TYPE_##x: return #x;
switch (type) { switch (type) {
PDO_MYSQL_NATIVE_TYPE_NAME(STRING) PDO_MYSQL_NATIVE_TYPE_NAME(STRING)
PDO_MYSQL_NATIVE_TYPE_NAME(VAR_STRING) PDO_MYSQL_NATIVE_TYPE_NAME(VAR_STRING)
#ifdef FIELD_TYPE_TINY #ifdef FIELD_TYPE_TINY
PDO_MYSQL_NATIVE_TYPE_NAME(TINY) PDO_MYSQL_NATIVE_TYPE_NAME(TINY)
#endif #endif
#ifdef FIELD_TYPE_BIT #ifdef FIELD_TYPE_BIT
PDO_MYSQL_NATIVE_TYPE_NAME(BIT) PDO_MYSQL_NATIVE_TYPE_NAME(BIT)
#endif #endif
PDO_MYSQL_NATIVE_TYPE_NAME(SHORT) PDO_MYSQL_NATIVE_TYPE_NAME(SHORT)
PDO_MYSQL_NATIVE_TYPE_NAME(LONG) PDO_MYSQL_NATIVE_TYPE_NAME(LONG)
PDO_MYSQL_NATIVE_TYPE_NAME(LONGLONG) PDO_MYSQL_NATIVE_TYPE_NAME(LONGLONG)
PDO_MYSQL_NATIVE_TYPE_NAME(INT24) PDO_MYSQL_NATIVE_TYPE_NAME(INT24)
PDO_MYSQL_NATIVE_TYPE_NAME(FLOAT) PDO_MYSQL_NATIVE_TYPE_NAME(FLOAT)
PDO_MYSQL_NATIVE_TYPE_NAME(DOUBLE) PDO_MYSQL_NATIVE_TYPE_NAME(DOUBLE)
PDO_MYSQL_NATIVE_TYPE_NAME(DECIMAL) PDO_MYSQL_NATIVE_TYPE_NAME(DECIMAL)
#ifdef FIELD_TYPE_NEWDECIMAL #ifdef FIELD_TYPE_NEWDECIMAL
PDO_MYSQL_NATIVE_TYPE_NAME(NEWDECIMAL) PDO_MYSQL_NATIVE_TYPE_NAME(NEWDECIMAL)
#endif #endif
#ifdef FIELD_TYPE_GEOMETRY #ifdef FIELD_TYPE_GEOMETRY
PDO_MYSQL_NATIVE_TYPE_NAME(GEOMETRY) PDO_MYSQL_NATIVE_TYPE_NAME(GEOMETRY)
#endif #endif
PDO_MYSQL_NATIVE_TYPE_NAME(TIMESTAMP) PDO_MYSQL_NATIVE_TYPE_NAME(TIMESTAMP)
#ifdef FIELD_TYPE_YEAR #ifdef FIELD_TYPE_YEAR
PDO_MYSQL_NATIVE_TYPE_NAME(YEAR) PDO_MYSQL_NATIVE_TYPE_NAME(YEAR)
#endif #endif
PDO_MYSQL_NATIVE_TYPE_NAME(SET) PDO_MYSQL_NATIVE_TYPE_NAME(SET)
PDO_MYSQL_NATIVE_TYPE_NAME(ENUM) PDO_MYSQL_NATIVE_TYPE_NAME(ENUM)
PDO_MYSQL_NATIVE_TYPE_NAME(DATE) PDO_MYSQL_NATIVE_TYPE_NAME(DATE)
#ifdef FIELD_TYPE_NEWDATE #ifdef FIELD_TYPE_NEWDATE
PDO_MYSQL_NATIVE_TYPE_NAME(NEWDATE) PDO_MYSQL_NATIVE_TYPE_NAME(NEWDATE)
#endif #endif
PDO_MYSQL_NATIVE_TYPE_NAME(TIME) PDO_MYSQL_NATIVE_TYPE_NAME(TIME)
PDO_MYSQL_NATIVE_TYPE_NAME(DATETIME) PDO_MYSQL_NATIVE_TYPE_NAME(DATETIME)
PDO_MYSQL_NATIVE_TYPE_NAME(TINY_BLOB) PDO_MYSQL_NATIVE_TYPE_NAME(TINY_BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(MEDIUM_BLOB) PDO_MYSQL_NATIVE_TYPE_NAME(MEDIUM_BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(LONG_BLOB) PDO_MYSQL_NATIVE_TYPE_NAME(LONG_BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(BLOB) PDO_MYSQL_NATIVE_TYPE_NAME(BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(NULL) PDO_MYSQL_NATIVE_TYPE_NAME(NULL)
default: default:
return NULL; return NULL;
} }
#undef PDO_MYSQL_NATIVE_TYPE_NAME #undef PDO_MYSQL_NATIVE_TYPE_NAME
} /* }}} */ } /* }}} */

View file

@ -381,7 +381,7 @@ static zend_string* oci_handle_quoter(pdo_dbh_t *dbh, const zend_string *unquote
*c++ = '\''; /* add second quote */ *c++ = '\''; /* add second quote */
} }
/* Copy remainder and add enclosing quote */ /* Copy remainder and add enclosing quote */
strncpy(c, l, quotedlen-(c-quoted)-1); strncpy(c, l, quotedlen-(c-quoted)-1);
quoted[quotedlen-1] = '\''; quoted[quotedlen-1] = '\'';
quoted[quotedlen] = '\0'; quoted[quotedlen] = '\0';
@ -851,11 +851,11 @@ static int pdo_oci_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ *
} }
/* Get max character width */ /* Get max character width */
H->last_err = OCINlsNumericInfoGet(H->env, H->err, &H->max_char_width, OCI_NLS_CHARSET_MAXBYTESZ); H->last_err = OCINlsNumericInfoGet(H->env, H->err, &H->max_char_width, OCI_NLS_CHARSET_MAXBYTESZ);
if (H->last_err) { if (H->last_err) {
oci_drv_error("OCINlsNumericInfoGet: OCI_NLS_CHARSET_MAXBYTESZ"); oci_drv_error("OCINlsNumericInfoGet: OCI_NLS_CHARSET_MAXBYTESZ");
goto cleanup; goto cleanup;
} }
dbh->methods = &oci_methods; dbh->methods = &oci_methods;
dbh->alloc_own_columns = 1; dbh->alloc_own_columns = 1;

View file

@ -201,7 +201,7 @@ static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dv
*indpp = &P->indicator; *indpp = &P->indicator;
if (Z_ISREF(param->parameter)) if (Z_ISREF(param->parameter))
parameter = Z_REFVAL(param->parameter); parameter = Z_REFVAL(param->parameter);
else else
parameter = &param->parameter; parameter = &param->parameter;

View file

@ -196,14 +196,14 @@ static bool odbc_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *s
if (rc != SQL_SUCCESS) { if (rc != SQL_SUCCESS) {
pdo_odbc_stmt_error("SQLPrepare"); pdo_odbc_stmt_error("SQLPrepare");
if (rc != SQL_SUCCESS_WITH_INFO) { if (rc != SQL_SUCCESS_WITH_INFO) {
/* clone error information into the db handle */ /* clone error information into the db handle */
strcpy(H->einfo.last_err_msg, S->einfo.last_err_msg); strcpy(H->einfo.last_err_msg, S->einfo.last_err_msg);
H->einfo.file = S->einfo.file; H->einfo.file = S->einfo.file;
H->einfo.line = S->einfo.line; H->einfo.line = S->einfo.line;
H->einfo.what = S->einfo.what; H->einfo.what = S->einfo.what;
strcpy(dbh->error_code, stmt->error_code); strcpy(dbh->error_code, stmt->error_code);
} }
} }
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {

View file

@ -615,7 +615,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno)
rc = SQLBindCol(S->stmt, colno+1, rc = SQLBindCol(S->stmt, colno+1,
S->cols[colno].is_unicode ? SQL_C_BINARY : SQL_C_CHAR, S->cols[colno].is_unicode ? SQL_C_BINARY : SQL_C_CHAR,
S->cols[colno].data, S->cols[colno].data,
S->cols[colno].datalen+1, &S->cols[colno].fetched_len); S->cols[colno].datalen+1, &S->cols[colno].fetched_len);
if (rc != SQL_SUCCESS) { if (rc != SQL_SUCCESS) {
pdo_odbc_stmt_error("SQLBindCol"); pdo_odbc_stmt_error("SQLBindCol");

View file

@ -724,8 +724,8 @@ PHP_METHOD(PDO_PGSql_Ext, pgsqlCopyFromFile)
PQclear(pgsql_result); PQclear(pgsql_result);
while ((buf = php_stream_get_line(stream, NULL, 0, &line_len)) != NULL) { while ((buf = php_stream_get_line(stream, NULL, 0, &line_len)) != NULL) {
if (PQputCopyData(H->server, buf, line_len) != 1) { if (PQputCopyData(H->server, buf, line_len) != 1) {
efree(buf); efree(buf);
pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL);
php_stream_close(stream); php_stream_close(stream);
PDO_HANDLE_DBH_ERR(); PDO_HANDLE_DBH_ERR();
RETURN_FALSE; RETURN_FALSE;

View file

@ -2613,10 +2613,10 @@ PHP_FUNCTION(pg_lo_read)
/* {{{ Write a large object */ /* {{{ Write a large object */
PHP_FUNCTION(pg_lo_write) PHP_FUNCTION(pg_lo_write)
{ {
zval *pgsql_id; zval *pgsql_id;
zend_string *str; zend_string *str;
zend_long z_len; zend_long z_len;
bool z_len_is_null = 1; bool z_len_is_null = 1;
size_t nbytes; size_t nbytes;
size_t len; size_t len;
pgLofp *pgsql; pgLofp *pgsql;
@ -2654,7 +2654,7 @@ PHP_FUNCTION(pg_lo_write)
/* {{{ Read a large object and send straight to browser */ /* {{{ Read a large object and send straight to browser */
PHP_FUNCTION(pg_lo_read_all) PHP_FUNCTION(pg_lo_read_all)
{ {
zval *pgsql_id; zval *pgsql_id;
int tbytes; int tbytes;
volatile int nbytes; volatile int nbytes;
char buf[PGSQL_LO_READ_BUF_SIZE]; char buf[PGSQL_LO_READ_BUF_SIZE];
@ -5815,7 +5815,7 @@ PHP_PGSQL_API void php_pgsql_result2array(PGresult *pg_result, zval *ret_array,
/* }}} */ /* }}} */
/* {{{ php_pgsql_select */ /* {{{ php_pgsql_select */
PHP_PGSQL_API zend_result php_pgsql_select(PGconn *pg_link, const zend_string *table, zval *ids_array, zval *ret_array, zend_ulong opt, long result_type, zend_string **sql) PHP_PGSQL_API zend_result php_pgsql_select(PGconn *pg_link, const zend_string *table, zval *ids_array, zval *ret_array, zend_ulong opt, long result_type, zend_string **sql)
{ {
zval ids_converted; zval ids_converted;
smart_str querystr = {0}; smart_str querystr = {0};

View file

@ -569,17 +569,17 @@ PHP_METHOD(Phar, webPhar)
/* retrieve requested file within phar */ /* retrieve requested file within phar */
if (!(SG(request_info).request_method if (!(SG(request_info).request_method
&& SG(request_info).request_uri && SG(request_info).request_uri
&& (!strcmp(SG(request_info).request_method, "GET") && (!strcmp(SG(request_info).request_method, "GET")
|| !strcmp(SG(request_info).request_method, "POST") || !strcmp(SG(request_info).request_method, "POST")
|| !strcmp(SG(request_info).request_method, "DELETE") || !strcmp(SG(request_info).request_method, "DELETE")
|| !strcmp(SG(request_info).request_method, "HEAD") || !strcmp(SG(request_info).request_method, "HEAD")
|| !strcmp(SG(request_info).request_method, "OPTIONS") || !strcmp(SG(request_info).request_method, "OPTIONS")
|| !strcmp(SG(request_info).request_method, "PATCH") || !strcmp(SG(request_info).request_method, "PATCH")
|| !strcmp(SG(request_info).request_method, "PUT") || !strcmp(SG(request_info).request_method, "PUT")
) )
) )
) { ) {
return; return;
} }

View file

@ -202,8 +202,8 @@ static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp) /*
#ifndef HAVE_STRNLEN #ifndef HAVE_STRNLEN
static size_t strnlen(const char *s, size_t maxlen) { static size_t strnlen(const char *s, size_t maxlen) {
char *r = (char *)memchr(s, '\0', maxlen); char *r = (char *)memchr(s, '\0', maxlen);
return r ? r-s : maxlen; return r ? r-s : maxlen;
} }
#endif #endif

View file

@ -206,7 +206,7 @@ PHP_FUNCTION(posix_kill)
if (kill(pid, sig) < 0) { if (kill(pid, sig) < 0) {
POSIX_G(last_error) = errno; POSIX_G(last_error) = errno;
RETURN_FALSE; RETURN_FALSE;
} }
RETURN_TRUE; RETURN_TRUE;
} }

View file

@ -55,7 +55,7 @@ static zend_class_entry *php_pspell_config_ce = NULL;
static zend_object_handlers php_pspell_config_handlers; static zend_object_handlers php_pspell_config_handlers;
zend_module_entry pspell_module_entry = { zend_module_entry pspell_module_entry = {
STANDARD_MODULE_HEADER, STANDARD_MODULE_HEADER,
"pspell", "pspell",
ext_functions, ext_functions,
PHP_MINIT(pspell), PHP_MINIT(pspell),
@ -615,7 +615,7 @@ PHP_FUNCTION(pspell_config_create)
pspell_config_replace(config, "language-tag", language); pspell_config_replace(config, "language-tag", language);
if (spelling_len) { if (spelling_len) {
pspell_config_replace(config, "spelling", spelling); pspell_config_replace(config, "spelling", spelling);
} }

View file

@ -82,7 +82,7 @@ PHP_MINIT_FUNCTION(readline)
#if HAVE_RL_CALLBACK_READ_CHAR #if HAVE_RL_CALLBACK_READ_CHAR
ZVAL_UNDEF(&_prepped_callback); ZVAL_UNDEF(&_prepped_callback);
#endif #endif
return PHP_MINIT(cli_readline)(INIT_FUNC_ARGS_PASSTHRU); return PHP_MINIT(cli_readline)(INIT_FUNC_ARGS_PASSTHRU);
} }
PHP_MSHUTDOWN_FUNCTION(readline) PHP_MSHUTDOWN_FUNCTION(readline)
@ -323,7 +323,7 @@ PHP_FUNCTION(readline_list_history)
} }
#elif defined(HAVE_LIBEDIT) /* libedit */ #elif defined(HAVE_LIBEDIT) /* libedit */
{ {
HISTORY_STATE *hs; HISTORY_STATE *hs;
int i; int i;
@ -338,7 +338,7 @@ PHP_FUNCTION(readline_list_history)
} }
} }
free(hs); free(hs);
} }
#else /* readline */ #else /* readline */
history = history_list(); history = history_list();

View file

@ -3048,10 +3048,10 @@ ZEND_METHOD(ReflectionUnionType, getTypes)
zend_string *name = ZEND_TYPE_NAME(param->type); zend_string *name = ZEND_TYPE_NAME(param->type);
if (ZSTR_HAS_CE_CACHE(name) && ZSTR_GET_CE_CACHE(name)) { if (ZSTR_HAS_CE_CACHE(name) && ZSTR_GET_CE_CACHE(name)) {
append_type(return_value, append_type(return_value,
(zend_type) ZEND_TYPE_INIT_CE(ZSTR_GET_CE_CACHE(name), 0, 0)); (zend_type) ZEND_TYPE_INIT_CE(ZSTR_GET_CE_CACHE(name), 0, 0));
} else { } else {
append_type(return_value, append_type(return_value,
(zend_type) ZEND_TYPE_INIT_CLASS(name, 0, 0)); (zend_type) ZEND_TYPE_INIT_CLASS(name, 0, 0));
} }
} else if (ZEND_TYPE_HAS_CE(param->type)) { } else if (ZEND_TYPE_HAS_CE(param->type)) {
@ -6133,9 +6133,9 @@ ZEND_METHOD(ReflectionExtension, info)
ZEND_METHOD(ReflectionExtension, isPersistent) ZEND_METHOD(ReflectionExtension, isPersistent)
{ {
reflection_object *intern; reflection_object *intern;
zend_module_entry *module; zend_module_entry *module;
if (zend_parse_parameters_none() == FAILURE) { if (zend_parse_parameters_none() == FAILURE) {
RETURN_THROWS(); RETURN_THROWS();
} }
GET_REFLECTION_OBJECT_PTR(module); GET_REFLECTION_OBJECT_PTR(module);

View file

@ -57,7 +57,7 @@ static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval)
ret = SUCCESS; \ ret = SUCCESS; \
} else if (Z_TYPE(retval) == IS_FALSE) { \ } else if (Z_TYPE(retval) == IS_FALSE) { \
ret = FAILURE; \ ret = FAILURE; \
} else if ((Z_TYPE(retval) == IS_LONG) && (Z_LVAL(retval) == -1)) { \ } else if ((Z_TYPE(retval) == IS_LONG) && (Z_LVAL(retval) == -1)) { \
if (!EG(exception)) { \ if (!EG(exception)) { \
php_error_docref(NULL, E_DEPRECATED, "Session callback must have a return value of type bool, %s returned", zend_zval_type_name(&retval)); \ php_error_docref(NULL, E_DEPRECATED, "Session callback must have a return value of type bool, %s returned", zend_zval_type_name(&retval)); \
} \ } \

View file

@ -1367,9 +1367,9 @@ static int php_session_send_cookie(void) /* {{{ */
} }
if (PS(cookie_samesite)[0]) { if (PS(cookie_samesite)[0]) {
smart_str_appends(&ncookie, COOKIE_SAMESITE); smart_str_appends(&ncookie, COOKIE_SAMESITE);
smart_str_appends(&ncookie, PS(cookie_samesite)); smart_str_appends(&ncookie, PS(cookie_samesite));
} }
smart_str_0(&ncookie); smart_str_0(&ncookie);
@ -2327,7 +2327,7 @@ PHP_FUNCTION(session_create_id)
/* Detect collision and retry */ /* Detect collision and retry */
if (PS(mod)->s_validate_sid(&PS(mod_data), new_id) == SUCCESS) { if (PS(mod)->s_validate_sid(&PS(mod_data), new_id) == SUCCESS) {
zend_string_release_ex(new_id, 0); zend_string_release_ex(new_id, 0);
new_id = NULL; new_id = NULL;
continue; continue;
} }
break; break;

View file

@ -66,7 +66,7 @@ typedef struct php_shmop
int shmatflg; int shmatflg;
char *addr; char *addr;
zend_long size; zend_long size;
zend_object std; zend_object std;
} php_shmop; } php_shmop;
zend_class_entry *shmop_ce; zend_class_entry *shmop_ce;

View file

@ -1294,7 +1294,7 @@ PHP_METHOD(SimpleXMLElement, xpath)
} }
sxe->xpath->node = nodeptr; sxe->xpath->node = nodeptr;
ns = xmlGetNsList((xmlDocPtr) sxe->document->ptr, nodeptr); ns = xmlGetNsList((xmlDocPtr) sxe->document->ptr, nodeptr);
if (ns != NULL) { if (ns != NULL) {
while (ns[nsnbr] != NULL) { while (ns[nsnbr] != NULL) {
nsnbr++; nsnbr++;

View file

@ -2046,7 +2046,7 @@ static int calc_dimension(const char* str)
int i = 1; int i = 1;
while (*str != ']' && *str != '\0') { while (*str != ']' && *str != '\0') {
if (*str == ',') { if (*str == ',') {
i++; i++;
} }
str++; str++;
} }
@ -2097,26 +2097,26 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
break; break;
} }
ZVAL_DEREF(zdata); ZVAL_DEREF(zdata);
if (dimension == 1) { if (dimension == 1) {
if (enc == NULL) { if (enc == NULL) {
xparam = master_to_xml(get_conversion(Z_TYPE_P(zdata)), zdata, style, xmlParam); xparam = master_to_xml(get_conversion(Z_TYPE_P(zdata)), zdata, style, xmlParam);
} else { } else {
xparam = master_to_xml(enc, zdata, style, xmlParam); xparam = master_to_xml(enc, zdata, style, xmlParam);
} }
if (type) { if (type) {
xmlNodeSetName(xparam, BAD_CAST(type->name)); xmlNodeSetName(xparam, BAD_CAST(type->name));
} else if (style == SOAP_LITERAL && enc && enc->details.type_str) { } else if (style == SOAP_LITERAL && enc && enc->details.type_str) {
xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str)); xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str));
xmlSetNs(xparam, ns); xmlSetNs(xparam, ns);
} else { } else {
xmlNodeSetName(xparam, BAD_CAST("item")); xmlNodeSetName(xparam, BAD_CAST("item"));
} }
} else { } else {
add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, zdata, style); add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, zdata, style);
} }
j++; j++;
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
if (dimension == 1) { if (dimension == 1) {
while (j < dims[0]) { while (j < dims[0]) {
@ -2124,42 +2124,42 @@ static void add_xml_array_elements(xmlNodePtr xmlParam,
xmlAddChild(xmlParam, xparam); xmlAddChild(xmlParam, xparam);
if (type) { if (type) {
xmlNodeSetName(xparam, BAD_CAST(type->name)); xmlNodeSetName(xparam, BAD_CAST(type->name));
} else if (style == SOAP_LITERAL && enc && enc->details.type_str) { } else if (style == SOAP_LITERAL && enc && enc->details.type_str) {
xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str)); xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str));
xmlSetNs(xparam, ns); xmlSetNs(xparam, ns);
} else { } else {
xmlNodeSetName(xparam, BAD_CAST("item")); xmlNodeSetName(xparam, BAD_CAST("item"));
} }
j++; j++;
} }
} else { } else {
while (j < dims[0]) { while (j < dims[0]) {
add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style); add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style);
j++; j++;
} }
} }
} else { } else {
for (j=0; j<dims[0]; j++) { for (j=0; j<dims[0]; j++) {
if (dimension == 1) { if (dimension == 1) {
xmlNodePtr xparam; xmlNodePtr xparam;
xparam = xmlNewNode(NULL, BAD_CAST("BOGUS")); xparam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(xmlParam, xparam); xmlAddChild(xmlParam, xparam);
if (type) { if (type) {
xmlNodeSetName(xparam, BAD_CAST(type->name)); xmlNodeSetName(xparam, BAD_CAST(type->name));
} else if (style == SOAP_LITERAL && enc && enc->details.type_str) { } else if (style == SOAP_LITERAL && enc && enc->details.type_str) {
xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str)); xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str));
xmlSetNs(xparam, ns); xmlSetNs(xparam, ns);
} else { } else {
xmlNodeSetName(xparam, BAD_CAST("item")); xmlNodeSetName(xparam, BAD_CAST("item"));
} }
} else { } else {
add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style); add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style);
} }
} }
} }
} }
static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)

View file

@ -264,9 +264,9 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
php_stream_close(stream); php_stream_close(stream);
stream = NULL; stream = NULL;
} }
smart_str_free(&soap_headers); smart_str_free(&soap_headers);
if (stream) { if (stream) {
zend_string *http_headers = get_http_headers(stream); zend_string *http_headers = get_http_headers(stream);
if (http_headers) { if (http_headers) {
zend_string_free(http_headers); zend_string_free(http_headers);
@ -278,7 +278,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
/* enable SSL transport layer */ /* enable SSL transport layer */
if (stream) { if (stream) {
/* if a stream is created without encryption, check to see if SSL method parameter is specified and use /* if a stream is created without encryption, check to see if SSL method parameter is specified and use
proper encrypyion method based on constants defined in soap.c */ proper encrypyion method based on constants defined in soap.c */
int crypto_method = STREAM_CRYPTO_METHOD_SSLv23_CLIENT; int crypto_method = STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "_ssl_method", sizeof("_ssl_method")-1)) != NULL && if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "_ssl_method", sizeof("_ssl_method")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_LONG) { Z_TYPE_P(tmp) == IS_LONG) {
@ -318,17 +318,17 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
static int in_domain(const char *host, const char *domain) static int in_domain(const char *host, const char *domain)
{ {
if (domain[0] == '.') { if (domain[0] == '.') {
int l1 = strlen(host); int l1 = strlen(host);
int l2 = strlen(domain); int l2 = strlen(domain);
if (l1 > l2) { if (l1 > l2) {
return strcmp(host+l1-l2,domain) == 0; return strcmp(host+l1-l2,domain) == 0;
} else { } else {
return 0; return 0;
} }
} else { } else {
return strcmp(host,domain) == 0; return strcmp(host,domain) == 0;
} }
} }
int make_http_soap_request(zval *this_ptr, int make_http_soap_request(zval *this_ptr,
@ -493,14 +493,14 @@ try_again:
(!use_ssl && !zend_string_equals_literal(orig->scheme, "https"))) && (!use_ssl && !zend_string_equals_literal(orig->scheme, "https"))) &&
zend_string_equals(orig->host, phpurl->host) && zend_string_equals(orig->host, phpurl->host) &&
orig->port == phpurl->port))) { orig->port == phpurl->port))) {
} else { } else {
php_stream_close(stream); php_stream_close(stream);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")-1); zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")-1); zend_hash_str_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")-1); zend_hash_str_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")-1);
stream = NULL; stream = NULL;
use_proxy = 0; use_proxy = 0;
} }
} }
/* Check if keep-alive connection is still opened */ /* Check if keep-alive connection is still opened */
@ -1480,7 +1480,7 @@ static zend_string* get_http_body(php_stream *stream, int close, char *headers)
} }
len_size += len_read; len_size += len_read;
http_buf_size += len_read; http_buf_size += len_read;
} }
/* Eat up '\r' '\n' */ /* Eat up '\r' '\n' */
ch = php_stream_getc(stream); ch = php_stream_getc(stream);
@ -1494,7 +1494,7 @@ static zend_string* get_http_body(php_stream *stream, int close, char *headers)
} }
return NULL; return NULL;
} }
} }
} else { } else {
/* Something wrong in chunked encoding */ /* Something wrong in chunked encoding */
if (http_buf) { if (http_buf) {

View file

@ -1886,8 +1886,8 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
attr = attr->next; attr = attr->next;
} }
if (newAttr->form == XSD_FORM_DEFAULT) { if (newAttr->form == XSD_FORM_DEFAULT) {
xmlNodePtr parent = attrType->parent; xmlNodePtr parent = attrType->parent;
while (parent) { while (parent) {
if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) { if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) {
xmlAttrPtr def; xmlAttrPtr def;
def = get_attribute(parent->properties, "attributeFormDefault"); def = get_attribute(parent->properties, "attributeFormDefault");
@ -1899,7 +1899,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
break; break;
} }
parent = parent->parent; parent = parent->parent;
} }
if (parent == NULL) { if (parent == NULL) {
newAttr->form = XSD_FORM_UNQUALIFIED; newAttr->form = XSD_FORM_UNQUALIFIED;
} }

View file

@ -3283,7 +3283,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl)
/* Use HTTP/1.1 with "Connection: close" by default */ /* Use HTTP/1.1 with "Connection: close" by default */
if ((tmp = php_stream_context_get_option(context, "http", "protocol_version")) == NULL) { if ((tmp = php_stream_context_get_option(context, "http", "protocol_version")) == NULL) {
zval http_version; zval http_version;
ZVAL_DOUBLE(&http_version, 1.1); ZVAL_DOUBLE(&http_version, 1.1);
php_stream_context_set_option(context, "http", "protocol_version", &http_version); php_stream_context_set_option(context, "http", "protocol_version", &http_version);

View file

@ -2036,10 +2036,10 @@ PHP_METHOD(SoapClient, __construct)
} }
if ((tmp = zend_hash_str_find(ht, "local_cert", sizeof("local_cert")-1)) != NULL && if ((tmp = zend_hash_str_find(ht, "local_cert", sizeof("local_cert")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) { Z_TYPE_P(tmp) == IS_STRING) {
if (!context) { if (!context) {
context = php_stream_context_alloc(); context = php_stream_context_alloc();
} }
php_stream_context_set_option(context, "ssl", "local_cert", tmp); php_stream_context_set_option(context, "ssl", "local_cert", tmp);
if ((tmp = zend_hash_str_find(ht, "passphrase", sizeof("passphrase")-1)) != NULL && if ((tmp = zend_hash_str_find(ht, "passphrase", sizeof("passphrase")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) { Z_TYPE_P(tmp) == IS_STRING) {
php_stream_context_set_option(context, "ssl", "passphrase", tmp); php_stream_context_set_option(context, "ssl", "passphrase", tmp);
@ -2092,7 +2092,7 @@ PHP_METHOD(SoapClient, __construct)
if ((tmp = zend_hash_str_find(ht, "features", sizeof("features")-1)) != NULL && if ((tmp = zend_hash_str_find(ht, "features", sizeof("features")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_LONG) { Z_TYPE_P(tmp) == IS_LONG) {
add_property_long(this_ptr, "_features", Z_LVAL_P(tmp)); add_property_long(this_ptr, "_features", Z_LVAL_P(tmp));
} }
if ((tmp = zend_hash_str_find(ht, "connection_timeout", sizeof("connection_timeout")-1)) != NULL) { if ((tmp = zend_hash_str_find(ht, "connection_timeout", sizeof("connection_timeout")-1)) != NULL) {
if (Z_TYPE_P(tmp) != IS_LONG) { if (Z_TYPE_P(tmp) != IS_LONG) {
@ -2255,9 +2255,9 @@ static void do_soap_call(zend_execute_data *execute_data,
{ {
zval *tmp; zval *tmp;
zval *trace; zval *trace;
sdlPtr sdl = NULL; sdlPtr sdl = NULL;
sdlPtr old_sdl = NULL; sdlPtr old_sdl = NULL;
sdlFunctionPtr fn; sdlFunctionPtr fn;
xmlDocPtr request = NULL; xmlDocPtr request = NULL;
int ret = FALSE; int ret = FALSE;
int soap_version; int soap_version;
@ -2297,7 +2297,7 @@ static void do_soap_call(zend_execute_data *execute_data,
FETCH_TYPEMAP_RES(typemap,tmp); FETCH_TYPEMAP_RES(typemap,tmp);
} }
clear_soap_fault(this_ptr); clear_soap_fault(this_ptr);
SOAP_GLOBAL(soap_version) = soap_version; SOAP_GLOBAL(soap_version) = soap_version;
old_sdl = SOAP_GLOBAL(sdl); old_sdl = SOAP_GLOBAL(sdl);
@ -2328,8 +2328,8 @@ static void do_soap_call(zend_execute_data *execute_data,
zend_try { zend_try {
if (sdl != NULL) { if (sdl != NULL) {
fn = get_function(sdl, function); fn = get_function(sdl, function);
if (fn != NULL) { if (fn != NULL) {
sdlBindingPtr binding = fn->binding; sdlBindingPtr binding = fn->binding;
bool one_way = 0; bool one_way = 0;
@ -2345,12 +2345,12 @@ static void do_soap_call(zend_execute_data *execute_data,
} }
if (binding->bindingType == BINDING_SOAP) { if (binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes; sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes;
request = serialize_function_call(this_ptr, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers); request = serialize_function_call(this_ptr, fn, NULL, fnb->input.ns, real_args, arg_count, soap_version, soap_headers);
ret = do_request(this_ptr, request, location, fnb->soapAction, soap_version, one_way, &response); ret = do_request(this_ptr, request, location, fnb->soapAction, soap_version, one_way, &response);
} else { } else {
request = serialize_function_call(this_ptr, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers); request = serialize_function_call(this_ptr, fn, NULL, sdl->target_ns, real_args, arg_count, soap_version, soap_headers);
ret = do_request(this_ptr, request, location, NULL, soap_version, one_way, &response); ret = do_request(this_ptr, request, location, NULL, soap_version, one_way, &response);
} }
xmlFreeDoc(request); xmlFreeDoc(request);
request = NULL; request = NULL;

View file

@ -226,9 +226,9 @@ static unsigned from_array_iterate(const zval *arr,
break; break;
} }
i++; i++;
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
return i -1; return i -1;
} }
/* Generic Aggregated conversions */ /* Generic Aggregated conversions */
@ -951,8 +951,8 @@ static void from_zval_write_control_array(const zval *arr, char *msghdr_c, ser_c
zend_llist_remove_tail(&ctx->keys); zend_llist_remove_tail(&ctx->keys);
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
msg->msg_control = control_buf; msg->msg_control = control_buf;
msg->msg_controllen = cur_offset; /* not control_len, which may be larger */ msg->msg_controllen = cur_offset; /* not control_len, which may be larger */
} }
static void to_zval_read_cmsg_data(const char *cmsghdr_c, zval *zv, res_context *ctx) static void to_zval_read_cmsg_data(const char *cmsghdr_c, zval *zv, res_context *ctx)
{ {
@ -1100,7 +1100,7 @@ static void from_zval_write_iov_array(const zval *arr, char *msghdr_c, ser_conte
msg->msg_iov = accounted_safe_ecalloc(num_elem, sizeof *msg->msg_iov, 0, ctx); msg->msg_iov = accounted_safe_ecalloc(num_elem, sizeof *msg->msg_iov, 0, ctx);
msg->msg_iovlen = (size_t)num_elem; msg->msg_iovlen = (size_t)num_elem;
from_array_iterate(arr, from_zval_write_iov_array_aux, (void**)&msg, ctx); from_array_iterate(arr, from_zval_write_iov_array_aux, (void**)&msg, ctx);
} }
static void from_zval_write_controllen(const zval *elem, char *msghdr_c, ser_context *ctx) static void from_zval_write_controllen(const zval *elem, char *msghdr_c, ser_context *ctx)
{ {
@ -1376,7 +1376,7 @@ void from_zval_write_fd_array(const zval *arr, char *int_arr, ser_context *ctx)
return; return;
} }
from_array_iterate(arr, &from_zval_write_fd_array_aux, (void**)&int_arr, ctx); from_array_iterate(arr, &from_zval_write_fd_array_aux, (void**)&int_arr, ctx);
} }
void to_zval_read_fd_array(const char *data, zval *zv, res_context *ctx) void to_zval_read_fd_array(const char *data, zval *zv, res_context *ctx)
{ {

View file

@ -2168,11 +2168,11 @@ int socket_import_file_descriptor(PHP_SOCKET socket, php_socket *retsock)
int t; int t;
#endif #endif
retsock->bsd_socket = socket; retsock->bsd_socket = socket;
/* determine family */ /* determine family */
#ifdef SO_DOMAIN #ifdef SO_DOMAIN
if (getsockopt(socket, SOL_SOCKET, SO_DOMAIN, &type, &type_len) == 0) { if (getsockopt(socket, SOL_SOCKET, SO_DOMAIN, &type, &type_len) == 0) {
retsock->type = type; retsock->type = type;
} else } else
#endif #endif
@ -2183,18 +2183,18 @@ int socket_import_file_descriptor(PHP_SOCKET socket, php_socket *retsock)
return 0; return 0;
} }
/* determine blocking mode */ /* determine blocking mode */
#ifndef PHP_WIN32 #ifndef PHP_WIN32
t = fcntl(socket, F_GETFL); t = fcntl(socket, F_GETFL);
if (t == -1) { if (t == -1) {
PHP_SOCKET_ERROR(retsock, "Unable to obtain blocking state", errno); PHP_SOCKET_ERROR(retsock, "Unable to obtain blocking state", errno);
return 0; return 0;
} else { } else {
retsock->blocking = !(t & O_NONBLOCK); retsock->blocking = !(t & O_NONBLOCK);
} }
#endif #endif
return 1; return 1;
} }
/* {{{ Imports a stream that encapsulates a socket into a socket extension resource. */ /* {{{ Imports a stream that encapsulates a socket into a socket extension resource. */
@ -2585,7 +2585,7 @@ PHP_FUNCTION(socket_addrinfo_explain)
#ifdef PHP_WIN32 #ifdef PHP_WIN32
/* {{{ Exports the network socket information suitable to be used in another process and returns the info id. */ /* {{{ Exports the network socket information suitable to be used in another process and returns the info id. */
PHP_FUNCTION(socket_wsaprotocol_info_export) PHP_FUNCTION(socket_wsaprotocol_info_export)
{ {
WSAPROTOCOL_INFO wi; WSAPROTOCOL_INFO wi;

View file

@ -58,9 +58,9 @@ static zend_class_entry * spl_find_ce_by_name(zend_string *name, bool autoload)
ce = zend_hash_find_ptr(EG(class_table), lc_name); ce = zend_hash_find_ptr(EG(class_table), lc_name);
zend_string_release(lc_name); zend_string_release(lc_name);
} else { } else {
ce = zend_lookup_class(name); ce = zend_lookup_class(name);
} }
if (ce == NULL) { if (ce == NULL) {
php_error_docref(NULL, E_WARNING, "Class %s does not exist%s", ZSTR_VAL(name), autoload ? " and could not be loaded" : ""); php_error_docref(NULL, E_WARNING, "Class %s does not exist%s", ZSTR_VAL(name), autoload ? " and could not be loaded" : "");
return NULL; return NULL;
} }

Some files were not shown because too many files have changed in this diff Show more