Fix transposed calloc() arguments

gcc-14 complains:
../src/legacy/i810/i810_dri.c:281:48: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
...

Fix them all up via cocci:
@@
expression E1, E2;
type T;
@@
(
- calloc(sizeof(T), E2)
+ calloc(E2, sizeof(T))
|
- calloc(sizeof(E1), E2)
+ calloc(E2, sizeof(E1))
)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
Ville Syrjälä
2025-02-10 19:13:21 +02:00
parent e6a4c4740c
commit fc07603ee0
18 changed files with 33 additions and 23 deletions

View File

@@ -154,7 +154,8 @@ static void area_tests(struct test *t, int reps, int sets, enum target target)
{
struct test_target tt;
XImage image;
uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height);
uint32_t *cells = calloc(t->out.width * t->out.height,
sizeof(uint32_t));
int r, s, x, y;
printf("Testing area sets (%s): ", test_target_name(target));

View File

@@ -124,7 +124,8 @@ static void area_tests(struct test *t, int reps, int sets, enum target target)
{
struct test_target tt;
XImage image;
uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height);
uint32_t *cells = calloc(t->out.width * t->out.height,
sizeof(uint32_t));
int r, s, x, y;
printf("Testing area sets (%s): ", test_target_name(target));

View File

@@ -144,7 +144,8 @@ static void area_tests(struct test *t, int reps, int sets, enum target target, i
{
struct test_target tt;
XImage image;
uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height);
uint32_t *cells = calloc(t->out.width * t->out.height,
sizeof(uint32_t));
int r, s, x, y;
printf("Testing area sets (%s %s shm): ",

View File

@@ -109,7 +109,8 @@ static void area_tests(struct test *t, int reps, int sets, enum target target)
{
struct test_target tt;
XImage image;
uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height);
uint32_t *cells = calloc(t->out.width * t->out.height,
sizeof(uint32_t));
int r, s, x, y;
printf("Testing area sets (%s): ", test_target_name(target));

View File

@@ -139,7 +139,8 @@ static void area_tests(struct test *t, int reps, int sets, enum target target)
{
struct test_target tt;
XImage image;
uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height);
uint32_t *cells = calloc(t->out.width * t->out.height,
sizeof(uint32_t));
int r, s, x, y;
printf("Testing area sets (%s): ", test_target_name(target));

View File

@@ -158,7 +158,8 @@ static void area_tests(struct test *t, int reps, int sets, enum target target)
{
struct test_target tt;
XImage image;
uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height);
uint32_t *cells = calloc(t->out.width * t->out.height,
sizeof(uint32_t));
int r, s, x, y;
printf("Testing area sets (%s): ", test_target_name(target));

View File

@@ -131,7 +131,8 @@ static void area_tests(struct test *t, int reps, int sets, enum target target)
{
struct test_target tt;
XImage image;
uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height);
uint32_t *cells = calloc(t->out.width * t->out.height,
sizeof(uint32_t));
int r, s, x, y;
printf("Testing area sets (%s): ", test_target_name(target));

View File

@@ -101,7 +101,8 @@ static void area_tests(struct test *t, int reps, int sets, enum target target)
{
struct test_target tt;
XImage image;
uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height);
uint32_t *cells = calloc(t->out.width * t->out.height,
sizeof(uint32_t));
int r, s, x, y;
printf("Testing area sets (%s): ", test_target_name(target));

View File

@@ -265,7 +265,8 @@ static void area_tests(struct test *t, int reps, int sets, enum target target, i
{
struct test_target tt;
XImage image;
uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height);
uint32_t *cells = calloc(t->out.width * t->out.height,
sizeof(uint32_t));
int r, s, x, y;
printf("Testing area sets (%s using %s source): ",

View File

@@ -151,7 +151,8 @@ static void area_tests(struct test *t, int reps, int sets, enum target target)
{
struct test_target tt;
XImage image;
uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height);
uint32_t *cells = calloc(t->out.width * t->out.height,
sizeof(uint32_t));
int r, s, x, y;
printf("Testing area sets (%s): ", test_target_name(target));