From bf5e54b2e9c55186d0cf34098506a270a3f416a0 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 29 May 2019 17:26:21 +0200 Subject: [PATCH] Make control_event_serialize() return size_t control_event_serialize() returns the number of bytes written, so the type should be size_t. --- app/src/control_event.c | 2 +- app/src/control_event.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/control_event.c b/app/src/control_event.c index e836f506..ea6585a4 100644 --- a/app/src/control_event.c +++ b/app/src/control_event.c @@ -13,7 +13,7 @@ write_position(uint8_t *buf, const struct position *position) { buffer_write16be(&buf[10], position->screen_size.height); } -int +size_t control_event_serialize(const struct control_event *event, unsigned char *buf) { buf[0] = event->type; switch (event->type) { diff --git a/app/src/control_event.h b/app/src/control_event.h index 70d8d494..49ec7020 100644 --- a/app/src/control_event.h +++ b/app/src/control_event.h @@ -2,6 +2,7 @@ #define CONTROLEVENT_H #include +#include #include #include "android/input.h" @@ -60,7 +61,8 @@ struct control_event_queue { }; // buf size must be at least CONTROL_EVENT_SERIALIZED_MAX_SIZE -int +// return the number of bytes written +size_t control_event_serialize(const struct control_event *event, unsigned char *buf); bool