summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/data.h4
-rw-r--r--lib/receiver.c1
-rw-r--r--lib/sender.c10
3 files changed, 7 insertions, 8 deletions
diff --git a/lib/data.h b/lib/data.h
index 7072ba9..ba6559c 100644
--- a/lib/data.h
+++ b/lib/data.h
@@ -26,8 +26,8 @@ struct icipc_data {
#define ICIPC_DATA_BODY_SIZE(d) (((const struct icipc_data*)(d))->size)
#define ICIPC_DATA_TYPE(d) (((const struct icipc_data*)(d))->type)
#define ICIPC_DATA_SIZE(d) (sizeof(struct icipc_data) + ICIPC_DATA_BODY_SIZE(d))
-#define ICIPC_DATA_BODY(d) ((void*)(((uint8_t *) d) + sizeof(struct icipc_data)))
-#define ICIPC_DATA_BODY_CONST(d) ((const void*)(((const uint8_t *) d) + sizeof(struct icipc_data)))
+#define ICIPC_DATA_BODY(d) ((void*)(((uint8_t *) (d)) + sizeof(struct icipc_data)))
+#define ICIPC_DATA_BODY_CONST(d) ((const void*)(((const uint8_t *) (d)) + sizeof(struct icipc_data)))
enum {
DATA_TYPE_NONE = 1, /* SPA_TYPE_None */
diff --git a/lib/receiver.c b/lib/receiver.c
index e039ced..993db32 100644
--- a/lib/receiver.c
+++ b/lib/receiver.c
@@ -158,7 +158,6 @@ struct icipc_receiver *icipc_receiver_new(
if (stat(self->addr.sun_path, &socket_stat) < 0) {
if (errno != ENOENT) {
- res = -errno;
icipc_log_error("receiver %p: stat %s failed "
"with error: %m",
self, self->addr.sun_path);
diff --git a/lib/sender.c b/lib/sender.c
index fa2882e..3617d9e 100644
--- a/lib/sender.c
+++ b/lib/sender.c
@@ -50,10 +50,10 @@ static int push_sync_task(
struct icipc_sender *self,
icipc_sender_reply_func_t func,
void *data) {
- size_t i;
+ int i;
for (i = MAX_ASYNC_TASKS; i > 1; i--) {
- SenderTask *curr = self->async_tasks + i - 1;
- SenderTask *next = self->async_tasks + i - 2;
+ SenderTask *curr = &self->async_tasks[i - 1];
+ SenderTask *next = &self->async_tasks[i - 2];
if (next->func != NULL && curr->func == NULL) {
curr->func = func;
curr->data = data;
@@ -74,9 +74,9 @@ static void pop_sync_task(
bool all,
const uint8_t * buffer,
size_t size) {
- size_t i;
+ int i;
for (i = 0; i < MAX_ASYNC_TASKS; i++) {
- SenderTask *task = self->async_tasks + i;
+ SenderTask *task = &self->async_tasks[i];
if (task->func != NULL) {
if (trigger)
task->func(self, buffer, size, task->data);