Skip to content

Commit b9a2533

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fix gcc-14 Wcalloc-transposed-args warnings
2 parents 0dc5998 + e34c86c commit b9a2533

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

ext/ffi/ffi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,7 @@ static zend_result zend_ffi_cdata_get_closure(zend_object *obj, zend_class_entry
21592159
if (EXPECTED(EG(trampoline).common.function_name == NULL)) {
21602160
func = &EG(trampoline);
21612161
} else {
2162-
func = ecalloc(sizeof(zend_internal_function), 1);
2162+
func = ecalloc(1, sizeof(zend_internal_function));
21632163
}
21642164
func->type = ZEND_INTERNAL_FUNCTION;
21652165
func->common.arg_flags[0] = 0;
@@ -2912,7 +2912,7 @@ static zend_function *zend_ffi_get_func(zend_object **obj, zend_string *name, co
29122912
if (EXPECTED(EG(trampoline).common.function_name == NULL)) {
29132913
func = &EG(trampoline);
29142914
} else {
2915-
func = ecalloc(sizeof(zend_internal_function), 1);
2915+
func = ecalloc(1, sizeof(zend_internal_function));
29162916
}
29172917
func->common.type = ZEND_INTERNAL_FUNCTION;
29182918
func->common.arg_flags[0] = 0;

ext/opcache/zend_accelerator_blacklist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void zend_accel_blacklist_init(zend_blacklist *blacklist)
5858
zend_accel_blacklist_shutdown(blacklist);
5959
}
6060

61-
blacklist->entries = (zend_blacklist_entry *) calloc(sizeof(zend_blacklist_entry), blacklist->size);
61+
blacklist->entries = (zend_blacklist_entry *) calloc(blacklist->size, sizeof(zend_blacklist_entry));
6262
if (!blacklist->entries) {
6363
zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Blacklist initialization: no memory\n");
6464
return;

ext/standard/proc_open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ static zend_string* get_command_from_array(HashTable *array, char ***argv, int n
690690
static descriptorspec_item* alloc_descriptor_array(HashTable *descriptorspec)
691691
{
692692
uint32_t ndescriptors = zend_hash_num_elements(descriptorspec);
693-
return ecalloc(sizeof(descriptorspec_item), ndescriptors);
693+
return ecalloc(ndescriptors, sizeof(descriptorspec_item));
694694
}
695695

696696
static zend_string* get_string_parameter(zval *array, int index, char *param_name)

main/streams/glob_wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const cha
226226
}
227227
}
228228

229-
pglob = ecalloc(sizeof(*pglob), 1);
229+
pglob = ecalloc(1, sizeof(*pglob));
230230

231231
if (0 != (ret = glob(path, pglob->flags & GLOB_FLAGMASK, NULL, &pglob->glob))) {
232232
#ifdef GLOB_NOMATCH

0 commit comments

Comments
 (0)