mirror of
https://github.com/troglobit/libuev.git
synced 2026-10-22 11:16:05 +00:00
Reverse christmas tree and simplify a bit
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
d4096c8c0c
commit
2a709f739d
9 files changed
+23
-23
No files matched your search
+3
-3
@@ -74,16 +74,16 @@ static void joystick_cb(uev_t *w, void *arg, int events)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int fd;
|
||||
uev_t js1_watcher;
|
||||
uev_ctx_t ctx;
|
||||
uev_t js1;
|
||||
int fd;
|
||||
|
||||
fd = open("/dev/input/js0", O_RDONLY, O_NONBLOCK);
|
||||
if (fd < 0)
|
||||
errx(errno, "Cannot find a joystick attached.");
|
||||
|
||||
uev_init(&ctx);
|
||||
uev_io_init(&ctx, &js1_watcher, joystick_cb, NULL, fd, UEV_READ);
|
||||
uev_io_init(&ctx, &js1, joystick_cb, NULL, fd, UEV_READ);
|
||||
|
||||
puts("Starting, press Ctrl-C to exit.");
|
||||
|
||||
|
||||
+2
-2
@@ -47,9 +47,9 @@ void process_stdin(uev_t *w, void *arg, int events)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
uev_t watcher;
|
||||
uev_ctx_t ctx;
|
||||
uev_t watcher;
|
||||
int ret;
|
||||
|
||||
uev_init(&ctx);
|
||||
|
||||
|
||||
Reference in new issue
Block a user