mirror of https://github.com/Genymobile/scrcpy
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:
parent
507b0bcccf
commit
bf5e54b2e9
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue