From 3be5d07586151dc6dec2edcf603ad9bfc058f053 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 29 Jun 2024 16:42:37 +0200 Subject: [PATCH 1/2] Trim trailing whitespace --- Zend/tests/gh7771_2_definition.inc | 2 +- Zend/zend_extensions.c | 6 +++--- ext/calendar/easter.c | 4 ++-- ext/dom/parentnode.c | 2 +- ext/dom/php_dom.c | 4 ++-- ext/dom/php_dom.stub.php | 4 ++-- ext/dom/xml_serializer.c | 4 ++-- ext/ftp/tests/server.inc | 2 +- ext/gd/libgd/gd_webp.c | 2 +- ext/intl/formatter/formatter_main.c | 2 +- ext/intl/grapheme/grapheme_util.c | 2 +- ext/json/json.c | 2 +- ext/mysqli/mysqli_api.c | 4 ++-- ext/mysqli/mysqli_exception.c | 2 +- ext/mysqli/tests/README.md | 4 ++-- ext/opcache/jit/zend_jit_ir.c | 4 ++-- ext/pcntl/pcntl.c | 2 +- sapi/embed/README.md | 2 +- tests/basic/errorlog_permission.phpt | 4 ++-- 19 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Zend/tests/gh7771_2_definition.inc b/Zend/tests/gh7771_2_definition.inc index 0162a9c8bf1ed..2dcdd30c6ad58 100644 --- a/Zend/tests/gh7771_2_definition.inc +++ b/Zend/tests/gh7771_2_definition.inc @@ -1,7 +1,7 @@ type == ZEND_USER_FUNCTION * && !(fbc->op_array.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) * ) { * // Use ZEND_OP_ARRAY_EXTENSION somehow * } - */ + */ ZEND_API int zend_get_op_array_extension_handle(const char *module_name) { int handle = zend_op_array_extension_handles++; diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c index 579e8af72eac2..d6ff54fa0f618 100644 --- a/ext/calendar/easter.c +++ b/ext/calendar/easter.c @@ -54,7 +54,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, bool gm) } #ifdef ZEND_ENABLE_ZVAL_LONG64 - /* Compiling for 64bit, allow years between 1970 and 2.000.000.000 */ + /* Compiling for 64bit, allow years between 1970 and 2.000.000.000 */ if (gm && year < 1970) { /* timestamps only start after 1970 */ zend_argument_value_error(1, "must be a year after 1970 (inclusive)"); @@ -67,7 +67,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, bool gm) RETURN_THROWS(); } #else - /* Compiling for 32bit, allow years between 1970 and 2037 */ + /* Compiling for 32bit, allow years between 1970 and 2037 */ if (gm && (year < 1970 || year > 2037)) { zend_argument_value_error(1, "must be between 1970 and 2037 (inclusive)"); RETURN_THROWS(); diff --git a/ext/dom/parentnode.c b/ext/dom/parentnode.c index b0fa54bf7dcf3..13728bed4deb1 100644 --- a/ext/dom/parentnode.c +++ b/ext/dom/parentnode.c @@ -130,7 +130,7 @@ static xmlDocPtr dom_doc_from_context_node(xmlNodePtr contextNode) } } -/* Citing from the docs (https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlAddChild): +/* Citing from the docs (https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlAddChild): * "Add a new node to @parent, at the end of the child (or property) list merging adjacent TEXT nodes (in which case @cur is freed)". * So we must use a custom way of adding that does not merge. */ static void dom_add_child_without_merging(xmlNodePtr parent, xmlNodePtr child) diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 83dc12c6428d6..7ebafd9207281 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -525,7 +525,7 @@ static void dom_import_simplexml_common(INTERNAL_FUNCTION_PARAMETERS, php_libxml zend_argument_type_error(1, "must not be already imported as a DOMNode"); } else { zend_argument_type_error(1, "must not be already imported as a Dom\\Node"); - } + } RETURN_THROWS(); } @@ -1882,7 +1882,7 @@ void php_dom_normalize_modern(xmlNodePtr this) /* 3. Let data be the concatenation of the data of node’s contiguous exclusive Text nodes (excluding itself), in tree order. * 4. Replace data with node node, offset length, count 0, and data data. - * 7. Remove node’s contiguous exclusive Text nodes (excluding itself), in tree order. + * 7. Remove node’s contiguous exclusive Text nodes (excluding itself), in tree order. * => In other words: Concat every contiguous text node into node and delete the merged nodes. */ dom_merge_adjacent_exclusive_text_nodes(node); diff --git a/ext/dom/php_dom.stub.php b/ext/dom/php_dom.stub.php index 1f6f2bb8bc876..76be5f62171b8 100644 --- a/ext/dom/php_dom.stub.php +++ b/ext/dom/php_dom.stub.php @@ -408,7 +408,7 @@ public function getRootNode(?array $options = null): DOMNode {} public function compareDocumentPosition(DOMNode $other): int {} public function __sleep(): array {} - + public function __wakeup(): void {} } @@ -446,7 +446,7 @@ class DOMNameSpaceNode /** @implementation-alias DOMNode::__sleep */ public function __sleep(): array {} - + /** @implementation-alias DOMNode::__wakeup */ public function __wakeup(): void {} } diff --git a/ext/dom/xml_serializer.c b/ext/dom/xml_serializer.c index 262ed4a839ae7..7cbe1011558cc 100644 --- a/ext/dom/xml_serializer.c +++ b/ext/dom/xml_serializer.c @@ -508,7 +508,7 @@ static int dom_xml_common_text_serialization(xmlOutputBufferPtr out, const char TRY(xmlOutputBufferWriteLit(out, """)); break; } - + /* The following three are added to address https://github.com/w3c/DOM-Parsing/issues/59 */ case '\t': { @@ -1050,7 +1050,7 @@ static int dom_xml_serializing_a_document_fragment_node( int indent ) { - /* 1. Let markup the empty string. + /* 1. Let markup the empty string. * => We use the output buffer instead. */ /* 2. For each child child of node, in tree order, run the XML serialization algorithm on the child ... */ diff --git a/ext/ftp/tests/server.inc b/ext/ftp/tests/server.inc index 04a87f6f867db..c2c8449a0686e 100644 --- a/ext/ftp/tests/server.inc +++ b/ext/ftp/tests/server.inc @@ -470,7 +470,7 @@ if ($pid) { fputs($fs, "file1\r\nfile1\r\nfile\nb0rk\r\n"); fputs($s, "226 Closing data Connection.\r\n"); fclose($fs); - + fputs($s, "226 Transfer complete\r\n"); }elseif (preg_match('/^LIST no_exists\//', $buf, $matches)) { fputs($s, "425 Error establishing connection\r\n"); diff --git a/ext/gd/libgd/gd_webp.c b/ext/gd/libgd/gd_webp.c index ea987858f643c..f9ab68d70a9b0 100644 --- a/ext/gd/libgd/gd_webp.c +++ b/ext/gd/libgd/gd_webp.c @@ -151,7 +151,7 @@ void gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality) *(p++) = a; } } - + if (quality >= gdWebpLossless) { out_size = WebPEncodeLosslessRGBA(argb, gdImageSX(im), gdImageSY(im), gdImageSX(im) * 4, &out); } else { diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index 2719b9aa90699..6f8fb98d21434 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -68,7 +68,7 @@ static int numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_error_handling *error_ zend_argument_value_error(1, "\"%s\" is invalid", locale); return FAILURE; } - + /* Create an ICU number formatter. */ FORMATTER_OBJECT(nfo) = unum_open(style, spattern, spattern_len, locale, NULL, &INTL_DATA_ERROR_CODE(nfo)); diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c index 408b31161d8d9..501b9dfb221d0 100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.c @@ -166,7 +166,7 @@ int32_t grapheme_strpos_utf16(char *haystack, size_t haystack_len, char *needle, if(char_pos < offset_pos) { /* last one is beyond our start offset */ char_pos = USEARCH_DONE; - } + } } else { /* searching backwards is broken, so we search forwards, albeit it's less efficient */ int32_t prev_pos = USEARCH_DONE; diff --git a/ext/json/json.c b/ext/json/json.c index 6e1c884fbab2a..9f91d39594ec7 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -335,7 +335,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(); diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 757ed79dbcac9..a10c34335719b 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -520,12 +520,12 @@ PHP_FUNCTION(mysqli_execute_query) if (FAIL == mysql_stmt_prepare(stmt->stmt, query, query_len)) { MYSQLI_REPORT_STMT_ERROR(stmt->stmt); - + close_stmt_and_copy_errors(stmt, mysql); RETURN_FALSE; } - /* The bit below, which is copied from mysqli_prepare, is needed for bad index exceptions */ + /* The bit below, which is copied from mysqli_prepare, is needed for bad index exceptions */ /* don't initialize stmt->query with NULL, we ecalloc()-ed the memory */ /* Get performance boost if reporting is switched off */ if (query_len && (MyG(report_mode) & MYSQLI_REPORT_INDEX)) { diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c index 0c4a8b31dc23c..7ebc29b60ba63 100644 --- a/ext/mysqli/mysqli_exception.c +++ b/ext/mysqli/mysqli_exception.c @@ -72,6 +72,6 @@ PHP_METHOD(mysqli_sql_exception, getSqlState) prop = zend_read_property(mysqli_exception_class_entry, Z_OBJ_P(ZEND_THIS), "sqlstate", sizeof("sqlstate")-1, 1, &rv); ZVAL_DEREF(prop); zend_string *str = zval_get_string(prop); - + RETURN_STR(str); } diff --git a/ext/mysqli/tests/README.md b/ext/mysqli/tests/README.md index 4fc3767e49706..317ad75613417 100644 --- a/ext/mysqli/tests/README.md +++ b/ext/mysqli/tests/README.md @@ -1,6 +1,6 @@ # The mysqli extension tests -To run the tests, a test database must be created in the MySQL command-line: +To run the tests, a test database must be created in the MySQL command-line: ```sql CREATE DATABASE test; ``` @@ -36,4 +36,4 @@ MYSQL_TEST_SOCKET ## MySQL User Permissions -The MySQL user used to run the tests must have full permissions on the test database. \ No newline at end of file +The MySQL user used to run the tests must have full permissions on the test database. diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index a7722f6ae5b8c..0dfc4738c0191 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -4570,7 +4570,7 @@ static struct jit_observer_fcall_is_unobserved_data jit_observer_fcall_is_unobse ir_ref tmp = ir_LOAD_U8(ir_ADD_OFFSET(func_ref, offsetof(zend_function, type))); ir_ref if_internal_func = ir_IF(ir_AND_U8(tmp, ir_CONST_U8(ZEND_INTERNAL_FUNCTION))); ir_IF_TRUE(if_internal_func); - + ir_ref observer_handler_internal = ir_ADD_OFFSET(run_time_cache, zend_observer_fcall_internal_function_extension * sizeof(void *)); ir_ref if_internal_func_end = ir_END(); @@ -17103,7 +17103,7 @@ static ir_ref jit_frameless_observer(zend_jit_ctx *jit, const zend_op *opline) { // Not need for runtime cache or generator checks here, we just need if_unobserved ir_ref if_unobserved = jit_observer_fcall_is_unobserved_start(jit, fbc, &observer_handler, IR_UNUSED, IR_UNUSED).if_unobserved; - // Call zend_frameless_observed_call for the main logic. + // Call zend_frameless_observed_call for the main logic. ir_CALL_1(IR_VOID, ir_CONST_ADDR((size_t)zend_frameless_observed_call), jit_FP(jit)); ir_ref skip = ir_END(); diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 31e15527bd566..b214d336be185 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -1685,7 +1685,7 @@ PHP_FUNCTION(pcntl_setcpuaffinity) zend_argument_value_error(2, "cpu id must be between 0 and " ZEND_ULONG_FMT " (" ZEND_LONG_FMT ")", maxcpus, cpu); RETURN_THROWS(); } - + if (!PCNTL_CPU_ISSET(cpu, mask)) { PCNTL_CPU_SET(cpu, mask); } diff --git a/sapi/embed/README.md b/sapi/embed/README.md index c90ff354ab7d9..53ced49488778 100644 --- a/sapi/embed/README.md +++ b/sapi/embed/README.md @@ -49,7 +49,7 @@ $ gcc \ If all goes to plan you should be able to run the program. ```bash -$ ./a.out +$ ./a.out Number of functions loaded: 1046 ``` diff --git a/tests/basic/errorlog_permission.phpt b/tests/basic/errorlog_permission.phpt index e49c19317621e..68a37a6830ae5 100644 --- a/tests/basic/errorlog_permission.phpt +++ b/tests/basic/errorlog_permission.phpt @@ -1,7 +1,7 @@ --TEST-- Check permissions for created errorlog file --SKIPIF-- - Date: Sat, 29 Jun 2024 17:34:34 +0200 Subject: [PATCH 2/2] Regenerate the stub headers --- ext/dom/php_dom_arginfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/dom/php_dom_arginfo.h b/ext/dom/php_dom_arginfo.h index dae80f6fe3cfd..4d80d238a26ff 100644 --- a/ext/dom/php_dom_arginfo.h +++ b/ext/dom/php_dom_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: eda699f0d524fae5ae76a3a395438a16989c2af8 */ + * Stub hash: fd650b1e64c4ed4ce66b0dad9c681a51cb8ff1ae */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 0) ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0)