From 91227c5ac5d0040a74dfe3e3c25549fb642e4ab9 Mon Sep 17 00:00:00 2001 From: Marcos Marcolin Date: Fri, 16 Dec 2022 18:06:06 -0300 Subject: [PATCH 1/3] chore: unnecessary parentheses. --- ext/json/json.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/json/json.c b/ext/json/json.c index 2de78e3dabc2e..f37ff5552226f 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -303,8 +303,7 @@ PHP_FUNCTION(json_validate) Z_PARAM_LONG(options) ZEND_PARSE_PARAMETERS_END(); - - if ((options != 0) && (options != PHP_JSON_INVALID_UTF8_IGNORE)) { + if (options != 0 && options != PHP_JSON_INVALID_UTF8_IGNORE) { zend_argument_value_error(3, "must be a valid flag (allowed flags: JSON_INVALID_UTF8_IGNORE)"); RETURN_THROWS(); } @@ -315,7 +314,7 @@ PHP_FUNCTION(json_validate) } JSON_G(error_code) = PHP_JSON_ERROR_NONE; - + if (depth <= 0) { zend_argument_value_error(2, "must be greater than 0"); RETURN_THROWS(); From b57245ebcbc9fc3adbf1bcbf6b186c34eb5aee4c Mon Sep 17 00:00:00 2001 From: Marcos Marcolin Date: Thu, 5 Jan 2023 13:25:43 -0300 Subject: [PATCH 2/3] chore: remove semicolon left over. --- ext/ffi/ffi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index c4a4d91d24348..749c64dc9c692 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -1107,7 +1107,7 @@ static zval *zend_ffi_cdata_get(zend_object *obj, zend_string *member, int read_ if (UNEXPECTED(!zend_string_equals_literal(member, "cdata"))) { zend_throw_error(zend_ffi_exception_ce, "Only 'cdata' property may be read"); - return &EG(uninitialized_zval);; + return &EG(uninitialized_zval); } zend_ffi_cdata_to_zval(cdata, cdata->ptr, type, BP_VAR_R, rv, 0, 0, 0); @@ -1123,13 +1123,13 @@ static zval *zend_ffi_cdata_set(zend_object *obj, zend_string *member, zval *val #if 0 if (UNEXPECTED(!cdata->ptr)) { zend_throw_error(zend_ffi_exception_ce, "NULL pointer dereference"); - return &EG(uninitialized_zval);; + return &EG(uninitialized_zval); } #endif if (UNEXPECTED(!zend_string_equals_literal(member, "cdata"))) { zend_throw_error(zend_ffi_exception_ce, "Only 'cdata' property may be set"); - return &EG(uninitialized_zval);; + return &EG(uninitialized_zval); } zend_ffi_zval_to_cdata(cdata->ptr, type, value); @@ -2648,7 +2648,7 @@ static zend_result zend_ffi_pass_arg(zval *arg, zend_ffi_type *type, ffi_type ** zend_ffi_cdata *cdata = (zend_ffi_cdata*)Z_OBJ_P(arg); if (zend_ffi_is_compatible_type(type, ZEND_FFI_TYPE(cdata->type))) { - *pass_type = zend_ffi_make_fake_struct_type(type);; + *pass_type = zend_ffi_make_fake_struct_type(type); arg_values[n] = cdata->ptr; break; } @@ -5770,7 +5770,7 @@ void zend_ffi_resolve_typedef(const char *name, size_t name_len, zend_ffi_dcl *d if (FFI_G(symbols)) { sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len); if (sym && sym->kind == ZEND_FFI_SYM_TYPE) { - dcl->type = ZEND_FFI_TYPE(sym->type);; + dcl->type = ZEND_FFI_TYPE(sym->type); if (sym->is_const) { dcl->attr |= ZEND_FFI_ATTR_CONST; } From b81a3e8f8b45c1579d13a485258129c2de1b6998 Mon Sep 17 00:00:00 2001 From: Marcos Marcolin Date: Thu, 5 Jan 2023 13:29:45 -0300 Subject: [PATCH 3/3] Revert "chore: unnecessary parentheses." This reverts commit 91227c5ac5d0040a74dfe3e3c25549fb642e4ab9. --- ext/json/json.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/json/json.c b/ext/json/json.c index f37ff5552226f..2de78e3dabc2e 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -303,7 +303,8 @@ PHP_FUNCTION(json_validate) Z_PARAM_LONG(options) ZEND_PARSE_PARAMETERS_END(); - if (options != 0 && options != PHP_JSON_INVALID_UTF8_IGNORE) { + + if ((options != 0) && (options != PHP_JSON_INVALID_UTF8_IGNORE)) { zend_argument_value_error(3, "must be a valid flag (allowed flags: JSON_INVALID_UTF8_IGNORE)"); RETURN_THROWS(); } @@ -314,7 +315,7 @@ PHP_FUNCTION(json_validate) } JSON_G(error_code) = PHP_JSON_ERROR_NONE; - + if (depth <= 0) { zend_argument_value_error(2, "must be greater than 0"); RETURN_THROWS();