From 665d4baaf170d2723f89a482298d1f972431b3c3 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 18 Nov 2015 08:44:08 -0500 Subject: [PATCH] Normalize indentation --- include/client/client.h | 48 +++++++++++++++--------------- wayland/buffers.c | 66 ++++++++++++++++++++--------------------- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/include/client/client.h b/include/client/client.h index 02806eae..39f18caf 100644 --- a/include/client/client.h +++ b/include/client/client.h @@ -8,36 +8,36 @@ #include "list.h" struct output_state { - struct wl_output *output; - uint32_t flags; - uint32_t width, height; + struct wl_output *output; + uint32_t flags; + uint32_t width, height; }; struct buffer { - struct wl_buffer *buffer; - int fd; - cairo_surface_t *surface; - cairo_t *cairo; - PangoContext *pango; - uint32_t width, height; - bool busy; + struct wl_buffer *buffer; + int fd; + cairo_surface_t *surface; + cairo_t *cairo; + PangoContext *pango; + uint32_t width, height; + bool busy; }; struct client_state { - struct wl_compositor *compositor; - struct wl_display *display; - struct wl_pointer *pointer; - struct wl_seat *seat; - struct wl_shell *shell; - struct wl_shm *shm; - struct buffer buffers[2]; - struct buffer *buffer; - struct wl_surface *surface; - struct wl_shell_surface *shell_surface; - struct wl_callback *frame_cb; - uint32_t width, height; - cairo_t *cairo; - list_t *outputs; + struct wl_compositor *compositor; + struct wl_display *display; + struct wl_pointer *pointer; + struct wl_seat *seat; + struct wl_shell *shell; + struct wl_shm *shm; + struct buffer buffers[2]; + struct buffer *buffer; + struct wl_surface *surface; + struct wl_shell_surface *shell_surface; + struct wl_callback *frame_cb; + uint32_t width, height; + cairo_t *cairo; + list_t *outputs; }; struct client_state *client_setup(uint32_t width, uint32_t height); diff --git a/wayland/buffers.c b/wayland/buffers.c index cc8740c4..f426b912 100644 --- a/wayland/buffers.c +++ b/wayland/buffers.c @@ -75,44 +75,44 @@ static struct buffer *create_buffer(struct client_state *state, struct buffer *b } static void destroy_buffer(struct buffer *buffer) { - if (buffer->buffer) { - wl_buffer_destroy(buffer->buffer); - } - if (buffer->cairo) { - cairo_destroy(buffer->cairo); - } - if (buffer->surface) { - cairo_surface_destroy(buffer->surface); - } - memset(buffer, 0, sizeof(struct buffer)); + if (buffer->buffer) { + wl_buffer_destroy(buffer->buffer); + } + if (buffer->cairo) { + cairo_destroy(buffer->cairo); + } + if (buffer->surface) { + cairo_surface_destroy(buffer->surface); + } + memset(buffer, 0, sizeof(struct buffer)); } struct buffer *get_next_buffer(struct client_state *state) { - struct buffer *buffer = NULL; + struct buffer *buffer = NULL; - int i; - for (i = 0; i < 2; ++i) { - if (state->buffers[i].busy) { - continue; + int i; + for (i = 0; i < 2; ++i) { + if (state->buffers[i].busy) { + continue; + } + buffer = &state->buffers[i]; } - buffer = &state->buffers[i]; - } - if (!buffer) { - return NULL; - } - - if (buffer->width != state->width || buffer->height != state->height) { - destroy_buffer(buffer); - } - - if (!buffer->buffer) { - if (!create_buffer(state, buffer, state->width, state->height, WL_SHM_FORMAT_ARGB8888)) { - return NULL; + if (!buffer) { + return NULL; } - } - - state->cairo = buffer->cairo; - state->buffer = buffer; - return buffer; + + if (buffer->width != state->width || buffer->height != state->height) { + destroy_buffer(buffer); + } + + if (!buffer->buffer) { + if (!create_buffer(state, buffer, state->width, state->height, WL_SHM_FORMAT_ARGB8888)) { + return NULL; + } + } + + state->cairo = buffer->cairo; + state->buffer = buffer; + return buffer; }