Skip to content

Commit

Permalink
fix implicit declaration warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ghthor committed Aug 25, 2016
1 parent 87dc87b commit ff47a68
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions uinputwrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ int initVKeyboardDevice(char* uinputPath) {
return deviceHandle;
}

int syncEvents(int deviceHandle, struct input_event *ev) {
memset(ev, 0, sizeof(*ev));

ev->type = EV_SYN;
ev->code = 0;
ev->value = SYN_REPORT;

return write(deviceHandle, ev, sizeof(*ev));
}

int sendBtnEvent(int deviceHandle, int key, int btnState) {
// check whether the keycode is valid and return -1 on error
if (key < 1 || key > 255) {
Expand Down Expand Up @@ -87,16 +97,6 @@ int sendBtnEvent(int deviceHandle, int key, int btnState) {
return ret;
}

int syncEvents(int deviceHandle, struct input_event *ev) {
memset(ev, 0, sizeof(*ev));

ev->type = EV_SYN;
ev->code = 0;
ev->value = SYN_REPORT;

return write(deviceHandle, ev, sizeof(*ev));
}

int releaseDevice(int deviceHandle) {
return ioctl(deviceHandle, UI_DEV_DESTROY);
}

0 comments on commit ff47a68

Please sign in to comment.