Skip to content

Commit 7d6a0ba

Browse files
twosenikic
authored andcommitted
Fix expression warnings and break warnings
Close GH-5675.
1 parent 1d82338 commit 7d6a0ba

27 files changed

+60
-60
lines changed

Zend/zend_API.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,7 +2154,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
21542154
scope->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
21552155
}
21562156
}
2157-
if (ptr->flags & ZEND_ACC_STATIC && (!scope || !(scope->ce_flags & ZEND_ACC_INTERFACE))) {
2157+
if ((ptr->flags & ZEND_ACC_STATIC) && (!scope || !(scope->ce_flags & ZEND_ACC_INTERFACE))) {
21582158
zend_error(error_type, "Static function %s%s%s() cannot be abstract", scope ? ZSTR_VAL(scope->name) : "", scope ? "::" : "", ptr->fname);
21592159
}
21602160
} else {
@@ -2992,7 +2992,7 @@ static zend_always_inline int zend_is_callable_check_func(int check_flags, zval
29922992
if (zv != NULL) {
29932993
zend_function *priv_fbc = Z_PTR_P(zv);
29942994

2995-
if (priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE
2995+
if ((priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE)
29962996
&& priv_fbc->common.scope == scope) {
29972997
fcc->function_handler = priv_fbc;
29982998
}
@@ -3096,7 +3096,7 @@ static zend_always_inline int zend_is_callable_check_func(int check_flags, zval
30963096
if (fcc->object) {
30973097
fcc->called_scope = fcc->object->ce;
30983098
if (fcc->function_handler
3099-
&& fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC) {
3099+
&& (fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
31003100
fcc->object = NULL;
31013101
}
31023102
}

Zend/zend_closures.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ ZEND_METHOD(Closure, call)
181181
/* copied upon generator creation */
182182
GC_DELREF(&closure->std);
183183
} else if (ZEND_USER_CODE(my_function.type)
184-
&& fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) {
184+
&& (fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE)) {
185185
efree(ZEND_MAP_PTR(my_function.op_array.run_time_cache));
186186
}
187187
}

Zend/zend_compile.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,7 +2333,7 @@ void zend_emit_final_return(int return_one) /* {{{ */
23332333
zend_op *ret;
23342334
zend_bool returns_reference = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
23352335

2336-
if (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE
2336+
if ((CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE)
23372337
&& !(CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR)) {
23382338
zend_emit_return_type_check(NULL, CG(active_op_array)->arg_info - 1, 1);
23392339
}
@@ -4516,7 +4516,7 @@ void zend_compile_return(zend_ast *ast) /* {{{ */
45164516
}
45174517

45184518
/* Generator return types are handled separately */
4519-
if (!is_generator && CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
4519+
if (!is_generator && (CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) {
45204520
zend_emit_return_type_check(
45214521
expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, 0);
45224522
}
@@ -5492,7 +5492,7 @@ ZEND_API void zend_set_function_arg_flags(zend_function *func) /* {{{ */
54925492
ZEND_SET_ARG_FLAG(func, i + 1, ZEND_ARG_SEND_MODE(&func->common.arg_info[i]));
54935493
i++;
54945494
}
5495-
if (UNEXPECTED(func->common.fn_flags & ZEND_ACC_VARIADIC && ZEND_ARG_SEND_MODE(&func->common.arg_info[i]))) {
5495+
if (UNEXPECTED((func->common.fn_flags & ZEND_ACC_VARIADIC) && ZEND_ARG_SEND_MODE(&func->common.arg_info[i]))) {
54965496
uint32_t pass_by_reference = ZEND_ARG_SEND_MODE(&func->common.arg_info[i]);
54975497
while (i < MAX_ARG_FLAG_NUM) {
54985498
ZEND_SET_ARG_FLAG(func, i + 1, pass_by_reference);
@@ -9339,7 +9339,7 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
93399339
}
93409340

93419341
/* Set isset fetch indicator here, opcache disallows runtime altering of the AST */
9342-
if (ast->attr & ZEND_DIM_IS && ast->child[0]->kind == ZEND_AST_DIM) {
9342+
if ((ast->attr & ZEND_DIM_IS) && ast->child[0]->kind == ZEND_AST_DIM) {
93439343
ast->child[0]->attr |= ZEND_DIM_IS;
93449344
}
93459345

Zend/zend_object_handlers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ static zend_never_inline zend_function *zend_get_parent_private_method(zend_clas
11561156
func = zend_hash_find(&scope->function_table, function_name);
11571157
if (func != NULL) {
11581158
fbc = Z_FUNC_P(func);
1159-
if (fbc->common.fn_flags & ZEND_ACC_PRIVATE
1159+
if ((fbc->common.fn_flags & ZEND_ACC_PRIVATE)
11601160
&& fbc->common.scope == scope) {
11611161
return fbc;
11621162
}

ext/date/php_date.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4374,17 +4374,17 @@ PHP_METHOD(DatePeriod, getRecurrences)
43744374

43754375
static int check_id_allowed(char *id, zend_long what) /* {{{ */
43764376
{
4377-
if (what & PHP_DATE_TIMEZONE_GROUP_AFRICA && strncasecmp(id, "Africa/", 7) == 0) return 1;
4378-
if (what & PHP_DATE_TIMEZONE_GROUP_AMERICA && strncasecmp(id, "America/", 8) == 0) return 1;
4379-
if (what & PHP_DATE_TIMEZONE_GROUP_ANTARCTICA && strncasecmp(id, "Antarctica/", 11) == 0) return 1;
4380-
if (what & PHP_DATE_TIMEZONE_GROUP_ARCTIC && strncasecmp(id, "Arctic/", 7) == 0) return 1;
4381-
if (what & PHP_DATE_TIMEZONE_GROUP_ASIA && strncasecmp(id, "Asia/", 5) == 0) return 1;
4382-
if (what & PHP_DATE_TIMEZONE_GROUP_ATLANTIC && strncasecmp(id, "Atlantic/", 9) == 0) return 1;
4383-
if (what & PHP_DATE_TIMEZONE_GROUP_AUSTRALIA && strncasecmp(id, "Australia/", 10) == 0) return 1;
4384-
if (what & PHP_DATE_TIMEZONE_GROUP_EUROPE && strncasecmp(id, "Europe/", 7) == 0) return 1;
4385-
if (what & PHP_DATE_TIMEZONE_GROUP_INDIAN && strncasecmp(id, "Indian/", 7) == 0) return 1;
4386-
if (what & PHP_DATE_TIMEZONE_GROUP_PACIFIC && strncasecmp(id, "Pacific/", 8) == 0) return 1;
4387-
if (what & PHP_DATE_TIMEZONE_GROUP_UTC && strncasecmp(id, "UTC", 3) == 0) return 1;
4377+
if ((what & PHP_DATE_TIMEZONE_GROUP_AFRICA) && strncasecmp(id, "Africa/", 7) == 0) return 1;
4378+
if ((what & PHP_DATE_TIMEZONE_GROUP_AMERICA) && strncasecmp(id, "America/", 8) == 0) return 1;
4379+
if ((what & PHP_DATE_TIMEZONE_GROUP_ANTARCTICA) && strncasecmp(id, "Antarctica/", 11) == 0) return 1;
4380+
if ((what & PHP_DATE_TIMEZONE_GROUP_ARCTIC) && strncasecmp(id, "Arctic/", 7) == 0) return 1;
4381+
if ((what & PHP_DATE_TIMEZONE_GROUP_ASIA) && strncasecmp(id, "Asia/", 5) == 0) return 1;
4382+
if ((what & PHP_DATE_TIMEZONE_GROUP_ATLANTIC) && strncasecmp(id, "Atlantic/", 9) == 0) return 1;
4383+
if ((what & PHP_DATE_TIMEZONE_GROUP_AUSTRALIA) && strncasecmp(id, "Australia/", 10) == 0) return 1;
4384+
if ((what & PHP_DATE_TIMEZONE_GROUP_EUROPE) && strncasecmp(id, "Europe/", 7) == 0) return 1;
4385+
if ((what & PHP_DATE_TIMEZONE_GROUP_INDIAN) && strncasecmp(id, "Indian/", 7) == 0) return 1;
4386+
if ((what & PHP_DATE_TIMEZONE_GROUP_PACIFIC) && strncasecmp(id, "Pacific/", 8) == 0) return 1;
4387+
if ((what & PHP_DATE_TIMEZONE_GROUP_UTC) && strncasecmp(id, "UTC", 3) == 0) return 1;
43884388
return 0;
43894389
} /* }}} */
43904390

ext/ffi/ffi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3485,7 +3485,7 @@ static int zend_ffi_validate_incomplete_type(zend_ffi_type *type, zend_bool allo
34853485
}
34863486
zend_ffi_throw_parser_error("Incomplete type at line %d", FFI_G(line));
34873487
return FAILURE;
3488-
} else if (!allow_incomplete_array && type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY) {
3488+
} else if (!allow_incomplete_array && (type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY)) {
34893489
zend_ffi_throw_parser_error("'[]' not allowed at line %d", FFI_G(line));
34903490
return FAILURE;
34913491
} else if (!FFI_G(allow_vla) && (type->attr & ZEND_FFI_ATTR_VLA)) {

ext/mysqlnd/mysqlnd_connection.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_server_version)(const MYSQLND_CONN_DATA *
14391439

14401440
#define MARIA_DB_VERSION_HACK_PREFIX "5.5.5-"
14411441

1442-
if (conn->server_capabilities & CLIENT_PLUGIN_AUTH
1442+
if ((conn->server_capabilities & CLIENT_PLUGIN_AUTH)
14431443
&& !strncmp(p, MARIA_DB_VERSION_HACK_PREFIX, sizeof(MARIA_DB_VERSION_HACK_PREFIX)-1))
14441444
{
14451445
p += sizeof(MARIA_DB_VERSION_HACK_PREFIX)-1;
@@ -2000,24 +2000,24 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_rollback)(MYSQLND_CONN_DATA * conn)
20002000
static void
20012001
MYSQLND_METHOD(mysqlnd_conn_data, tx_cor_options_to_string)(const MYSQLND_CONN_DATA * const conn, smart_str * str, const unsigned int mode)
20022002
{
2003-
if (mode & TRANS_COR_AND_CHAIN && !(mode & TRANS_COR_AND_NO_CHAIN)) {
2003+
if ((mode & TRANS_COR_AND_CHAIN) && !(mode & TRANS_COR_AND_NO_CHAIN)) {
20042004
if (str->s && ZSTR_LEN(str->s)) {
20052005
smart_str_appendl(str, " ", sizeof(" ") - 1);
20062006
}
20072007
smart_str_appendl(str, "AND CHAIN", sizeof("AND CHAIN") - 1);
2008-
} else if (mode & TRANS_COR_AND_NO_CHAIN && !(mode & TRANS_COR_AND_CHAIN)) {
2008+
} else if ((mode & TRANS_COR_AND_NO_CHAIN) && !(mode & TRANS_COR_AND_CHAIN)) {
20092009
if (str->s && ZSTR_LEN(str->s)) {
20102010
smart_str_appendl(str, " ", sizeof(" ") - 1);
20112011
}
20122012
smart_str_appendl(str, "AND NO CHAIN", sizeof("AND NO CHAIN") - 1);
20132013
}
20142014

2015-
if (mode & TRANS_COR_RELEASE && !(mode & TRANS_COR_NO_RELEASE)) {
2015+
if ((mode & TRANS_COR_RELEASE) && !(mode & TRANS_COR_NO_RELEASE)) {
20162016
if (str->s && ZSTR_LEN(str->s)) {
20172017
smart_str_appendl(str, " ", sizeof(" ") - 1);
20182018
}
20192019
smart_str_appendl(str, "RELEASE", sizeof("RELEASE") - 1);
2020-
} else if (mode & TRANS_COR_NO_RELEASE && !(mode & TRANS_COR_RELEASE)) {
2020+
} else if ((mode & TRANS_COR_NO_RELEASE) && !(mode & TRANS_COR_RELEASE)) {
20212021
if (str->s && ZSTR_LEN(str->s)) {
20222022
smart_str_appendl(str, " ", sizeof(" ") - 1);
20232023
}

ext/mysqlnd/mysqlnd_debug.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,18 @@ PHPAPI MYSQLND_DEBUG * mysqlnd_debug_init(const char * skip_functions[]);
129129
/* EMPTY */ ; /* shut compiler's mouth */ \
130130
} \
131131
do { \
132-
if (((dbg_obj1) && (dbg_obj1)->flags & MYSQLND_DEBUG_PROFILE_CALLS) || \
133-
((dbg_obj2) && (dbg_obj2)->flags & MYSQLND_DEBUG_PROFILE_CALLS)) \
132+
if (((dbg_obj1) && ((dbg_obj1)->flags & MYSQLND_DEBUG_PROFILE_CALLS)) || \
133+
((dbg_obj2) && ((dbg_obj2)->flags & MYSQLND_DEBUG_PROFILE_CALLS))) \
134134
{ \
135135
DBG_PROFILE_START_TIME(); \
136136
} \
137137
} while (0);
138138

139-
#define DBG_LEAVE_EX2(dbg_obj1, dbg_obj2, leave) \
140-
do {\
139+
#define DBG_LEAVE_EX2(dbg_obj1, dbg_obj2, leave) \
140+
do { \
141141
uint64_t this_call_duration = 0; \
142-
if (((dbg_obj1) && (dbg_obj1)->flags & MYSQLND_DEBUG_PROFILE_CALLS) || \
143-
((dbg_obj2) && (dbg_obj2)->flags & MYSQLND_DEBUG_PROFILE_CALLS)) \
142+
if (((dbg_obj1) && ((dbg_obj1)->flags & MYSQLND_DEBUG_PROFILE_CALLS)) || \
143+
((dbg_obj2) && ((dbg_obj2)->flags & MYSQLND_DEBUG_PROFILE_CALLS))) \
144144
{ \
145145
DBG_PROFILE_END_TIME(this_call_duration); \
146146
} \

ext/mysqlnd/mysqlnd_wireprotocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ php_mysqlnd_chg_user_read(MYSQLND_CONN_DATA * conn, void * _packet)
19951995
packet->response_code = uint1korr(p);
19961996
p++;
19971997

1998-
if (packet->header.size == 1 && buf[0] == EODATA_MARKER && packet->server_capabilities & CLIENT_SECURE_CONNECTION) {
1998+
if (packet->header.size == 1 && buf[0] == EODATA_MARKER && (packet->server_capabilities & CLIENT_SECURE_CONNECTION)) {
19991999
/* We don't handle 3.23 authentication */
20002000
packet->server_asked_323_auth = TRUE;
20012001
DBG_RETURN(FAIL);

ext/opcache/Optimizer/sccp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,7 +2258,7 @@ static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var,
22582258
} else if (var->use_chain >= 0
22592259
|| var->phi_use_chain != NULL) {
22602260
if (value
2261-
&& opline->result_type & (IS_VAR|IS_TMP_VAR)
2261+
&& (opline->result_type & (IS_VAR|IS_TMP_VAR))
22622262
&& opline->opcode != ZEND_QM_ASSIGN
22632263
&& opline->opcode != ZEND_ROPE_INIT
22642264
&& opline->opcode != ZEND_ROPE_ADD
@@ -2288,7 +2288,7 @@ static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var,
22882288
if (opline->opcode == ZEND_DO_ICALL) {
22892289
removed_ops = remove_call(ctx, opline, ssa_op);
22902290
} else if (opline->opcode == ZEND_TYPE_CHECK
2291-
&& opline->op1_type & (IS_VAR|IS_TMP_VAR)
2291+
&& (opline->op1_type & (IS_VAR|IS_TMP_VAR))
22922292
&& !value_known(&ctx->values[ssa_op->op1_use])) {
22932293
/* For TYPE_CHECK we may compute the result value without knowing the
22942294
* operand, based on type inference information. Make sure the operand is

ext/pdo/pdo_stmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
761761
return 1;
762762
}
763763

764-
if (flags & PDO_FETCH_GROUP && stmt->fetch.column == -1) {
764+
if ((flags & PDO_FETCH_GROUP) && stmt->fetch.column == -1) {
765765
colno = 1;
766766
} else {
767767
colno = stmt->fetch.column;

ext/phar/stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
318318
return NULL;
319319
}
320320

321-
if (!PHAR_G(cwd_init) && options & STREAM_OPEN_FOR_INCLUDE) {
321+
if (!PHAR_G(cwd_init) && (options & STREAM_OPEN_FOR_INCLUDE)) {
322322
char *entry = idata->internal_file->filename, *cwd;
323323

324324
PHAR_G(cwd_init) = 1;

ext/phar/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, si
13191319
return NULL;
13201320
}
13211321

1322-
if (ssb.sb.st_mode & S_IFDIR && !dir) {
1322+
if ((ssb.sb.st_mode & S_IFDIR) && !dir) {
13231323
efree(test);
13241324
if (error) {
13251325
spprintf(error, 4096, "phar error: path \"%s\" is a directory", path);

ext/reflection/php_reflection.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char
422422
zend_function *mptr;
423423

424424
ZEND_HASH_FOREACH_PTR(&ce->function_table, mptr) {
425-
if (mptr->common.fn_flags & ZEND_ACC_STATIC
425+
if ((mptr->common.fn_flags & ZEND_ACC_STATIC)
426426
&& ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce))
427427
{
428428
count_static_funcs++;
@@ -436,7 +436,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char
436436
zend_function *mptr;
437437

438438
ZEND_HASH_FOREACH_PTR(&ce->function_table, mptr) {
439-
if (mptr->common.fn_flags & ZEND_ACC_STATIC
439+
if ((mptr->common.fn_flags & ZEND_ACC_STATIC)
440440
&& ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce))
441441
{
442442
smart_str_append_printf(str, "\n");
@@ -3499,7 +3499,7 @@ ZEND_METHOD(ReflectionMethod, isConstructor)
34993499
/* we need to check if the ctor is the ctor of the class level we we
35003500
* looking at since we might be looking at an inherited old style ctor
35013501
* defined in base class. */
3502-
RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_CTOR && intern->ce->constructor && intern->ce->constructor->common.scope == mptr->common.scope);
3502+
RETURN_BOOL((mptr->common.fn_flags & ZEND_ACC_CTOR) && intern->ce->constructor && intern->ce->constructor->common.scope == mptr->common.scope);
35033503
}
35043504
/* }}} */
35053505

ext/spl/spl_dllist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ PHP_METHOD(SplDoublyLinkedList, setIteratorMode)
701701

702702
intern = Z_SPLDLLIST_P(ZEND_THIS);
703703

704-
if (intern->flags & SPL_DLLIST_IT_FIX
704+
if ((intern->flags & SPL_DLLIST_IT_FIX)
705705
&& (intern->flags & SPL_DLLIST_IT_LIFO) != (value & SPL_DLLIST_IT_LIFO)) {
706706
zend_throw_exception(spl_ce_RuntimeException, "Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen", 0);
707707
RETURN_THROWS();

ext/spl/spl_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void spl_register_property( zend_class_entry * class_entry, char *prop_name, int
7575
/* {{{ spl_add_class_name */
7676
void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_flags)
7777
{
78-
if (!allow || (allow > 0 && pce->ce_flags & ce_flags) || (allow < 0 && !(pce->ce_flags & ce_flags))) {
78+
if (!allow || (allow > 0 && (pce->ce_flags & ce_flags)) || (allow < 0 && !(pce->ce_flags & ce_flags))) {
7979
zval *tmp;
8080

8181
if ((tmp = zend_hash_find(Z_ARRVAL_P(list), pce->name)) == NULL) {

ext/standard/array.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4748,7 +4748,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
47484748
if (behavior == INTERSECT_NORMAL && data_compare_type == INTERSECT_COMP_DATA_USER) {
47494749
BG(user_compare_fci) = *fci_data;
47504750
BG(user_compare_fci_cache) = *fci_data_cache;
4751-
} else if (behavior & INTERSECT_ASSOC && key_compare_type == INTERSECT_COMP_KEY_USER) {
4751+
} else if ((behavior & INTERSECT_ASSOC) && key_compare_type == INTERSECT_COMP_KEY_USER) {
47524752
BG(user_compare_fci) = *fci_key;
47534753
BG(user_compare_fci_cache) = *fci_key_cache;
47544754
}
@@ -5155,7 +5155,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
51555155
if (behavior == DIFF_NORMAL && data_compare_type == DIFF_COMP_DATA_USER) {
51565156
BG(user_compare_fci) = *fci_data;
51575157
BG(user_compare_fci_cache) = *fci_data_cache;
5158-
} else if (behavior & DIFF_ASSOC && key_compare_type == DIFF_COMP_KEY_USER) {
5158+
} else if ((behavior & DIFF_ASSOC) && key_compare_type == DIFF_COMP_KEY_USER) {
51595159
BG(user_compare_fci) = *fci_key;
51605160
BG(user_compare_fci_cache) = *fci_key_cache;
51615161
}

ext/standard/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ PHP_FUNCTION(file_put_contents)
621621
RETURN_FALSE;
622622
}
623623

624-
if (flags & LOCK_EX && (!php_stream_supports_lock(stream) || php_stream_lock(stream, LOCK_EX))) {
624+
if ((flags & LOCK_EX) && (!php_stream_supports_lock(stream) || php_stream_lock(stream, LOCK_EX))) {
625625
php_stream_close(stream);
626626
php_error_docref(NULL, E_WARNING, "Exclusive locks are not supported for this stream");
627627
RETURN_FALSE;

ext/standard/flock_compat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PHPAPI int php_flock(int fd, int operation)
5858

5959
ret = fcntl(fd, operation & LOCK_NB ? F_SETLK : F_SETLKW, &flck);
6060

61-
if (operation & LOCK_NB && ret == -1 &&
61+
if ((operation & LOCK_NB) && ret == -1 &&
6262
(errno == EACCES || errno == EAGAIN))
6363
errno = EWOULDBLOCK;
6464

main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ static ZEND_COLD void php_error_cb(int orig_type, const char *error_filename, co
12651265
}
12661266

12671267
/* display/log the error if necessary */
1268-
if (display && (EG(error_reporting) & type || (type & E_CORE))
1268+
if (display && ((EG(error_reporting) & type) || (type & E_CORE))
12691269
&& (PG(log_errors) || PG(display_errors) || (!module_initialized))) {
12701270
char *error_type_str;
12711271
int syslog_type_int = LOG_NOTICE;

main/streams/memory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ static int php_stream_memory_set_option(php_stream *stream, int option, int valu
254254
ms->fsize = newsize;
255255
return PHP_STREAM_OPTION_RETURN_OK;
256256
}
257-
default:
258-
return PHP_STREAM_OPTION_RETURN_NOTIMPL;
259257
}
258+
259+
return PHP_STREAM_OPTION_RETURN_NOTIMPL;
260260
}
261261
/* }}} */
262262

main/streams/php_stream_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ END_EXTERN_C()
100100
(context)->notifier->mask |= PHP_STREAM_NOTIFIER_PROGRESS; \
101101
php_stream_notify_progress((context), (sofar), (bmax)); } } while (0)
102102

103-
#define php_stream_notify_progress_increment(context, dsofar, dmax) do { if ((context) && (context)->notifier && (context)->notifier->mask & PHP_STREAM_NOTIFIER_PROGRESS) { \
103+
#define php_stream_notify_progress_increment(context, dsofar, dmax) do { if ((context) && (context)->notifier && ((context)->notifier->mask & PHP_STREAM_NOTIFIER_PROGRESS)) { \
104104
(context)->notifier->progress += (dsofar); \
105105
(context)->notifier->progress_max += (dmax); \
106106
php_stream_notify_progress((context), (context)->notifier->progress, (context)->notifier->progress_max); } } while (0)

main/streams/plain_wrapper.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,7 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
903903
#endif
904904
}
905905
}
906+
return PHP_STREAM_OPTION_RETURN_NOTIMPL;
906907

907908
#ifdef PHP_WIN32
908909
case PHP_STREAM_OPTION_PIPE_BLOCKING:

main/streams/streams.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ PHPAPI void php_stream_wrapper_log_error(const php_stream_wrapper *wrapper, int
245245
vspprintf(&buffer, 0, fmt, args);
246246
va_end(args);
247247

248-
if (options & REPORT_ERRORS || wrapper == NULL) {
248+
if ((options & REPORT_ERRORS) || wrapper == NULL) {
249249
php_error_docref(NULL, E_WARNING, "%s", buffer);
250250
efree(buffer);
251251
} else {
@@ -703,7 +703,7 @@ PHPAPI ssize_t _php_stream_read(php_stream *stream, char *buf, size_t size)
703703
break;
704704
}
705705

706-
if (!stream->readfilters.head && (stream->flags & PHP_STREAM_FLAG_NO_BUFFER || stream->chunk_size == 1)) {
706+
if (!stream->readfilters.head && ((stream->flags & PHP_STREAM_FLAG_NO_BUFFER) || stream->chunk_size == 1)) {
707707
toread = stream->ops->read(stream, buf, size);
708708
if (toread < 0) {
709709
/* Report an error if the read failed and we did not read any data
@@ -2088,7 +2088,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
20882088
path_to_open = path;
20892089

20902090
wrapper = php_stream_locate_url_wrapper(path, &path_to_open, options);
2091-
if (options & STREAM_USE_URL && (!wrapper || !wrapper->is_url)) {
2091+
if ((options & STREAM_USE_URL) && (!wrapper || !wrapper->is_url)) {
20922092
php_error_docref(NULL, E_WARNING, "This function may only be used against URLs");
20932093
if (resolved_path) {
20942094
zend_string_release_ex(resolved_path, 0);

main/streams/xp_socket.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,11 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
449449
#endif
450450

451451
default:
452-
return PHP_STREAM_OPTION_RETURN_NOTIMPL;
452+
break;
453453
}
454-
455-
default:
456-
return PHP_STREAM_OPTION_RETURN_NOTIMPL;
457454
}
455+
456+
return PHP_STREAM_OPTION_RETURN_NOTIMPL;
458457
}
459458

460459
static int php_sockop_cast(php_stream *stream, int castas, void **ret)

0 commit comments

Comments
 (0)