From 6b2d77e64d39a589a7328d124a8d11ff20ceb5e0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 26 May 2017 15:55:23 +0200 Subject: [PATCH] small cleanups --- pipewire/modules/module-protocol-native.c | 8 ++++---- spa/include/spa/defs.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pipewire/modules/module-protocol-native.c b/pipewire/modules/module-protocol-native.c index e5b1100c0..0dfbe2683 100644 --- a/pipewire/modules/module-protocol-native.c +++ b/pipewire/modules/module-protocol-native.c @@ -148,15 +148,15 @@ connection_data(struct spa_loop_utils *utils, continue; } if (opcode >= resource->iface->n_methods) { - pw_log_error("protocol-native %p: invalid method %u", client->impl, - opcode); + pw_log_error("protocol-native %p: invalid method %u %u", client->impl, + id, opcode); client_destroy(client); break; } demarshal = resource->iface->methods; if (!demarshal[opcode] || !demarshal[opcode] (resource, message, size)) { - pw_log_error("protocol-native %p: invalid message received", - client->impl); + pw_log_error("protocol-native %p: invalid message received %u %u", + client->impl, id, opcode); client_destroy(client); break; } diff --git a/spa/include/spa/defs.h b/spa/include/spa/defs.h index be6e8f8ec..76fb78c67 100644 --- a/spa/include/spa/defs.h +++ b/spa/include/spa/defs.h @@ -30,8 +30,7 @@ extern "C" { #include #include -enum { - SPA_RESULT_ASYNC = (1 << 30), +enum spa_result { SPA_RESULT_WAIT_SYNC = 2, SPA_RESULT_MODIFIED = 1, SPA_RESULT_OK = 0, @@ -73,15 +72,16 @@ enum { SPA_RESULT_INCOMPATIBLE_PROPS = -36, }; +#define SPA_ASYNC_BIT (1 << 30) #define SPA_ASYNC_MASK (3 << 30) -#define SPA_ASYNC_SEQ_MASK (SPA_RESULT_ASYNC - 1) +#define SPA_ASYNC_SEQ_MASK (SPA_ASYNC_BIT - 1) #define SPA_RESULT_IS_OK(res) ((res) >= 0) #define SPA_RESULT_IS_ERROR(res) ((res) < 0) -#define SPA_RESULT_IS_ASYNC(res) (((res) & SPA_ASYNC_MASK) == SPA_RESULT_ASYNC) +#define SPA_RESULT_IS_ASYNC(res) (((res) & SPA_ASYNC_MASK) == SPA_ASYNC_BIT) #define SPA_RESULT_ASYNC_SEQ(res) ((res) & SPA_ASYNC_SEQ_MASK) -#define SPA_RESULT_RETURN_ASYNC(seq) (SPA_RESULT_ASYNC | ((seq) & SPA_ASYNC_SEQ_MASK)) +#define SPA_RESULT_RETURN_ASYNC(seq) (SPA_ASYNC_BIT | ((seq) & SPA_ASYNC_SEQ_MASK)) enum spa_direction { SPA_DIRECTION_INPUT = 0,