Skip to content

Commit

Permalink
Merge branch 'PHP-8.3'
Browse files Browse the repository at this point in the history
* PHP-8.3:
  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
  • Loading branch information
Girgias committed May 21, 2024
2 parents 896517e + b2c0db1 commit 07a4851
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ext/gd/libgd/gd_topal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1498,23 +1498,23 @@ static int gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colors
colorsWanted = maxColors;
}
if (!cimP) {
nim->pixels = gdCalloc (sizeof (unsigned char *), oim->sy);
nim->pixels = gdCalloc (oim->sy, sizeof (unsigned char *));
if (!nim->pixels)
{
/* No can do */
goto outOfMemory;
}
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])
{
goto outOfMemory;
}
}
}

cquantize = (my_cquantize_ptr) gdCalloc (sizeof (my_cquantizer), 1);
cquantize = (my_cquantize_ptr) gdCalloc (1, sizeof (my_cquantizer));
if (!cquantize)
{
/* No can do */
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_mysql/mysql_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static int pdo_mysql_stmt_fetch(pdo_stmt_t *stmt, enum pdo_fetch_orientation ori
}

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++) {
zval_ptr_dtor_nogc(&S->current_row[i]);
Expand Down
2 changes: 1 addition & 1 deletion ext/readline/readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ char **php_readline_completion_cb(const char *text, int start, int end)
matches = rl_completion_matches(text,_readline_command_generator);
} else {
/* libedit will read matches[2] */
matches = calloc(sizeof(char *), 3);
matches = calloc(3, sizeof(char *));
if (!matches) {
return NULL;
}
Expand Down

0 comments on commit 07a4851

Please sign in to comment.