mirror of
https://github.com/php/php-src.git
synced 2024-11-23 01:44:06 +08:00
Simplify (bitset & flag) == flag
conditions
Closes GH-16558
This commit is contained in:
parent
e00079daa1
commit
e122152373
@ -505,8 +505,8 @@ ZEND_API zend_result ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *cal
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define ZEND_CLASS_HAS_TYPE_HINTS(ce) ((ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) == ZEND_ACC_HAS_TYPE_HINTS)
|
||||
#define ZEND_CLASS_HAS_READONLY_PROPS(ce) ((ce->ce_flags & ZEND_ACC_HAS_READONLY_PROPS) == ZEND_ACC_HAS_READONLY_PROPS)
|
||||
#define ZEND_CLASS_HAS_TYPE_HINTS(ce) ((bool)(ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS))
|
||||
#define ZEND_CLASS_HAS_READONLY_PROPS(ce) ((bool)(ce->ce_flags & ZEND_ACC_HAS_READONLY_PROPS))
|
||||
|
||||
|
||||
ZEND_API bool zend_verify_class_constant_type(zend_class_constant *c, const zend_string *name, zval *constant);
|
||||
|
@ -2281,7 +2281,7 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
|
||||
* of where it is coming from there is no conflict and we do not need to add it again */
|
||||
if (existing_fn->op_array.opcodes == fn->op_array.opcodes &&
|
||||
(existing_fn->common.fn_flags & ZEND_ACC_PPP_MASK) == (fn->common.fn_flags & ZEND_ACC_PPP_MASK) &&
|
||||
(existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
(existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2347,7 +2347,7 @@ static void zend_add_trait_method(zend_class_entry *ce, zend_string *name, zend_
|
||||
|
||||
static void zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce) /* {{{ */
|
||||
{
|
||||
if ((fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
|
||||
if (fn->common.scope->ce_flags & ZEND_ACC_TRAIT) {
|
||||
|
||||
fn->common.scope = ce;
|
||||
|
||||
|
@ -1600,11 +1600,11 @@ PHP_FUNCTION(pathinfo)
|
||||
Z_PARAM_LONG(opt)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
have_basename = ((opt & PHP_PATHINFO_BASENAME) == PHP_PATHINFO_BASENAME);
|
||||
have_basename = (opt & PHP_PATHINFO_BASENAME);
|
||||
|
||||
array_init(&tmp);
|
||||
|
||||
if ((opt & PHP_PATHINFO_DIRNAME) == PHP_PATHINFO_DIRNAME) {
|
||||
if (opt & PHP_PATHINFO_DIRNAME) {
|
||||
dirname = estrndup(path, path_len);
|
||||
php_dirname(dirname, path_len);
|
||||
if (*dirname) {
|
||||
@ -1618,7 +1618,7 @@ PHP_FUNCTION(pathinfo)
|
||||
add_assoc_str(&tmp, "basename", zend_string_copy(ret));
|
||||
}
|
||||
|
||||
if ((opt & PHP_PATHINFO_EXTENSION) == PHP_PATHINFO_EXTENSION) {
|
||||
if (opt & PHP_PATHINFO_EXTENSION) {
|
||||
const char *p;
|
||||
ptrdiff_t idx;
|
||||
|
||||
@ -1634,7 +1634,7 @@ PHP_FUNCTION(pathinfo)
|
||||
}
|
||||
}
|
||||
|
||||
if ((opt & PHP_PATHINFO_FILENAME) == PHP_PATHINFO_FILENAME) {
|
||||
if (opt & PHP_PATHINFO_FILENAME) {
|
||||
const char *p;
|
||||
ptrdiff_t idx;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user