Skip to content

Commit

Permalink
Cast pointers to size_t instead of uint32_t when printing
Browse files Browse the repository at this point in the history
On 64-bit platforms such as i.MX93 the pointers are 64-bit.
As such, casting them to uint32_t leads to compilation warnings
such as:

"cast to pointer from integer of different size"

To fix this, cast to size_t which, on 32-bit platforms
is 32-bit and 64-bit on 64-bit platforms. Printing will
be done via "%zx".

Signed-off-by: Laurentiu Mihalcea <[email protected]>
  • Loading branch information
LaurentiuM1234 authored and kv2019i committed Nov 30, 2023
1 parent a945ec4 commit a8ad6eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/audio/module_adapter/module/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ int module_load_config(struct comp_dev *dev, const void *cfg, size_t size)
comp_dbg(dev, "module_load_config() start");

if (!cfg || !size) {
comp_err(dev, "module_load_config(): wrong input params! dev %x, cfg %x size %zu",
(uint32_t)dev, (uint32_t)cfg, size);
comp_err(dev, "module_load_config(): wrong input params! dev %zx, cfg %zx size %zu",
(size_t)dev, (size_t)cfg, size);
return -EINVAL;
}

Expand Down
4 changes: 2 additions & 2 deletions src/audio/module_adapter/module_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv,
comp_cl_dbg(drv, "module_adapter_new() start");

if (!config) {
comp_cl_err(drv, "module_adapter_new(), wrong input params! drv = %x config = %x",
(uint32_t)drv, (uint32_t)config);
comp_cl_err(drv, "module_adapter_new(), wrong input params! drv = %zx config = %zx",
(size_t)drv, (size_t)config);
return NULL;
}

Expand Down

0 comments on commit a8ad6eb

Please sign in to comment.