From b92149f2b9b16d6eac9832beb2d5da6893fc078b Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Mon, 27 May 2024 18:49:46 +0100 Subject: [PATCH] tests: Remove warning compiling Remove: test-display-streaming.c: In function 'get_commands': test-display-streaming.c:218:42: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 218 | *commands = (Command*) calloc(sizeof(Command), *num_commands); | ^~~~~~~ test-display-streaming.c:218:42: note: earlier argument should specify number of elements, later size of each element Signed-off-by: Frediano Ziglio --- server/tests/test-display-streaming.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/tests/test-display-streaming.c b/server/tests/test-display-streaming.c index 69703a0c..c19d954d 100644 --- a/server/tests/test-display-streaming.c +++ b/server/tests/test-display-streaming.c @@ -215,7 +215,7 @@ static void get_stream_commands(Command *commands, int num_commands, static void get_commands(Command **commands, int *num_commands) { *num_commands = NUM_COMMANDS * 2; - *commands = (Command*) calloc(sizeof(Command), *num_commands); + *commands = (Command*) calloc(*num_commands, sizeof(Command)); get_stream_commands(*commands, NUM_COMMANDS, create_frame1); get_stream_commands((*commands) + NUM_COMMANDS, NUM_COMMANDS, create_frame2);