swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit ffdbaf6e699bd3a4419b49ea9c91f0b755306ca7
parent e8b0c05ef1e4139c67603c0f6c6033d71b1c0077
Author: Michael Forney <mforney@mforney.org>
Date:   Fri,  6 Dec 2013 14:52:45 -0800

Style

Diffstat:
Mlibswc/bindings.c | 15+++++++++------
Mlibswc/drm_buffer.c | 4++--
Mlibswc/seat.c | 2+-
Mlibswc/swc.c | 8++++----
4 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/libswc/bindings.c b/libswc/bindings.c @@ -36,7 +36,10 @@ struct binding void * data; }; -static struct wl_array key_bindings; +static struct +{ + struct wl_array keys; +} bindings; static bool handle_key(struct swc_keyboard * keyboard, uint32_t time, uint32_t key, uint32_t state) @@ -58,7 +61,7 @@ static bool handle_key(struct swc_keyboard * keyboard, uint32_t time, if (num_keysyms == 1) { - wl_array_for_each(binding, &key_bindings) + wl_array_for_each(binding, &bindings.keys) { if (binding->value == keysyms[0] && (binding->modifiers == keyboard->modifiers @@ -79,20 +82,20 @@ static struct swc_keyboard_handler binding_handler = { .key = &handle_key, }; -const struct swc_bindings_global swc_bindings_global = { +const struct swc_bindings_global bindings_global = { .keyboard_handler = &binding_handler }; bool swc_bindings_initialize() { - wl_array_init(&key_bindings); + wl_array_init(&bindings.keys); return true; } void swc_bindings_finalize() { - wl_array_release(&key_bindings); + wl_array_release(&bindings.keys); } EXPORT @@ -101,7 +104,7 @@ void swc_add_key_binding(uint32_t modifiers, uint32_t value, { struct binding * binding; - binding = wl_array_add(&key_bindings, sizeof *binding); + binding = wl_array_add(&bindings.keys, sizeof *binding); binding->value = value; binding->modifiers = modifiers; binding->handler = handler; diff --git a/libswc/drm_buffer.c b/libswc/drm_buffer.c @@ -69,7 +69,7 @@ struct swc_drm_buffer * swc_drm_buffer_get(struct wl_resource * resource) { return wl_resource_get_user_data(resource); } - else - return NULL; + + return NULL; } diff --git a/libswc/seat.c b/libswc/seat.c @@ -28,7 +28,7 @@ static struct struct wl_list devices; } seat; -const struct swc_seat_global swc_seat_global = { +const struct swc_seat_global seat_global = { .pointer = &seat.pointer, .keyboard = &seat.keyboard, .data_device = &seat.data_device diff --git a/libswc/swc.c b/libswc/swc.c @@ -37,13 +37,13 @@ #include <libudev.h> -extern const struct swc_seat_global swc_seat_global; -extern const struct swc_bindings_global swc_bindings_global; +extern const struct swc_seat_global seat_global; +extern const struct swc_bindings_global bindings_global; static struct swc_compositor compositor; struct swc swc = { - .seat = &swc_seat_global, - .bindings = &swc_bindings_global, + .seat = &seat_global, + .bindings = &bindings_global, .compositor = &compositor };