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 <freddy77@gmail.com>
This commit is contained in:
Frediano Ziglio 2024-05-27 18:49:46 +01:00
parent 4674667f0c
commit b92149f2b9

View File

@ -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);