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 */
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_mutex_unlock(tsrm_env_mutex);
tsrm_mutex_unlock(tsrm_env_mutex);
} /* }}} */
/* 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)
{/*{{{*/
return is_thread_shutdown;
return is_thread_shutdown;
}/*}}}*/
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;
}
} else if (ssa_op->op1_def == var) {
} else if (ssa_op->op1_def == var) {
switch (opline->opcode) {
case ZEND_ASSIGN:
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);
map_T = (int *) zend_arena_alloc(&ctx->arena, T * sizeof(int));
end = op_array->opcodes;
opline = &op_array->opcodes[op_array->last - 1];
end = op_array->opcodes;
opline = &op_array->opcodes[op_array->last - 1];
/* Find T definition points */
while (opline >= end) {
if (opline->result_type & (IS_VAR | IS_TMP_VAR)) {
/* Find T definition points */
while (opline >= end) {
if (opline->result_type & (IS_VAR | IS_TMP_VAR)) {
start_of_T[VAR_NUM(opline->result.var) - offset] = 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(taken_T, bitset_len);
end = op_array->opcodes;
opline = &op_array->opcodes[op_array->last - 1];
end = op_array->opcodes;
opline = &op_array->opcodes[op_array->last - 1];
while (opline >= end) {
while (opline >= end) {
if ((opline->op1_type & (IS_VAR | IS_TMP_VAR))) {
currT = VAR_NUM(opline->op1.var) - offset;
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)
{
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);
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 ||
opline->opcode == ZEND_FETCH_DIM_RW ||
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 (opline->opcode != ZEND_FETCH_DIM_FUNC_ARG) {
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);
break;
}
}
default:
break;
}

View File

@ -196,9 +196,9 @@ ZEND_INI_BEGIN()
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)
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)
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.multibyte", "0", ZEND_INI_PERDIR, OnUpdateBool, multibyte, zend_compiler_globals, compiler_globals)
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)
#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)
#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",
ZSTR_VAL(func_name), arg_num,
arg_name ? " ($" : "", arg_name ? arg_name : "", arg_name ? ")" : "", message
);
);
efree(message);
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) /* {{{ */
{
zval *prop, tmp;
zend_string *key;
zend_long h;
zend_property_info *property_info;
zval *prop, tmp;
zend_string *key;
zend_long h;
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 (ZSTR_VAL(key)[0] == '\0') {
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,
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,
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,
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
@ -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)
{
zend_mm_chunk *chunk;
int page_num;
zend_mm_chunk *chunk;
int page_num;
zend_mm_bin *bin;
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);
#endif
p = (zend_mm_free_slot*)ptr;
p->next_free_slot = heap->free_slot[bin_num];
heap->free_slot[bin_num] = p;
p = (zend_mm_free_slot*)ptr;
p->next_free_slot = heap->free_slot[bin_num];
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)
{
int empty = 1;
int empty = 1;
zend_long count = 0;
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)));
@ -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);
} else {
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)
@ -2924,9 +2924,9 @@ ZEND_API void zend_mm_get_custom_handlers(zend_mm_heap *heap,
#if ZEND_DEBUG
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 (*_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* (*_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* (*_realloc)(void*, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC))
{
#if ZEND_MM_CUSTOM
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:
zend_type_error("Illegal offset type");
return FAILURE;
}
}
return SUCCESS;
}

View File

@ -492,7 +492,7 @@ ZEND_FUNCTION(define)
if (non_cs) {
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);
@ -1018,7 +1018,7 @@ static inline void class_exists_impl(INTERNAL_FUNCTION_PARAMETERS, int flags, in
ce = zend_lookup_class(name);
}
if (ce) {
if (ce) {
RETURN_BOOL(((ce->ce_flags & flags) == flags) && !(ce->ce_flags & skip_flags));
} else {
RETURN_FALSE;

View File

@ -757,7 +757,7 @@ void zend_do_free(znode *op1) /* {{{ */
} else {
while (opline >= CG(active_op_array)->opcodes) {
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.var == op1->u.op.var) {
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]);
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;
}

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) /* {{{ */
{
zval *previous, *ancestor, *ex;
zval *previous, *ancestor, *ex;
zval pv, zv, rv;
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_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 {
if (Z_ISREF_P(container) && Z_TYPE_P(Z_REFVAL_P(container)) == IS_OBJECT) {
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);
#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;
#endif
#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) /* {{{ */
{
#ifndef ZTS
if (EG(timed_out)) {
if (EG(timed_out)) {
/* Die on hard timeout */
const char *error_filename = NULL;
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)));
}
_exit(124);
}
}
#endif
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) /* {{{ */
{
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();
}
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");
RETURN_THROWS();
}
@ -657,7 +657,7 @@ ZEND_METHOD(Fiber, suspend)
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->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)
{
zval *val;
uint32_t num = ht->nNumOfElements;
zval *val;
uint32_t num = ht->nNumOfElements;
ZEND_HASH_FOREACH_VAL(ht, val) {
if (Z_TYPE_P(val) == IS_INDIRECT) {
if (UNEXPECTED(Z_TYPE_P(Z_INDIRECT_P(val)) == IS_UNDEF)) {
num--;
}
}
} ZEND_HASH_FOREACH_END();
return num;
ZEND_HASH_FOREACH_VAL(ht, val) {
if (Z_TYPE_P(val) == IS_INDIRECT) {
if (UNEXPECTED(Z_TYPE_P(Z_INDIRECT_P(val)) == IS_UNDEF)) {
num--;
}
}
} ZEND_HASH_FOREACH_END();
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)
{
uint32_t idx;
uint32_t idx;
Bucket *p;
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)
{
uint32_t idx;
uint32_t idx;
Bucket *p;
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)
{
uint32_t idx;
uint32_t idx;
Bucket *p;
zval *t, *s;
@ -2393,9 +2393,9 @@ ZEND_API zend_result ZEND_FASTCALL zend_hash_move_backwards_ex(HashTable *ht, Ha
}
}
*pos = ht->nNumUsed;
return SUCCESS;
return SUCCESS;
} 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;
}
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)));
} 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_result ret;
zend_string *new_value;
zend_result ret;
zend_string *new_value;
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);
@ -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_result ret;
zend_string *new_value;
zend_result ret;
zend_string *new_value;
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);

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) /* {{{ */ {
return is_numeric_string(ZSTR_VAL(str), ZSTR_LEN(str), lval, dval, false);
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);
}
/* }}} */

View File

@ -24,9 +24,9 @@
/* {{{ data structure */
enum strm_status {
PHP_BZ2_UNINITIALIZED,
PHP_BZ2_RUNNING,
PHP_BZ2_FINISHED
PHP_BZ2_UNINITIALIZED,
PHP_BZ2_RUNNING,
PHP_BZ2_FINISHED
};
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 */
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) */

View File

@ -135,10 +135,10 @@ static ZEND_INI_MH(OnAutoregisterCasesensitive)
}
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.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_ENTRY("com.autoregister_casesensitive", "1", PHP_INI_ALL, OnAutoregisterCasesensitive, autoreg_case_sensitive, 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_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.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.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 {
V_BOOL(dstvar) = V_BOOL(srcvar);
}
break;
break;
case VT_BSTR:
if (V_VT(dstvar) & VT_BYREF) {
*V_BSTRREF(dstvar) = V_BSTR(srcvar);
} else {
V_BSTR(dstvar) = V_BSTR(srcvar);
}
}
break;
case VT_UNKNOWN:

View File

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

View File

@ -61,8 +61,8 @@ ZEND_METHOD(CURLFile, __construct)
/* {{{ Create the CURLFile object */
PHP_FUNCTION(curl_file_create)
{
object_init_ex( return_value, curl_CURLFile_class );
curlfile_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
object_init_ex( return_value, curl_CURLFile_class );
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++) {
header = curl_pushheader_bynum(push_headers, i);
add_next_index_string(&headers, header);
}
}
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)
{
#ifdef HAVE_GETTIMEOFDAY
struct timeval tm;
struct timeval tm;
if (UNEXPECTED(gettimeofday(&tm, NULL) != SUCCESS)) {
/* fallback, can't reasonably happen */
return time(NULL);
}
if (UNEXPECTED(gettimeofday(&tm, NULL) != SUCCESS)) {
/* fallback, can't reasonably happen */
return time(NULL);
}
return tm.tv_sec;
return tm.tv_sec;
#else
return time(NULL);
return time(NULL);
#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) /* {{{ */
{
*table = NULL;
*n = 0;
return zend_std_get_properties(object);
*table = NULL;
*n = 0;
return zend_std_get_properties(object);
} /* }}} */
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);
}
if (old_obj->end) {
new_obj->end = timelib_time_clone(old_obj->end);
}
if (old_obj->interval) {
new_obj->interval = timelib_rel_time_clone(old_obj->interval);
}
new_obj->end = timelib_time_clone(old_obj->end);
}
if (old_obj->interval) {
new_obj->interval = timelib_rel_time_clone(old_obj->interval);
}
return &new_obj->std;
} /* }}} */
@ -4269,27 +4269,27 @@ PHP_METHOD(DatePeriod, getStartDate)
/* {{{ Get end date. */
PHP_METHOD(DatePeriod, getEndDate)
{
php_period_obj *dpobj;
php_date_obj *dateobj;
php_period_obj *dpobj;
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) {
return;
}
if (!dpobj->end) {
return;
}
php_date_instantiate(dpobj->start_ce, return_value);
dateobj = Z_PHPDATE_P(return_value);
dateobj->time = timelib_time_ctor();
*dateobj->time = *dpobj->end;
if (dpobj->end->tz_abbr) {
dateobj->time->tz_abbr = timelib_strdup(dpobj->end->tz_abbr);
}
if (dpobj->end->tz_info) {
dateobj->time->tz_info = dpobj->end->tz_info;
}
php_date_instantiate(dpobj->start_ce, return_value);
dateobj = Z_PHPDATE_P(return_value);
dateobj->time = timelib_time_ctor();
*dateobj->time = *dpobj->end;
if (dpobj->end->tz_abbr) {
dateobj->time->tz_abbr = timelib_strdup(dpobj->end->tz_abbr);
}
if (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 */
#endif
#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
#if DBA_DB1
DBA_HND(db1, DBA_LOCK_ALL) /* No lock in lib */
@ -404,7 +404,7 @@ ZEND_INI_MH(OnUpdateDefaultHandler)
}
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()
/* }}} */
@ -448,10 +448,10 @@ PHP_MINFO_FUNCTION(dba)
for(hptr = handler; hptr->name; hptr++) {
smart_str_appends(&handlers, hptr->name);
smart_str_appendc(&handlers, ' ');
}
}
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) {
smart_str_0(&handlers);
php_info_print_table_row(2, "Supported handlers", ZSTR_VAL(handlers.s));
@ -1172,7 +1172,7 @@ PHP_FUNCTION(dba_handlers)
} else {
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));
if (handler != NULL) {
if (handler != NULL) {
xmlCharEncCloseFunc(handler);
if (docp->encoding != NULL) {
xmlFree((xmlChar *)docp->encoding);
}
docp->encoding = xmlStrdup((const xmlChar *) ZSTR_VAL(str));
} else {
} else {
zend_value_error("Invalid document encoding");
return FAILURE;
}
}
zend_string_release_ex(str, 0);
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) /* {{{ */
{
xmlDocPtr ret;
xmlParserCtxtPtr ctxt = NULL;
xmlDocPtr ret;
xmlParserCtxtPtr ctxt = NULL;
dom_doc_propsptr doc_props;
dom_object *intern;
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 */
static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) /* {{{ */
{
xmlAttrPtr prop;
xmlAttrPtr prop;
xmlNodePtr cur;
if (tree) {
if (tree) {
if(tree->type == XML_ELEMENT_NODE) {
prop = tree->properties;
while (prop != NULL) {
@ -87,7 +87,7 @@ static void php_dom_xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc) /* {{{ */
}
}
tree->doc = doc;
}
}
}
/* }}} */

View File

@ -61,9 +61,9 @@ xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const
xmlEntityPtr ret;
ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
memset(ret, 0, sizeof(xmlEntity));
ret->type = XML_NOTATION_NODE;
ret->name = xmlStrdup(name);
memset(ret, 0, sizeof(xmlEntity));
ret->type = XML_NOTATION_NODE;
ret->name = xmlStrdup(name);
ret->ExternalID = xmlStrdup(ExternalID);
ret->SystemID = xmlStrdup(SystemID);
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) /* {{{ */
{
int len;
const xmlChar *nqname;
int len;
const xmlChar *nqname;
nqname = xmlSplitQName3(name, &len);
if (nqname != NULL) {
@ -570,9 +570,9 @@ PHP_METHOD(DOMElement, getAttributeNS)
static xmlNsPtr _dom_new_reconNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) /* {{{ */
{
xmlNsPtr def;
xmlChar prefix[50];
int counter = 1;
xmlNsPtr def;
xmlChar prefix[50];
int counter = 1;
if ((tree == NULL) || (ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) {
return NULL;
@ -883,12 +883,12 @@ PHP_METHOD(DOMElement, setAttributeNodeNS)
RETURN_FALSE;
}
nsp = attrp->ns;
if (nsp != NULL) {
existattrp = xmlHasNsProp(nodep, nsp->href, attrp->name);
} else {
existattrp = xmlHasProp(nodep, attrp->name);
}
nsp = attrp->ns;
if (nsp != NULL) {
existattrp = xmlHasNsProp(nodep, nsp->href, attrp->name);
} else {
existattrp = xmlHasProp(nodep, attrp->name);
}
if (existattrp != NULL && existattrp->type != XML_ATTRIBUTE_DECL) {
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);
}
if (buf != NULL) {
if (buf != NULL) {
ret = xmlC14NDocSaveTo(docp, nodeset, exclusive, inclusive_ns_prefixes,
with_comments, buf);
}
@ -1680,9 +1680,9 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
xmlXPathFreeContext(ctxp);
}
if (buf == NULL || ret < 0) {
RETVAL_FALSE;
} else {
if (buf == NULL || ret < 0) {
RETVAL_FALSE;
} else {
if (mode == 0) {
#ifdef LIBXML2_NEW_BUFFER
ret = xmlOutputBufferGetSize(buf);
@ -1699,7 +1699,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
RETVAL_EMPTY_STRING();
}
}
}
}
if (buf) {
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) /* {{{ */
{
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);
if (intern->node) {
nodep = intern->node->node;
nodep = intern->node->node;
}
return nodep;
@ -1244,7 +1244,7 @@ int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child)
nodep = nodep->parent;
}
return SUCCESS;
return SUCCESS;
}
/* }}} end dom_hierarchy */

View File

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

View File

@ -134,12 +134,12 @@ ZEND_INI_MH(OnUpdateDecode)
}
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.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.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_intel", "JIS", PHP_INI_ALL, OnUpdateDecode, decode_jis_le, 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_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.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)
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.Width", ImageInfo.Thumbnail.width);
}
EFREE_IF(sections_str);
EFREE_IF(sections_str);
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, &ImageInfo, E_NOTICE, "Adding image infos");
@ -4779,7 +4779,7 @@ PHP_FUNCTION(exif_imagetype)
char *imagefile;
size_t imagefile_len;
php_stream * stream;
int itype = 0;
int itype = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &imagefile, &imagefile_len) == FAILURE) {
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;
again:
switch (kind) {
switch (kind) {
case ZEND_FFI_TYPE_FLOAT:
return &ffi_type_float;
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;
again:
switch (kind) {
switch (kind) {
case ZEND_FFI_TYPE_FLOAT:
dval = zval_get_double(value);
*(float*)ptr = dval;
@ -1948,7 +1948,7 @@ static HashTable *zend_ffi_cdata_get_debug_info(zend_object *obj, int *is_temp)
return NULL;
}
switch (type->kind) {
switch (type->kind) {
case ZEND_FFI_TYPE_BOOL:
case ZEND_FFI_TYPE_CHAR:
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);
again:
switch (kind) {
switch (kind) {
case ZEND_FFI_TYPE_FLOAT:
dval = zval_get_double(arg);
*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 (preload) {
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);
}
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) /* {{{ */
{
zend_bad_array_access(obj->ce);
zend_bad_array_access(obj->ce);
return NULL;
}
/* }}} */
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) /* {{{ */
{
zend_bad_array_access(obj->ce);
zend_bad_array_access(obj->ce);
return 0;
}
/* }}} */
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) /* {{{ */
{
zend_bad_property_access(obj->ce);
zend_bad_property_access(obj->ce);
return &EG(uninitialized_zval);
}
/* }}} */
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);
return value;
zend_bad_array_access(obj->ce);
return value;
}
/* }}} */
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;
}
/* }}} */
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) */
#define FETCH_DOUBLE_OPTION(var_name, option_name) \
var_name = 0; \
var_name = 0; \
var_name##_set = 0; \
if (option_array) { \
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) */
#define FETCH_LONG_OPTION(var_name, option_name) \
var_name = 0; \
var_name = 0; \
var_name##_set = 0; \
if (option_array) { \
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 */
ipv4 = memchr(str, '.', str_len);
if (ipv4) {
while (ipv4 > str && *(ipv4-1) != ':') {
while (ipv4 > str && *(ipv4-1) != ':') {
ipv4--;
}

View File

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

View File

@ -1856,7 +1856,7 @@ ZEND_FUNCTION(gmp_com)
/* {{{ Finds next prime of a */
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");
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);
RETURN_THROWS();
}
}
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
joaat_buf(void *buf, size_t len, uint32_t hval)
{
size_t i;
unsigned char *input = (unsigned char *)buf;
size_t i;
unsigned char *input = (unsigned char *)buf;
for (i = 0; i < len; i++) {
hval += input[i];
hval += (hval << 10);
hval ^= (hval >> 6);
}
for (i = 0; i < len; i++) {
hval += input[i];
hval += (hval << 10);
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
static int _php_check_ignore(const char *charset)
{
size_t clen = strlen(charset);
if (clen >= 9 && strcmp("//IGNORE", charset+clen-8) == 0) {
return 1;
}
if (clen >= 19 && strcmp("//IGNORE//TRANSLIT", charset+clen-18) == 0) {
return 1;
}
return 0;
size_t clen = strlen(charset);
if (clen >= 9 && strcmp("//IGNORE", charset+clen-8) == 0) {
return 1;
}
if (clen >= 19 && strcmp("//IGNORE//TRANSLIT", charset+clen-18) == 0) {
return 1;
}
return 0;
}
#else
#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];
int8_t chars_len = sizeof(chars);
UErrorCode uerror = U_ZERO_ERROR;
if(!objval->src) {
php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initialized yet");
if(!objval->src) {
php_converter_throw_failure(objval, U_INVALID_STATE_ERROR, "Source Converter has not been initialized yet");
chars[0] = 0x1A;
chars[1] = 0;
chars_len = 1;
ZEND_TRY_ASSIGN_REF_LONG(error, U_INVALID_STATE_ERROR);
RETVAL_STRINGL(chars, chars_len);
return;
}
RETVAL_STRINGL(chars, chars_len);
return;
}
/* Yes, this is fairly wasteful at first glance,
* but considering that the alternative is to store
@ -197,7 +197,7 @@ static void php_converter_append_toUnicode_target(zval *val, UConverterToUnicode
}
default:
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,
NULL, NULL, &error);
NULL, NULL, &error);
if (U_FAILURE(error)) {
THROW_UFAILURE(objval, "ucnv_setToUCallBack", error);
ret = 0;
@ -353,7 +353,7 @@ static inline bool php_converter_set_callbacks(php_converter_object *objval, UCo
error = U_ZERO_ERROR;
ucnv_setFromUCallBack(cnv, (UConverterFromUCallback)php_converter_from_u_callback, (const void*)objval,
NULL, NULL, &error);
NULL, NULL, &error);
if (U_FAILURE(error)) {
THROW_UFAILURE(objval, "ucnv_setFromUCallBack", error);
ret = 0;
@ -364,9 +364,8 @@ static inline bool php_converter_set_callbacks(php_converter_object *objval, UCo
/* {{{ php_converter_set_encoding */
static bool php_converter_set_encoding(php_converter_object *objval,
UConverter **pcnv,
const char *enc, size_t enc_len
) {
UConverter **pcnv,
const char *enc, size_t enc_len) {
UErrorCode error = U_ZERO_ERROR;
UConverter *cnv = ucnv_open(enc, &error);
@ -461,8 +460,8 @@ PHP_METHOD(UConverter, getSourceEncoding) {
/* {{{ */
PHP_METHOD(UConverter, getDestinationEncoding) {
php_converter_object *objval = CONV_GET(ZEND_THIS);
php_converter_do_get_encoding(objval, objval->dest, INTERNAL_FUNCTION_PARAM_PASSTHRU);
php_converter_object *objval = CONV_GET(ZEND_THIS);
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_converter_object *objval = CONV_GET(ZEND_THIS);
php_converter_object *objval = CONV_GET(ZEND_THIS);
char *str;
size_t str_len;
zend_string *ret;

View File

@ -739,7 +739,7 @@ PHP_FUNCTION(grapheme_extract)
ZVAL_DEREF(next);
/* initialize 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)) ) {
size_t nsize = MIN(size, str_len);
size_t nsize = MIN(size, str_len);
if ( NULL != next ) {
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)
{
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) {
/* We can not return long strings from ICU functions, so we won't here too */
return;
}
if(str_len > INT32_MAX) {
/* We can not return long strings from ICU functions, so we won't here too */
return;
}
/* if "from" position is negative, count start position from the end
* of the string
*/
if (f < 0) {
f = str_len2 + f;
if (f < 0) {
f = 0;
}
} else if (f > str_len2) {
/* if "from" position is negative, count start position from the end
* of the string
*/
if (f < 0) {
f = str_len2 + f;
if (f < 0) {
f = 0;
}
} else if (f > str_len2) {
f = str_len2;
}
/* if "length" position is negative, set it to the length
* needed to stop that many chars from the end of the string
*/
if (l < 0) {
l = (str_len2 - f) + l;
if (l < 0) {
l = 0;
}
} else if (l > str_len2 - f) {
/* if "length" position is negative, set it to the length
* needed to stop that many chars from the end of the string
*/
if (l < 0) {
l = (str_len2 - f) + l;
if (l < 0) {
l = 0;
}
} else if (l > str_len2 - f) {
l = str_len2 - f;
}
*sub_str = str + f;
*sub_str_len = l;
*sub_str = str + f;
*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 */
zend_long
grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset)
zend_long grapheme_strrpos_ascii(char *haystack, size_t haystack_len, char *needle, size_t needle_len, int32_t offset)
{
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",
&loc_name ,&loc_name_len ) == FAILURE) {
RETURN_THROWS();
}
}
if(loc_name_len == 0) {
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;
char* msg = NULL;
char* msg = 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();
}
if(loc_name_len > ULOC_FULLNAME_CAPACITY) {
/* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */
if(loc_name_len > ULOC_FULLNAME_CAPACITY) {
/* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */
spprintf(&msg , 0, "locale_get_display_%s : name too long", tag_name );
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 );
efree(msg);
RETURN_FALSE;
}
}
if(loc_name_len == 0) {
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;
}
/* Get the disp_value for the given locale */
do{
disp_name = erealloc( disp_name , buflen * sizeof(UChar) );
disp_name_len = buflen;
/* Get the disp_value for the given locale */
do{
disp_name = erealloc( disp_name , buflen * sizeof(UChar) );
disp_name_len = buflen;
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
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 */
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 */
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 */
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 */
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)
{
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 )
{
UEnumeration* e = NULL;
UErrorCode status = U_ZERO_ERROR;
UEnumeration* e = NULL;
UErrorCode status = U_ZERO_ERROR;
const char* kw_key = NULL;
int32_t kw_key_len = 0;
const char* kw_key = NULL;
int32_t kw_key_len = 0;
const char* loc_name = NULL;
size_t loc_name_len = 0;
const char* loc_name = NULL;
size_t loc_name_len = 0;
intl_error_reset( NULL );
intl_error_reset( NULL );
if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE)
{
RETURN_THROWS();
}
if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE)
{
RETURN_THROWS();
}
INTL_CHECK_LOCALE_LEN(strlen(loc_name));
if(loc_name_len == 0) {
loc_name = intl_locale_get_default();
}
if(loc_name_len == 0) {
loc_name = intl_locale_get_default();
}
/* Get the keywords */
e = uloc_openKeywords( loc_name, &status );
if( e != NULL )
{
e = uloc_openKeywords( loc_name, &status );
if( e != NULL ) {
/*
ICU expects the buffer to be allocated before calling the function
and so the buffer size has been explicitly specified
@ -669,10 +668,10 @@ PHP_FUNCTION( locale_get_keywords )
*/
/* 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 ){
int32_t kw_value_len = 100;
while( ( kw_key = uenum_next( e, &kw_key_len, &status ) ) != NULL ){
int32_t kw_value_len = 100;
zend_string *kw_value_str = zend_string_alloc(kw_value_len, 0);
/* Get the keyword value for each keyword */
@ -690,15 +689,15 @@ PHP_FUNCTION( locale_get_keywords )
zend_string_efree( kw_value_str );
}
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 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 */
PHP_FUNCTION(locale_parse)
{
const char* loc_name = NULL;
size_t loc_name_len = 0;
int grOffset = 0;
const char* loc_name = NULL;
size_t loc_name_len = 0;
int grOffset = 0;
intl_error_reset( NULL );
intl_error_reset( NULL );
if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE)
{
RETURN_THROWS();
}
if(zend_parse_parameters( ZEND_NUM_ARGS(), "s",
&loc_name, &loc_name_len ) == FAILURE)
{
RETURN_THROWS();
}
INTL_CHECK_LOCALE_LEN(strlen(loc_name));
INTL_CHECK_LOCALE_LEN(strlen(loc_name));
if(loc_name_len == 0) {
loc_name = intl_locale_get_default();
}
if(loc_name_len == 0) {
loc_name = intl_locale_get_default();
}
array_init( return_value );
@ -1108,7 +1107,7 @@ PHP_FUNCTION(locale_get_all_variants)
add_next_index_stringl( return_value, token , strlen(token));
/* tokenize on the "_" or "-" and stop at singleton if any */
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 ){
@ -1127,27 +1126,27 @@ static int strToMatch(const char* str ,char *retstr)
const char* anchor1 = NULL;
int result = 0;
if( (!str) || str[0] == '\0'){
return result;
} else {
anchor = retstr;
anchor1 = str;
while( (*str)!='\0' ){
if( *str == '-' ){
*retstr = '_';
} else {
*retstr = tolower(*str);
if( (!str) || str[0] == '\0'){
return result;
} else {
anchor = retstr;
anchor1 = str;
while( (*str)!='\0' ){
if( *str == '-' ){
*retstr = '_';
} else {
*retstr = tolower(*str);
}
str++;
retstr++;
}
str++;
retstr++;
*retstr = '\0';
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;
int32_t offset = 0;
UErrorCode status = U_ZERO_ERROR;
const UNormalizer2 *norm;
UChar decomposition[32];
int32_t decomposition_length;
UErrorCode status = U_ZERO_ERROR;
const UNormalizer2 *norm;
UChar decomposition[32];
int32_t decomposition_length;
zend_long form = NORMALIZER_DEFAULT;

View File

@ -98,8 +98,8 @@ const char *intl_locale_get_default( void )
/* {{{ INI Settings */
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("intl.error_level", "0", PHP_INI_ALL, OnUpdateLong, error_level, 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_BOOLEAN("intl.use_exceptions", "0", PHP_INI_ALL, OnUpdateBool, use_exceptions, zend_intl_globals, intl_globals)
PHP_INI_END()
/* }}} */
@ -250,15 +250,15 @@ PHP_MINIT_FUNCTION( intl )
PHP_MSHUTDOWN_FUNCTION( intl )
{
const char *cleanup;
/* For the default locale php.ini setting */
UNREGISTER_INI_ENTRIES();
/* For the default locale php.ini setting */
UNREGISTER_INI_ENTRIES();
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();
}
}
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_end();
/* For the default locale php.ini setting */
DISPLAY_INI_ENTRIES() ;
/* For the default locale php.ini setting */
DISPLAY_INI_ENTRIES() ;
}
/* }}} */

View File

@ -167,8 +167,8 @@ static void resourcebundle_array_fetch(zend_object *object, zval *offset, zval *
{
int32_t meindex = 0;
char * mekey = NULL;
bool is_numeric = 0;
char *pbuf;
bool is_numeric = 0;
char *pbuf;
ResourceBundle_object *rb;
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;
Spoofchecker_object *sfo, *new_sfo;
sfo = php_intl_spoofchecker_fetch_object(object);
intl_error_reset(SPOOFCHECKER_ERROR_P(sfo));
sfo = php_intl_spoofchecker_fetch_object(object);
intl_error_reset(SPOOFCHECKER_ERROR_P(sfo));
new_obj_val = Spoofchecker_ce_ptr->create_object(object->ce);
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);
zend_object_std_init( &intern->zo, ce );
object_properties_init( &intern->zo, ce );
object_properties_init( &intern->zo, ce );
transliterator_object_init( intern );
intern->zo.handlers = &Transliterator_handlers;

View File

@ -179,7 +179,7 @@ PHP_FUNCTION( transliterator_create_from_rules )
}
zval_ptr_dtor( return_value );
RETURN_NULL();
}
}
transliterator_object_construct( object, utrans, TRANSLITERATOR_ERROR_CODE_P( to ) );
/* 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" );

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) {
x ^= d;
x = ((x >> 16) ^ x) * 0x45d9f3b;
return x;
x ^= d;
x = ((x >> 16) ^ x) * 0x45d9f3b;
return x;
}
#define CODE_NOT_FOUND ((unsigned) -1)

View File

@ -44,7 +44,7 @@ if (!obj->ptr || !(MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr) { \
return FAILURE; \
} else { \
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) \
@ -173,8 +173,8 @@ static int link_affected_rows_read(mysqli_object *obj, zval *retval, bool quiet)
CHECK_STATUS(MYSQLI_STATUS_VALID, quiet);
mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
ZEND_ASSERT(mysql);
mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
ZEND_ASSERT(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);
mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
if (mysql) {
array_init(retval);
@ -260,7 +260,7 @@ static int result_type_read(mysqli_object *obj, zval *retval, bool quiet)
MYSQL_RES *p;
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);
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);
p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
p = (MY_STMT*)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
ZEND_ASSERT(p);
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);
p = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
p = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
ZEND_ASSERT(p);
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);
stmt = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
stmt = (MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
if (stmt && stmt->stmt) {
array_init(retval);
#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_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;
}
}
if (conn->m->get_server_version(conn) >= 50123) {
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)
{
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
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;
}
@ -814,9 +814,9 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle,
if (PASS == conn->m->local_tx_start(conn, this_func)) {
mysqlnd_options4(conn_handle, MYSQL_OPT_CONNECT_ATTR_ADD, "_client_name", "mysqlnd");
if (hostname.l > 0) {
mysqlnd_options4(conn_handle, MYSQL_OPT_CONNECT_ATTR_ADD, "_server_host", hostname.s);
}
if (hostname.l > 0) {
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);
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;
}
if (field->decimals > 0 && field->decimals < 7) {
ZVAL_STR(zv, zend_strpprintf(0, "%s%02u:%02u:%02u.%0*u",
if (field->decimals > 0 && field->decimals < 7) {
ZVAL_STR(zv, zend_strpprintf(0, "%s%02u:%02u:%02u.%0*u",
(t.neg ? "-" : ""), t.hour, t.minute, t.second, field->decimals,
(uint32_t) (t.second_part / pow(10, 6 - field->decimals))));
} else {
ZVAL_STR(zv, zend_strpprintf(0, "%s%02u:%02u:%02u",
} else {
ZVAL_STR(zv, zend_strpprintf(0, "%s%02u:%02u:%02u",
(t.neg ? "-" : ""), t.hour, t.minute, t.second));
}
}
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;
}
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",
t.year, t.month, t.day, t.hour, t.minute, t.second, 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",
t.year, t.month, t.day, t.hour, t.minute, t.second));
}
}
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 */
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));
packet->server_capabilities |= ((uint32_t) uint2korr(pad_start)) << 16;
/* 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);
efree(define);
efree(define);
}
/* }}} */
@ -1885,7 +1885,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
} else {
RETURN_FALSE;
}
}
}
#endif /* OCI_MAJOR_VERSION */
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);
iserror = 1;
goto exit_create_spool;
}
}
/* }}} */
/* {{{ 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) {
descriptor->connection->descriptor_count = 0;
} else {
/* delete descriptor from the hash */
zend_hash_index_del(descriptor->connection->descriptors, descriptor->index);
/* delete descriptor from the hash */
zend_hash_index_del(descriptor->connection->descriptors, descriptor->index);
if (descriptor->index + 1 == descriptor->connection->descriptor_count) {
/* If the descriptor being freed is the end-most one
* 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;
}
/* }}} */
/* }}} */
/* {{{ php_oci_lob_append()
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) {
zend_hash_apply(statement->columns, php_oci_cleanup_pre_fetch);
}
}
#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));

View File

@ -1150,7 +1150,7 @@ PHP_FUNCTION(odbc_cursor)
SQLUSMALLINT max_len;
SQLSMALLINT len;
char *cursorname;
odbc_result *result;
odbc_result *result;
RETCODE rc;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &pv_res) == FAILURE) {
@ -2063,7 +2063,7 @@ PHP_FUNCTION(odbc_result_all)
break;
}
}
php_printf("</tr>\n");
php_printf("</tr>\n");
#ifdef HAVE_SQL_EXTENDED_FETCH
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)
{
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);
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) {
unsigned __int64 ftime;
@ -1145,16 +1145,16 @@ zend_string *accel_make_persistent_key(zend_string *str)
ZSTR_LEN(&ZCG(key)) = 0;
/* 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 */
} else if (UNEXPECTED(is_stream_path(path))) {
} else if (UNEXPECTED(is_stream_path(path))) {
if (!is_cacheable_stream_path(path)) {
return NULL;
}
/* pass */
} else if (UNEXPECTED(!ZCG(accel_directives).use_cwd)) {
} else if (UNEXPECTED(!ZCG(accel_directives).use_cwd)) {
/* pass */
} else {
} else {
const char *include_path = NULL, *cwd = NULL;
int include_path_len = 0, cwd_len = 0;
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;
uint32_t orig_compiler_options = 0;
/* Try to open file */
if (file_handle->type == ZEND_HANDLE_FILENAME) {
if (accelerator_orig_zend_stream_open_function(file_handle) != SUCCESS) {
/* Try to open file */
if (file_handle->type == ZEND_HANDLE_FILENAME) {
if (accelerator_orig_zend_stream_open_function(file_handle) != SUCCESS) {
*op_array_p = NULL;
if (!EG(exception)) {
if (type == ZEND_REQUIRE) {
@ -1715,8 +1715,8 @@ static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handl
}
}
return NULL;
}
}
}
}
/* 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))) {
@ -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 */
/* 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 */
/* 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 */
if (PG(auto_globals_jit)) {
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)
{
char *phar_path, *ptr;
int ret;
if ((ZSTR_LEN(persistent_script->script.filename)<sizeof("phar://.phar")) ||
memcmp(ZSTR_VAL(persistent_script->script.filename), "phar://", sizeof("phar://")-1)) {
char *phar_path, *ptr;
int ret;
if ((ZSTR_LEN(persistent_script->script.filename)<sizeof("phar://.phar")) ||
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 {
/* 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);
if ((ptr = strstr(phar_path, ".phar/")) != NULL)
{
*(ptr+sizeof(".phar/")-2) = 0; /* strip path inside .phar file */
}
ret = access(phar_path, R_OK) != 0;
efree(phar_path);
return ret;
}
} else {
/* 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);
if ((ptr = strstr(phar_path, ".phar/")) != NULL)
{
*(ptr+sizeof(".phar/")-2) = 0; /* strip path inside .phar file */
}
ret = access(phar_path, R_OK) != 0;
efree(phar_path);
return ret;
}
}
/* zend_compile() replacement */
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();
/* 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
*/
from_shared_memory = 0;
* If it isn't compile_and_cache_file() changes the flag to 0
*/
from_shared_memory = 0;
if (persistent_script) {
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();
HANDLE_UNBLOCK_INTERRUPTIONS();
/* Fetch jit auto globals used in the script before execution */
if (persistent_script->ping_auto_globals_mask & ~ZCG(auto_globals_mask)) {
/* Fetch jit auto globals used in the script before execution */
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));
}
@ -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);
if (!ZCG(accelerator_enabled) ||
(ZCSG(restart_in_progress) && accel_restart_is_active())) {
(ZCSG(restart_in_progress) && accel_restart_is_active())) {
return NULL;
}
@ -2781,8 +2780,8 @@ static int accelerator_remove_cb(zend_extension *element1, zend_extension *eleme
element1->op_array_handler = NULL;
#ifdef __DEBUG_MESSAGES__
fprintf(stderr, ACCELERATOR_PRODUCT_NAME " is disabled: %s\n", (zps_failure_reason ? zps_failure_reason : "unknown error"));
fflush(stderr);
fprintf(stderr, ACCELERATOR_PRODUCT_NAME " is disabled: %s\n", (zps_failure_reason ? zps_failure_reason : "unknown error"));
fflush(stderr);
#endif
}
@ -3457,7 +3456,7 @@ static void preload_shutdown(void)
zval *zv;
#if 0
if (EG(zend_constants)) {
if (EG(zend_constants)) {
ZEND_HASH_REVERSE_FOREACH_VAL(EG(zend_constants), zv) {
zend_constant *c = Z_PTR_P(zv);
if (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) {
@ -3467,7 +3466,7 @@ static void preload_shutdown(void)
}
#endif
if (EG(function_table)) {
if (EG(function_table)) {
ZEND_HASH_REVERSE_FOREACH_VAL(EG(function_table), zv) {
zend_function *func = Z_PTR_P(zv);
if (func->type == ZEND_INTERNAL_FUNCTION) {
@ -5094,7 +5093,7 @@ ZEND_EXT_API zend_extension zend_extension_entry = {
NULL, /* shutdown */
NULL, /* per-script activation */
#ifdef HAVE_JIT
accel_deactivate, /* per-script deactivation */
accel_deactivate, /* per-script deactivation */
#else
NULL, /* per-script deactivation */
#endif

View File

@ -1280,7 +1280,7 @@ static int zend_jit_op_array_analyze1(const zend_op_array *op_array, zend_script
}
#endif
/* TODO: move this to zend_cfg.c ? */
/* TODO: move this to zend_cfg.c ? */
if (!op_array->function_name) {
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 =
(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
| ZEND_FUNC_JIT_ON_PROF_REQUEST
| 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);
#endif
op_array = &EX(func)->op_array;
op_array = &EX(func)->op_array;
jit_extension =
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
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);
#endif
#ifdef PROT_MAX
flags |= PROT_MAX(PROT_READ | PROT_WRITE | PROT_EXEC);
flags |= PROT_MAX(PROT_READ | PROT_WRITE | PROT_EXEC);
#endif
#ifdef MAP_HUGETLB
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[1] = buf;
ReportEvent(h, // event log handle
EVENTLOG_ERROR_TYPE, // event type
0, // category zero
err, // event identifier
NULL, // no user security identifier
2, // one substitution string
0, // no data
ev_msgs, // pointer to string array
NULL); // pointer to data
EVENTLOG_ERROR_TYPE, // event type
0, // category zero
err, // event identifier
NULL, // no user security identifier
2, // one substitution string
0, // no data
ev_msgs, // pointer to string array
NULL); // pointer to data
DeregisterEventSource(h);
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)
{
zend_ulong hash_value;
zend_ulong index;
zend_accel_hash_entry *entry, *last_entry=NULL;
zend_ulong hash_value;
zend_ulong index;
zend_accel_hash_entry *entry, *last_entry=NULL;
hash_value = zend_string_hash_val(key);
#ifndef ZEND_WIN32

View File

@ -56,7 +56,7 @@
zend_string_hash_val(str); \
zend_set_str_gc_flags(str); \
} \
} while (0)
} while (0)
#define zend_accel_memdup_string(str) do { \
zend_string *new_str = zend_shared_alloc_get_xlat_entry(str); \
if (new_str) { \
@ -67,7 +67,7 @@
zend_string_hash_val(str); \
zend_set_str_gc_flags(str); \
} \
} while (0)
} while (0)
#define zend_accel_store_interned_string(str) do { \
if (!IS_ACCEL_INTERNED(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;
#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
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
end = p + op_array->last_literal;
op_array->literals = p;
end = p + op_array->last_literal;
op_array->literals = p;
while (p < end) {
zend_persist_zval(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_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);
}
}
}
}
@ -1243,13 +1243,13 @@ static void zend_accel_persist_class_table(HashTable *class_table)
JIT_G(on) = 0;
#endif
zend_hash_persist(class_table);
zend_hash_persist(class_table);
ZEND_HASH_FOREACH_BUCKET(class_table, p) {
ZEND_ASSERT(p->key != NULL);
zend_accel_store_interned_string(p->key);
Z_CE(p->val) = zend_persist_class_entry(Z_CE(p->val));
} 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)) {
ce = Z_PTR(p->val);
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_register_xlat_entry(&op_array->function_name, old_name);
}
}
}
if (op_array->scope) {
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;
#ifdef ZTS
zts_lock = tsrm_mutex_alloc();
zts_lock = tsrm_mutex_alloc();
#endif
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) /* {{{ */
{
switch (error_code) {
case PHP_PCRE_NO_ERROR:
return "No error";
case PHP_PCRE_INTERNAL_ERROR:
return "Internal error";
case PHP_PCRE_BAD_UTF8_ERROR:
return "Malformed UTF-8 characters, possibly incorrectly encoded";
case PHP_PCRE_BAD_UTF8_OFFSET_ERROR:
return "The offset did not correspond to the beginning of a valid UTF-8 code point";
case PHP_PCRE_BACKTRACK_LIMIT_ERROR:
return "Backtrack limit exhausted";
case PHP_PCRE_RECURSION_LIMIT_ERROR:
return "Recursion limit exhausted";
switch (error_code) {
case PHP_PCRE_NO_ERROR:
return "No error";
case PHP_PCRE_INTERNAL_ERROR:
return "Internal error";
case PHP_PCRE_BAD_UTF8_ERROR:
return "Malformed UTF-8 characters, possibly incorrectly encoded";
case PHP_PCRE_BAD_UTF8_OFFSET_ERROR:
return "The offset did not correspond to the beginning of a valid UTF-8 code point";
case PHP_PCRE_BACKTRACK_LIMIT_ERROR:
return "Backtrack limit exhausted";
case PHP_PCRE_RECURSION_LIMIT_ERROR:
return "Recursion limit exhausted";
#ifdef HAVE_PCRE_JIT_SUPPORT
case PHP_PCRE_JIT_STACKLIMIT_ERROR:
return "JIT stack limit exhausted";
case PHP_PCRE_JIT_STACKLIMIT_ERROR:
return "JIT stack limit exhausted";
#endif
default:
return "Unknown error";
}
default:
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_UTF;
/* 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
the PCRE2_UCP option. */
characters, even in UTF-8 mode. However, this can be changed by setting
the PCRE2_UCP option. */
#ifdef PCRE2_UCP
coptions |= PCRE2_UCP;
#endif
@ -2982,9 +2982,9 @@ PHP_FUNCTION(preg_last_error)
/* {{{ Returns the error message of the last regexp execution. */
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 = {
STANDARD_MODULE_HEADER,
"pcre",
"pcre",
ext_functions,
PHP_MINIT(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) {
/* 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);
} else {
((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;
switch (type) {
PDO_MYSQL_NATIVE_TYPE_NAME(STRING)
PDO_MYSQL_NATIVE_TYPE_NAME(VAR_STRING)
switch (type) {
PDO_MYSQL_NATIVE_TYPE_NAME(STRING)
PDO_MYSQL_NATIVE_TYPE_NAME(VAR_STRING)
#ifdef FIELD_TYPE_TINY
PDO_MYSQL_NATIVE_TYPE_NAME(TINY)
PDO_MYSQL_NATIVE_TYPE_NAME(TINY)
#endif
#ifdef FIELD_TYPE_BIT
PDO_MYSQL_NATIVE_TYPE_NAME(BIT)
PDO_MYSQL_NATIVE_TYPE_NAME(BIT)
#endif
PDO_MYSQL_NATIVE_TYPE_NAME(SHORT)
PDO_MYSQL_NATIVE_TYPE_NAME(LONG)
PDO_MYSQL_NATIVE_TYPE_NAME(LONGLONG)
PDO_MYSQL_NATIVE_TYPE_NAME(INT24)
PDO_MYSQL_NATIVE_TYPE_NAME(FLOAT)
PDO_MYSQL_NATIVE_TYPE_NAME(DOUBLE)
PDO_MYSQL_NATIVE_TYPE_NAME(DECIMAL)
PDO_MYSQL_NATIVE_TYPE_NAME(SHORT)
PDO_MYSQL_NATIVE_TYPE_NAME(LONG)
PDO_MYSQL_NATIVE_TYPE_NAME(LONGLONG)
PDO_MYSQL_NATIVE_TYPE_NAME(INT24)
PDO_MYSQL_NATIVE_TYPE_NAME(FLOAT)
PDO_MYSQL_NATIVE_TYPE_NAME(DOUBLE)
PDO_MYSQL_NATIVE_TYPE_NAME(DECIMAL)
#ifdef FIELD_TYPE_NEWDECIMAL
PDO_MYSQL_NATIVE_TYPE_NAME(NEWDECIMAL)
PDO_MYSQL_NATIVE_TYPE_NAME(NEWDECIMAL)
#endif
#ifdef FIELD_TYPE_GEOMETRY
PDO_MYSQL_NATIVE_TYPE_NAME(GEOMETRY)
PDO_MYSQL_NATIVE_TYPE_NAME(GEOMETRY)
#endif
PDO_MYSQL_NATIVE_TYPE_NAME(TIMESTAMP)
PDO_MYSQL_NATIVE_TYPE_NAME(TIMESTAMP)
#ifdef FIELD_TYPE_YEAR
PDO_MYSQL_NATIVE_TYPE_NAME(YEAR)
PDO_MYSQL_NATIVE_TYPE_NAME(YEAR)
#endif
PDO_MYSQL_NATIVE_TYPE_NAME(SET)
PDO_MYSQL_NATIVE_TYPE_NAME(ENUM)
PDO_MYSQL_NATIVE_TYPE_NAME(DATE)
PDO_MYSQL_NATIVE_TYPE_NAME(SET)
PDO_MYSQL_NATIVE_TYPE_NAME(ENUM)
PDO_MYSQL_NATIVE_TYPE_NAME(DATE)
#ifdef FIELD_TYPE_NEWDATE
PDO_MYSQL_NATIVE_TYPE_NAME(NEWDATE)
PDO_MYSQL_NATIVE_TYPE_NAME(NEWDATE)
#endif
PDO_MYSQL_NATIVE_TYPE_NAME(TIME)
PDO_MYSQL_NATIVE_TYPE_NAME(DATETIME)
PDO_MYSQL_NATIVE_TYPE_NAME(TINY_BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(MEDIUM_BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(LONG_BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(NULL)
default:
return NULL;
}
PDO_MYSQL_NATIVE_TYPE_NAME(TIME)
PDO_MYSQL_NATIVE_TYPE_NAME(DATETIME)
PDO_MYSQL_NATIVE_TYPE_NAME(TINY_BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(MEDIUM_BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(LONG_BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(BLOB)
PDO_MYSQL_NATIVE_TYPE_NAME(NULL)
default:
return NULL;
}
#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 */
}
/* Copy remainder and add enclosing quote */
/* Copy remainder and add enclosing quote */
strncpy(c, l, quotedlen-(c-quoted)-1);
quoted[quotedlen-1] = '\'';
quoted[quotedlen] = '\0';
@ -851,11 +851,11 @@ static int pdo_oci_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ *
}
/* Get max character width */
H->last_err = OCINlsNumericInfoGet(H->env, H->err, &H->max_char_width, OCI_NLS_CHARSET_MAXBYTESZ);
if (H->last_err) {
oci_drv_error("OCINlsNumericInfoGet: OCI_NLS_CHARSET_MAXBYTESZ");
goto cleanup;
}
H->last_err = OCINlsNumericInfoGet(H->env, H->err, &H->max_char_width, OCI_NLS_CHARSET_MAXBYTESZ);
if (H->last_err) {
oci_drv_error("OCINlsNumericInfoGet: OCI_NLS_CHARSET_MAXBYTESZ");
goto cleanup;
}
dbh->methods = &oci_methods;
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;
if (Z_ISREF(param->parameter))
if (Z_ISREF(param->parameter))
parameter = Z_REFVAL(param->parameter);
else
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) {
pdo_odbc_stmt_error("SQLPrepare");
if (rc != SQL_SUCCESS_WITH_INFO) {
/* clone error information into the db handle */
strcpy(H->einfo.last_err_msg, S->einfo.last_err_msg);
H->einfo.file = S->einfo.file;
H->einfo.line = S->einfo.line;
H->einfo.what = S->einfo.what;
strcpy(dbh->error_code, stmt->error_code);
}
if (rc != SQL_SUCCESS_WITH_INFO) {
/* clone error information into the db handle */
strcpy(H->einfo.last_err_msg, S->einfo.last_err_msg);
H->einfo.file = S->einfo.file;
H->einfo.line = S->einfo.line;
H->einfo.what = S->einfo.what;
strcpy(dbh->error_code, stmt->error_code);
}
}
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,
S->cols[colno].is_unicode ? SQL_C_BINARY : SQL_C_CHAR,
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) {
pdo_odbc_stmt_error("SQLBindCol");

View File

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

View File

@ -2613,10 +2613,10 @@ PHP_FUNCTION(pg_lo_read)
/* {{{ Write a large object */
PHP_FUNCTION(pg_lo_write)
{
zval *pgsql_id;
zend_string *str;
zend_long z_len;
bool z_len_is_null = 1;
zval *pgsql_id;
zend_string *str;
zend_long z_len;
bool z_len_is_null = 1;
size_t nbytes;
size_t len;
pgLofp *pgsql;
@ -2654,7 +2654,7 @@ PHP_FUNCTION(pg_lo_write)
/* {{{ Read a large object and send straight to browser */
PHP_FUNCTION(pg_lo_read_all)
{
zval *pgsql_id;
zval *pgsql_id;
int tbytes;
volatile int nbytes;
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_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;
smart_str querystr = {0};

View File

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

View File

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

View File

@ -206,7 +206,7 @@ PHP_FUNCTION(posix_kill)
if (kill(pid, sig) < 0) {
POSIX_G(last_error) = errno;
RETURN_FALSE;
}
}
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;
zend_module_entry pspell_module_entry = {
STANDARD_MODULE_HEADER,
STANDARD_MODULE_HEADER,
"pspell",
ext_functions,
PHP_MINIT(pspell),
@ -615,7 +615,7 @@ PHP_FUNCTION(pspell_config_create)
pspell_config_replace(config, "language-tag", language);
if (spelling_len) {
if (spelling_len) {
pspell_config_replace(config, "spelling", spelling);
}

View File

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

View File

@ -3048,10 +3048,10 @@ ZEND_METHOD(ReflectionUnionType, getTypes)
zend_string *name = ZEND_TYPE_NAME(param->type);
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));
} else {
append_type(return_value,
} else {
append_type(return_value,
(zend_type) ZEND_TYPE_INIT_CLASS(name, 0, 0));
}
} else if (ZEND_TYPE_HAS_CE(param->type)) {
@ -6133,9 +6133,9 @@ ZEND_METHOD(ReflectionExtension, info)
ZEND_METHOD(ReflectionExtension, isPersistent)
{
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();
}
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; \
} else if (Z_TYPE(retval) == IS_FALSE) { \
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)) { \
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]) {
smart_str_appends(&ncookie, COOKIE_SAMESITE);
smart_str_appends(&ncookie, PS(cookie_samesite));
}
smart_str_appends(&ncookie, COOKIE_SAMESITE);
smart_str_appends(&ncookie, PS(cookie_samesite));
}
smart_str_0(&ncookie);
@ -2327,7 +2327,7 @@ PHP_FUNCTION(session_create_id)
/* Detect collision and retry */
if (PS(mod)->s_validate_sid(&PS(mod_data), new_id) == SUCCESS) {
zend_string_release_ex(new_id, 0);
new_id = NULL;
new_id = NULL;
continue;
}
break;

View File

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

View File

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

View File

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

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);
stream = NULL;
}
smart_str_free(&soap_headers);
smart_str_free(&soap_headers);
if (stream) {
if (stream) {
zend_string *http_headers = get_http_headers(stream);
if (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 */
if (stream) {
/* 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;
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "_ssl_method", sizeof("_ssl_method")-1)) != NULL &&
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)
{
if (domain[0] == '.') {
int l1 = strlen(host);
int l2 = strlen(domain);
if (l1 > l2) {
return strcmp(host+l1-l2,domain) == 0;
} else {
return 0;
}
} else {
return strcmp(host,domain) == 0;
}
if (domain[0] == '.') {
int l1 = strlen(host);
int l2 = strlen(domain);
if (l1 > l2) {
return strcmp(host+l1-l2,domain) == 0;
} else {
return 0;
}
} else {
return strcmp(host,domain) == 0;
}
}
int make_http_soap_request(zval *this_ptr,
@ -493,14 +493,14 @@ try_again:
(!use_ssl && !zend_string_equals_literal(orig->scheme, "https"))) &&
zend_string_equals(orig->host, phpurl->host) &&
orig->port == phpurl->port))) {
} else {
} else {
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), "httpsocket", sizeof("httpsocket")-1);
zend_hash_str_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")-1);
stream = NULL;
use_proxy = 0;
}
}
}
/* 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;
http_buf_size += len_read;
}
}
/* Eat up '\r' '\n' */
ch = php_stream_getc(stream);
@ -1494,7 +1494,7 @@ static zend_string* get_http_body(php_stream *stream, int close, char *headers)
}
return NULL;
}
}
}
} else {
/* Something wrong in chunked encoding */
if (http_buf) {

View File

@ -1886,8 +1886,8 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
attr = attr->next;
}
if (newAttr->form == XSD_FORM_DEFAULT) {
xmlNodePtr parent = attrType->parent;
while (parent) {
xmlNodePtr parent = attrType->parent;
while (parent) {
if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) {
xmlAttrPtr def;
def = get_attribute(parent->properties, "attributeFormDefault");
@ -1899,7 +1899,7 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
break;
}
parent = parent->parent;
}
}
if (parent == NULL) {
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 */
if ((tmp = php_stream_context_get_option(context, "http", "protocol_version")) == NULL) {
zval http_version;
zval http_version;
ZVAL_DOUBLE(&http_version, 1.1);
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 &&
Z_TYPE_P(tmp) == IS_STRING) {
if (!context) {
context = php_stream_context_alloc();
}
php_stream_context_set_option(context, "ssl", "local_cert", tmp);
if (!context) {
context = php_stream_context_alloc();
}
php_stream_context_set_option(context, "ssl", "local_cert", tmp);
if ((tmp = zend_hash_str_find(ht, "passphrase", sizeof("passphrase")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
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 &&
Z_TYPE_P(tmp) == IS_LONG) {
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 (Z_TYPE_P(tmp) != IS_LONG) {
@ -2255,9 +2255,9 @@ static void do_soap_call(zend_execute_data *execute_data,
{
zval *tmp;
zval *trace;
sdlPtr sdl = NULL;
sdlPtr old_sdl = NULL;
sdlFunctionPtr fn;
sdlPtr sdl = NULL;
sdlPtr old_sdl = NULL;
sdlFunctionPtr fn;
xmlDocPtr request = NULL;
int ret = FALSE;
int soap_version;
@ -2297,7 +2297,7 @@ static void do_soap_call(zend_execute_data *execute_data,
FETCH_TYPEMAP_RES(typemap,tmp);
}
clear_soap_fault(this_ptr);
clear_soap_fault(this_ptr);
SOAP_GLOBAL(soap_version) = soap_version;
old_sdl = SOAP_GLOBAL(sdl);
@ -2328,8 +2328,8 @@ static void do_soap_call(zend_execute_data *execute_data,
zend_try {
if (sdl != NULL) {
fn = get_function(sdl, function);
if (fn != NULL) {
fn = get_function(sdl, function);
if (fn != NULL) {
sdlBindingPtr binding = fn->binding;
bool one_way = 0;
@ -2345,12 +2345,12 @@ static void do_soap_call(zend_execute_data *execute_data,
}
if (binding->bindingType == BINDING_SOAP) {
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);
} else {
} else {
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);
}
}
xmlFreeDoc(request);
request = NULL;

View File

@ -226,9 +226,9 @@ static unsigned from_array_iterate(const zval *arr,
break;
}
i++;
} ZEND_HASH_FOREACH_END();
} ZEND_HASH_FOREACH_END();
return i -1;
return i -1;
}
/* 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_HASH_FOREACH_END();
msg->msg_control = control_buf;
msg->msg_controllen = cur_offset; /* not control_len, which may be larger */
msg->msg_control = control_buf;
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)
{
@ -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_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)
{
@ -1376,7 +1376,7 @@ void from_zval_write_fd_array(const zval *arr, char *int_arr, ser_context *ctx)
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)
{

View File

@ -2168,11 +2168,11 @@ int socket_import_file_descriptor(PHP_SOCKET socket, php_socket *retsock)
int t;
#endif
retsock->bsd_socket = socket;
retsock->bsd_socket = socket;
/* determine family */
/* determine family */
#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;
} else
#endif
@ -2183,18 +2183,18 @@ int socket_import_file_descriptor(PHP_SOCKET socket, php_socket *retsock)
return 0;
}
/* determine blocking mode */
/* determine blocking mode */
#ifndef PHP_WIN32
t = fcntl(socket, F_GETFL);
if (t == -1) {
t = fcntl(socket, F_GETFL);
if (t == -1) {
PHP_SOCKET_ERROR(retsock, "Unable to obtain blocking state", errno);
return 0;
} else {
retsock->blocking = !(t & O_NONBLOCK);
}
} else {
retsock->blocking = !(t & O_NONBLOCK);
}
#endif
return 1;
return 1;
}
/* {{{ Imports a stream that encapsulates a socket into a socket extension resource. */
@ -2585,7 +2585,7 @@ PHP_FUNCTION(socket_addrinfo_explain)
#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)
{
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);
zend_string_release(lc_name);
} else {
ce = zend_lookup_class(name);
}
if (ce == NULL) {
ce = zend_lookup_class(name);
}
if (ce == NULL) {
php_error_docref(NULL, E_WARNING, "Class %s does not exist%s", ZSTR_VAL(name), autoload ? " and could not be loaded" : "");
return NULL;
}

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