Make control_event_serialize() return size_t

control_event_serialize() returns the number of bytes written, so the
type should be size_t.
This commit is contained in:
Romain Vimont 2019-05-29 17:26:21 +02:00
parent 507b0bcccf
commit bf5e54b2e9
2 changed files with 4 additions and 2 deletions

View file

@ -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) {

View file

@ -2,6 +2,7 @@
#define CONTROLEVENT_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#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