Update return types of event handler functions

Missed this in previous commit.
dev
Kristian Høgsberg 14 years ago
parent 127d0f0050
commit b1868479ad
  1. 8
      compositor/compositor-drm.c
  2. 8
      compositor/compositor.c
  3. 9
      compositor/evdev.c
  4. 13
      compositor/tty.c

@ -234,7 +234,7 @@ out:
return ret;
}
static void
static int
on_drm_input(int fd, uint32_t mask, void *data)
{
drmEventContext evctx;
@ -243,6 +243,8 @@ on_drm_input(int fd, uint32_t mask, void *data)
evctx.version = DRM_EVENT_CONTEXT_VERSION;
evctx.page_flip_handler = page_flip_handler;
drmHandleEvent(fd, &evctx);
return 1;
}
static int
@ -578,7 +580,7 @@ udev_event_is_hotplug(struct udev_device *device)
return strcmp(udev_list_entry_get_value(hotplug_entry), "1") == 0;
}
static void
static int
udev_drm_event(int fd, uint32_t mask, void *data)
{
struct drm_compositor *ec = data;
@ -590,6 +592,8 @@ udev_drm_event(int fd, uint32_t mask, void *data)
update_outputs(ec);
udev_device_unref(event);
return 1;
}
static EGLImageKHR

@ -669,7 +669,7 @@ wlsc_output_repaint(struct wlsc_output *output)
}
}
static void
static int
repaint(void *data)
{
struct wlsc_compositor *ec = data;
@ -695,6 +695,8 @@ repaint(void *data)
ec->repaint_on_timeout = 0;
else
wl_event_source_timer_update(ec->timer_source, 1);
return 1;
}
void
@ -1636,11 +1638,13 @@ wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display)
return 0;
}
static void on_term_signal(int signal_number, void *data)
static int on_term_signal(int signal_number, void *data)
{
struct wlsc_compositor *ec = data;
wl_display_terminate(ec->wl_display);
return 1;
}
int main(int argc, char *argv[])

@ -42,7 +42,8 @@ struct evdev_input_device {
int min_x, max_x, min_y, max_y;
};
static void evdev_input_device_data(int fd, uint32_t mask, void *data)
static int
evdev_input_device_data(int fd, uint32_t mask, void *data)
{
struct wlsc_compositor *ec;
struct evdev_input_device *device = data;
@ -58,7 +59,7 @@ static void evdev_input_device_data(int fd, uint32_t mask, void *data)
ec = (struct wlsc_compositor *)
device->master->base.input_device.compositor;
if (!ec->focus)
return;
return 1;
dx = 0;
dy = 0;
@ -69,7 +70,7 @@ static void evdev_input_device_data(int fd, uint32_t mask, void *data)
len = read(fd, &ev, sizeof ev);
if (len < 0 || len % sizeof e[0] != 0) {
/* FIXME: handle error... reopen device? */;
return;
return 1;
}
e = ev;
@ -149,6 +150,8 @@ static void evdev_input_device_data(int fd, uint32_t mask, void *data)
time, x + dx, y + dy);
if (absolute_event)
notify_motion(&device->master->base.input_device, time, x, y);
return 1;
}
#define TEST_BIT(b, i) (b[(i) / 32] & (1 << (i & 31)))

@ -43,7 +43,7 @@ struct tty {
struct wl_event_source *leave_vt_source;
};
static void on_enter_vt(int signal_number, void *data)
static int on_enter_vt(int signal_number, void *data)
{
struct tty *tty = data;
int ret;
@ -54,9 +54,12 @@ static void on_enter_vt(int signal_number, void *data)
ret = ioctl(tty->fd, KDSETMODE, KD_GRAPHICS);
if (ret)
fprintf(stderr, "failed to set KD_GRAPHICS mode on console: %m\n");
return 1;
}
static void on_leave_vt(int signal_number, void *data)
static int
on_leave_vt(int signal_number, void *data)
{
struct tty *tty = data;
int ret;
@ -66,9 +69,11 @@ static void on_leave_vt(int signal_number, void *data)
if (ret)
fprintf(stderr,
"failed to set KD_TEXT mode on console: %m\n");
return 1;
}
static void
static int
on_tty_input(int fd, uint32_t mask, void *data)
{
struct tty *tty = data;
@ -76,6 +81,8 @@ on_tty_input(int fd, uint32_t mask, void *data)
/* Ignore input to tty. We get keyboard events from evdev
*/
tcflush(tty->fd, TCIFLUSH);
return 1;
}
struct tty *

Loading…
Cancel
Save