small cleanups

This commit is contained in:
Wim Taymans 2017-05-26 15:55:23 +02:00
parent 0f6b3a7cab
commit 6b2d77e64d
2 changed files with 9 additions and 9 deletions

View file

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

View file

@ -30,8 +30,7 @@ extern "C" {
#include <string.h>
#include <stddef.h>
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,