Skip to content

Commit

Permalink
Tools: Testbench: Change struct of struct zeros initialize
Browse files Browse the repository at this point in the history
The simple {0} is not accepted by xt-xcc compiler. It gives
"warning: missing braces around initializer".

Adding sufficient number of braces to match the struct definition
fixes the build.

Signed-off-by: Seppo Ingalsuo <[email protected]>
  • Loading branch information
singalsu authored and kv2019i committed Mar 13, 2023
1 parent 8a48c78 commit f73055a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/testbench/common_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ int tb_pipeline_params(struct ipc *ipc, struct pipeline *p,
{
struct ipc_comp_dev *pcm_dev;
struct comp_dev *cd;
struct sof_ipc_pcm_params params = {0};
struct sof_ipc_pcm_params params = {{0}};
char message[DEBUG_MSG_LEN];
int fs_period;
int period;
Expand Down
8 changes: 4 additions & 4 deletions tools/testbench/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int tplg_register_asrc(struct tplg_context *ctx)
int tplg_register_buffer(struct tplg_context *ctx)
{
struct sof *sof = ctx->sof;
struct sof_ipc_buffer buffer = {0};
struct sof_ipc_buffer buffer = {{{0}}};
int ret;

ret = tplg_create_buffer(ctx, &buffer);
Expand Down Expand Up @@ -256,7 +256,7 @@ int tplg_register_pga(struct tplg_context *ctx)
int tplg_register_pipeline(struct tplg_context *ctx)
{
struct sof *sof = ctx->sof;
struct sof_ipc_pipe_new pipeline = {0};
struct sof_ipc_pipe_new pipeline = {{0}};
FILE *file = ctx->file;
int ret;

Expand Down Expand Up @@ -680,7 +680,7 @@ static int load_fileread(struct tplg_context *ctx, int dir)
struct sof *sof = ctx->sof;
struct testbench_prm *tp = ctx->tp;
FILE *file = ctx->file;
struct sof_ipc_comp_file fileread = {0};
struct sof_ipc_comp_file fileread = {{{0}}};
int ret;

fileread.config.frame_fmt = find_format(tp->bits_in);
Expand Down Expand Up @@ -730,7 +730,7 @@ static int load_filewrite(struct tplg_context *ctx, int dir)
struct sof *sof = ctx->sof;
struct testbench_prm *tp = ctx->tp;
FILE *file = ctx->file;
struct sof_ipc_comp_file filewrite = {0};
struct sof_ipc_comp_file filewrite = {{{0}}};
int ret;

ret = tplg_load_filewrite(ctx, &filewrite);
Expand Down

0 comments on commit f73055a

Please sign in to comment.