Skip to content

Commit

Permalink
Merge pull request bendahl#2 from ghthor/fix-compile-warning
Browse files Browse the repository at this point in the history
fix implicit declaration warning
  • Loading branch information
Benjamin Dahlmanns authored Aug 29, 2016
2 parents 76f5ea0 + ff47a68 commit 1ab6dec
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, char* virtDeviceName) {
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 1ab6dec

Please sign in to comment.