mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: debug: log: use SPA_CONTAINER_OF()
Use `SPA_CONTAINER_OF()` instead of direct casting as it is more resilient against future changes that might reorder the members in `struct spa_debug_log_ctx`.
This commit is contained in:
parent
6f6bf204d6
commit
e4d1ab0c19
1 changed files with 1 additions and 1 deletions
|
|
@ -38,7 +38,7 @@ struct spa_debug_log_ctx {
|
|||
SPA_PRINTF_FUNC(2,3)
|
||||
static inline void spa_debug_log_log(struct spa_debug_context *ctx, const char *fmt, ...)
|
||||
{
|
||||
struct spa_debug_log_ctx *c = (struct spa_debug_log_ctx*)ctx;
|
||||
struct spa_debug_log_ctx *c = SPA_CONTAINER_OF(ctx, struct spa_debug_log_ctx, ctx);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
spa_log_logtv(c->log, c->level, c->topic, c->file, c->line, c->func, fmt, args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue