Merge branch 'PHP-8.2' into PHP-8.3

* PHP-8.2:
  ext/readline: Fix [-Wcalloc-transposed-args] compiler warning
  ext/pdo_mysql: Fix [-Wcalloc-transposed-args] compiler warning
  ext/gd: Fix [-Wcalloc-transposed-args] compiler warning
  ext/ffi: Fix [-Wenum-int-mismatch] compiler warning
  ext/bcmath: Fix [-Wenum-int-mismatch] compiler warning
This commit is contained in:
Gina Peter Banyard 2024-05-21 12:21:46 +01:00
commit b2c0db1f89
No known key found for this signature in database
GPG key ID: 3306078E3194AEBD
3 changed files with 5 additions and 5 deletions

View file

@ -1498,7 +1498,7 @@ static int gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colors
colorsWanted = maxColors; colorsWanted = maxColors;
} }
if (!cimP) { if (!cimP) {
nim->pixels = gdCalloc (sizeof (unsigned char *), oim->sy); nim->pixels = gdCalloc (oim->sy, sizeof (unsigned char *));
if (!nim->pixels) if (!nim->pixels)
{ {
/* No can do */ /* No can do */
@ -1506,7 +1506,7 @@ static int gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colors
} }
for (i = 0; (i < nim->sy); i++) for (i = 0; (i < nim->sy); i++)
{ {
nim->pixels[i] = gdCalloc (sizeof (unsigned char *), oim->sx); nim->pixels[i] = gdCalloc (oim->sx, sizeof (unsigned char *));
if (!nim->pixels[i]) if (!nim->pixels[i])
{ {
goto outOfMemory; goto outOfMemory;
@ -1514,7 +1514,7 @@ static int gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colors
} }
} }
cquantize = (my_cquantize_ptr) gdCalloc (sizeof (my_cquantizer), 1); cquantize = (my_cquantize_ptr) gdCalloc (1, sizeof (my_cquantizer));
if (!cquantize) if (!cquantize)
{ {
/* No can do */ /* No can do */

View file

@ -581,7 +581,7 @@ static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori
} }
if (!S->current_row) { if (!S->current_row) {
S->current_row = ecalloc(sizeof(zval), stmt->column_count); S->current_row = ecalloc(stmt->column_count, sizeof(zval));
} }
for (unsigned i = 0; i < stmt->column_count; i++) { for (unsigned i = 0; i < stmt->column_count; i++) {
zval_ptr_dtor_nogc(&S->current_row[i]); zval_ptr_dtor_nogc(&S->current_row[i]);

View file

@ -456,7 +456,7 @@ char **php_readline_completion_cb(const char *text, int start, int end)
matches = rl_completion_matches(text,_readline_command_generator); matches = rl_completion_matches(text,_readline_command_generator);
} else { } else {
/* libedit will read matches[2] */ /* libedit will read matches[2] */
matches = calloc(sizeof(char *), 3); matches = calloc(3, sizeof(char *));
if (!matches) { if (!matches) {
return NULL; return NULL;
} }