From eff793ab46f1e93a5a76ab985abb4c27ff0eb0ed Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 31 Jul 2021 17:25:41 +0200 Subject: [PATCH] Fix indentation all through the project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a “regression” from 04918f3b0bb9121d550e6b397b3fd9258e95734d, but also other missed pieces. --- clients/desktop-shell.c | 2 +- clients/dnd.c | 6 ++-- clients/terminal.c | 6 ++-- clients/window.c | 6 ++-- compositor/xwayland.c | 2 +- desktop-shell/exposay.c | 4 +-- desktop-shell/shell.c | 22 +++++++------- include/libweston/libweston.h | 40 ++++++++++++------------- include/libweston/windowed-output-api.h | 2 +- libweston/animation.c | 8 ++--- libweston/backend-drm/drm-virtual.c | 4 +-- libweston/backend-drm/fb.c | 14 ++++----- libweston/backend-drm/state-propose.c | 14 ++++----- libweston/backend-wayland/wayland.c | 4 +-- libweston/backend-x11/x11.c | 10 +++---- libweston/compositor.c | 4 +-- libweston/input.c | 16 +++++----- libweston/libinput-device.c | 4 +-- libweston/log.c | 4 +-- libweston/pixman-renderer.c | 2 +- libweston/renderer-gl/gl-renderer.c | 4 +-- libweston/weston-log-wayland.c | 2 +- shared/platform.h | 8 ++--- tests/weston-test.c | 2 +- xwayland/window-manager.c | 2 +- 25 files changed, 96 insertions(+), 96 deletions(-) diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index f3821f6c..55cbd001 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -1460,7 +1460,7 @@ panel_add_launchers(struct panel *panel, struct desktop *desktop) } if (count == 0) { - char *name = file_name_with_datadir("terminal.png"); + char *name = file_name_with_datadir("terminal.png"); /* add default launcher */ panel_add_launcher(panel, diff --git a/clients/dnd.c b/clients/dnd.c index 8323f4fd..92ed4e9a 100644 --- a/clients/dnd.c +++ b/clients/dnd.c @@ -416,9 +416,9 @@ data_source_dnd_finished(void *data, struct wl_data_source *source) delete_item = dnd_drag->dnd_action == WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE; - /* The operation is already finished, we can destroy all - * related data. - */ + /* The operation is already finished, we can destroy all + * related data. + */ dnd_drag_destroy(dnd_drag, delete_item); window_schedule_redraw(dnd->window); } diff --git a/clients/terminal.c b/clients/terminal.c index 66e2bf54..f062a993 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -1124,9 +1124,9 @@ redraw_handler(struct widget *widget, void *data) cairo_stroke(cr); } - /* skip space glyph (RLE) we use as a placeholder of - the right half of a double-width character, - because RLE is not available in every font. */ + /* skip space glyph (RLE) we use as a placeholder of + the right half of a double-width character, + because RLE is not available in every font. */ if (p_row[col].ch == 0x200B) continue; diff --git a/clients/window.c b/clients/window.c index 985d3958..f54d38e7 100644 --- a/clients/window.c +++ b/clients/window.c @@ -2214,9 +2214,9 @@ widget_set_tooltip(struct widget *parent, char *entry, float x, float y) if (parent->tooltip_count > 1) return 0; - tooltip = malloc(sizeof *tooltip); - if (!tooltip) - return -1; + tooltip = malloc(sizeof *tooltip); + if (!tooltip) + return -1; parent->tooltip = tooltip; tooltip->parent = parent; diff --git a/compositor/xwayland.c b/compositor/xwayland.c index cbb27b51..8cdf0555 100644 --- a/compositor/xwayland.c +++ b/compositor/xwayland.c @@ -175,7 +175,7 @@ xserver_cleanup(struct weston_process *process, int status) wxw->api->xserver_exited(wxw->xwayland, status); wxw->sigusr1_source = wl_event_loop_add_signal(loop, SIGUSR1, - handle_sigusr1, wxw); + handle_sigusr1, wxw); wxw->client = NULL; } diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c index 7e9a324c..c7c064b5 100644 --- a/desktop-shell/exposay.c +++ b/desktop-shell/exposay.c @@ -183,8 +183,8 @@ exposay_pick(struct desktop_shell *shell, int x, int y) { struct exposay_surface *esurface; - if (exposay_is_animating(shell)) - return; + if (exposay_is_animating(shell)) + return; wl_list_for_each(esurface, &shell->exposay.surface_list, link) { if (x < esurface->x || x > esurface->x + esurface->width) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 0d0daa3f..96289ae4 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -2465,17 +2465,17 @@ desktop_surface_removed(struct weston_desktop_surface *desktop_surface, if (weston_surface_is_mapped(surface) && shsurf->shell->win_close_animation_type == ANIMATION_FADE) { - if (shsurf->shell->compositor->state == WESTON_COMPOSITOR_ACTIVE) { - pixman_region32_fini(&surface->pending.input); - pixman_region32_init(&surface->pending.input); - pixman_region32_fini(&surface->input); - pixman_region32_init(&surface->input); - weston_fade_run(shsurf->view, 1.0, 0.0, 300.0, - fade_out_done, shsurf); - return; - } else { - --surface->ref_count; - } + if (shsurf->shell->compositor->state == WESTON_COMPOSITOR_ACTIVE) { + pixman_region32_fini(&surface->pending.input); + pixman_region32_init(&surface->pending.input); + pixman_region32_fini(&surface->input); + pixman_region32_init(&surface->input); + weston_fade_run(shsurf->view, 1.0, 0.0, 300.0, + fade_out_done, shsurf); + return; + } else { + --surface->ref_count; + } } weston_surface_destroy(surface); diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 4b941e31..07df6285 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -848,11 +848,11 @@ struct weston_seat { }; enum { - WESTON_COMPOSITOR_ACTIVE, /* normal rendering and events */ - WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */ - WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */ - WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dpms - * to off */ + WESTON_COMPOSITOR_ACTIVE, /* normal rendering and events */ + WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */ + WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */ + WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dpms + * to off */ }; struct weston_layer_entry { @@ -1012,22 +1012,22 @@ enum weston_capability { * \endrststar */ struct weston_backend_config { - /** Major version for the backend-specific config struct - * - * This version must match exactly what the backend expects, otherwise - * the struct is incompatible. - */ - uint32_t struct_version; + /** Major version for the backend-specific config struct + * + * This version must match exactly what the backend expects, otherwise + * the struct is incompatible. + */ + uint32_t struct_version; - /** Minor version of the backend-specific config struct - * - * This must be set to sizeof(struct backend-specific config). - * If the value here is smaller than what the backend expects, the - * extra config members will assume their default values. - * - * A value greater than what the backend expects is incompatible. - */ - size_t struct_size; + /** Minor version of the backend-specific config struct + * + * This must be set to sizeof(struct backend-specific config). + * If the value here is smaller than what the backend expects, the + * extra config members will assume their default values. + * + * A value greater than what the backend expects is incompatible. + */ + size_t struct_size; }; struct weston_backend; diff --git a/include/libweston/windowed-output-api.h b/include/libweston/windowed-output-api.h index be4dec67..42214d1b 100644 --- a/include/libweston/windowed-output-api.h +++ b/include/libweston/windowed-output-api.h @@ -47,7 +47,7 @@ struct weston_windowed_output_api { * Returns 0 on success, -1 on failure. * * This assigns a desired width and height to a windowed - * output. The backend decides what should be done and applies + * output. The backend decides what should be done and applies * the desired configuration. After using this function and * generic weston_output_set_*, a windowed * output should be in a state where weston_output_enable() diff --git a/libweston/animation.c b/libweston/animation.c index 9ca77745..f11754cb 100644 --- a/libweston/animation.c +++ b/libweston/animation.c @@ -458,15 +458,15 @@ move_frame(struct weston_view_animation *animation) progress = 1.0 - progress; scale = animation->start + - (animation->stop - animation->start) * - progress; + (animation->stop - animation->start) * + progress; weston_matrix_init(&animation->transform.matrix); if (move->scale) weston_matrix_scale(&animation->transform.matrix, scale, scale, 1.0f); weston_matrix_translate(&animation->transform.matrix, - move->dx * progress, move->dy * progress, - 0); + move->dx * progress, move->dy * progress, + 0); } static void diff --git a/libweston/backend-drm/drm-virtual.c b/libweston/backend-drm/drm-virtual.c index 6ca32c6f..597e71c1 100644 --- a/libweston/backend-drm/drm-virtual.c +++ b/libweston/backend-drm/drm-virtual.c @@ -62,8 +62,8 @@ drm_virtual_crtc_create(struct drm_backend *b, struct drm_output *output) crtc->pipe = 0; /* Poisoning the pointers as CRTC's of virtual outputs should not be - * added to the DRM-backend CRTC list. With this we can assure (in - * function drm_virtual_crtc_destroy()) that this did not happen. */ + * added to the DRM-backend CRTC list. With this we can assure (in + * function drm_virtual_crtc_destroy()) that this did not happen. */ crtc->link.prev = POISON_PTR; crtc->link.next = POISON_PTR; diff --git a/libweston/backend-drm/fb.c b/libweston/backend-drm/fb.c index 4943793f..1d35b493 100644 --- a/libweston/backend-drm/fb.c +++ b/libweston/backend-drm/fb.c @@ -238,13 +238,13 @@ drm_fb_get_from_dmabuf(struct linux_dmabuf_buffer *dmabuf, .modifier = dmabuf->attributes.modifier[0], }; - /* We should not import to KMS a buffer that has been allocated using no - * modifiers. Usually drivers use linear layouts to allocate with no - * modifiers, but this is not a rule. The driver could use, for - * instance, a tiling layout under the hood - and both Weston and the - * KMS driver can't know. So giving the buffer to KMS is not safe, as - * not knowing its layout can result in garbage being displayed. In - * short, importing a buffer to KMS requires explicit modifiers. */ + /* We should not import to KMS a buffer that has been allocated using no + * modifiers. Usually drivers use linear layouts to allocate with no + * modifiers, but this is not a rule. The driver could use, for + * instance, a tiling layout under the hood - and both Weston and the + * KMS driver can't know. So giving the buffer to KMS is not safe, as + * not knowing its layout can result in garbage being displayed. In + * short, importing a buffer to KMS requires explicit modifiers. */ if (dmabuf->attributes.modifier[0] == DRM_FORMAT_MOD_INVALID) return NULL; diff --git a/libweston/backend-drm/state-propose.c b/libweston/backend-drm/state-propose.c index 78deb928..ce168d1f 100644 --- a/libweston/backend-drm/state-propose.c +++ b/libweston/backend-drm/state-propose.c @@ -114,7 +114,7 @@ drm_output_destroy_zpos_plane(struct drm_plane_zpos *plane_zpos) static bool drm_output_check_plane_has_view_assigned(struct drm_plane *plane, - struct drm_output_state *output_state) + struct drm_output_state *output_state) { struct drm_plane_state *ps; wl_list_for_each(ps, &output_state->plane_list, link) { @@ -140,12 +140,12 @@ drm_output_plane_has_valid_format(struct drm_plane *plane, fb->format->format); if (fmt) { /* We never try to promote a dmabuf with DRM_FORMAT_MOD_INVALID - * to a KMS plane (see drm_fb_get_from_dmabuf() for more details). - * So if fb->modifier == DRM_FORMAT_MOD_INVALID, we are sure - * that this is for the legacy GBM import path, in which a - * wl_drm is being used for scanout. Mesa is the only user we - * care in this case (even though recent versions are also using - * dmabufs), and it should know better what works or not. */ + * to a KMS plane (see drm_fb_get_from_dmabuf() for more details). + * So if fb->modifier == DRM_FORMAT_MOD_INVALID, we are sure + * that this is for the legacy GBM import path, in which a + * wl_drm is being used for scanout. Mesa is the only user we + * care in this case (even though recent versions are also using + * dmabufs), and it should know better what works or not. */ if (fb->modifier == DRM_FORMAT_MOD_INVALID) return true; diff --git a/libweston/backend-wayland/wayland.c b/libweston/backend-wayland/wayland.c index 75e3266c..0bed6b56 100644 --- a/libweston/backend-wayland/wayland.c +++ b/libweston/backend-wayland/wayland.c @@ -2212,8 +2212,8 @@ input_handle_touch_up(void *data, struct wl_touch *wl_touch, static void input_handle_touch_motion(void *data, struct wl_touch *wl_touch, - uint32_t time, int32_t id, - wl_fixed_t fixed_x, wl_fixed_t fixed_y) + uint32_t time, int32_t id, + wl_fixed_t fixed_x, wl_fixed_t fixed_y) { struct wayland_input *input = data; struct wayland_output *output = input->touch_focus; diff --git a/libweston/backend-x11/x11.c b/libweston/backend-x11/x11.c index 3336370d..31591343 100644 --- a/libweston/backend-x11/x11.c +++ b/libweston/backend-x11/x11.c @@ -807,14 +807,14 @@ x11_output_switch_mode(struct weston_output *base, struct weston_mode *mode) static uint32_t values[2]; int ret; - b = to_x11_backend(base->compositor); - output = to_x11_output(base); + b = to_x11_backend(base->compositor); + output = to_x11_output(base); - if (mode->width == output->mode.width && + if (mode->width == output->mode.width && mode->height == output->mode.height) - return 0; + return 0; - if (mode->width < WINDOW_MIN_WIDTH || mode->width > WINDOW_MAX_WIDTH) + if (mode->width < WINDOW_MIN_WIDTH || mode->width > WINDOW_MAX_WIDTH) return -1; if (mode->height < WINDOW_MIN_HEIGHT || mode->height > WINDOW_MAX_HEIGHT) diff --git a/libweston/compositor.c b/libweston/compositor.c index 8f29ee2b..5ba909f4 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -4927,9 +4927,9 @@ static void weston_compositor_dpms(struct weston_compositor *compositor, enum dpms_enum state) { - struct weston_output *output; + struct weston_output *output; - wl_list_for_each(output, &compositor->output_list, link) + wl_list_for_each(output, &compositor->output_list, link) if (output->set_dpms) output->set_dpms(output, state); } diff --git a/libweston/input.c b/libweston/input.c index 49e30352..e3954d0a 100644 --- a/libweston/input.c +++ b/libweston/input.c @@ -523,8 +523,8 @@ pointer_send_motion(struct weston_pointer *pointer, msecs = timespec_to_msec(time); wl_resource_for_each(resource, resource_list) { send_timestamps_for_input_resource(resource, - &pointer->timestamps_list, - time); + &pointer->timestamps_list, + time); wl_pointer_send_motion(resource, msecs, sx, sy); } } @@ -609,8 +609,8 @@ weston_pointer_send_button(struct weston_pointer *pointer, msecs = timespec_to_msec(time); wl_resource_for_each(resource, resource_list) { send_timestamps_for_input_resource(resource, - &pointer->timestamps_list, - time); + &pointer->timestamps_list, + time); wl_pointer_send_button(resource, serial, msecs, button, state); } } @@ -1965,7 +1965,7 @@ weston_keyboard_set_locks(struct weston_keyboard *keyboard, mods_locked = xkb_state_serialize_mods(keyboard->xkb_state.state, XKB_STATE_LOCKED); group = xkb_state_serialize_group(keyboard->xkb_state.state, - XKB_STATE_EFFECTIVE); + XKB_STATE_EFFECTIVE); num = (1 << keyboard->xkb_info->mod2_mod); caps = (1 << keyboard->xkb_info->caps_mod); @@ -2783,7 +2783,7 @@ seat_get_pointer(struct wl_client *client, struct wl_resource *resource, struct wl_resource *cr; struct weston_pointer_client *pointer_client; - cr = wl_resource_create(client, &wl_pointer_interface, + cr = wl_resource_create(client, &wl_pointer_interface, wl_resource_get_version(resource), id); if (cr == NULL) { wl_client_post_no_memory(client); @@ -2864,7 +2864,7 @@ seat_get_keyboard(struct wl_client *client, struct wl_resource *resource, struct weston_keyboard *keyboard = seat ? seat->keyboard_state : NULL; struct wl_resource *cr; - cr = wl_resource_create(client, &wl_keyboard_interface, + cr = wl_resource_create(client, &wl_keyboard_interface, wl_resource_get_version(resource), id); if (cr == NULL) { wl_client_post_no_memory(client); @@ -2957,7 +2957,7 @@ seat_get_touch(struct wl_client *client, struct wl_resource *resource, struct weston_touch *touch = seat ? seat->touch_state : NULL; struct wl_resource *cr; - cr = wl_resource_create(client, &wl_touch_interface, + cr = wl_resource_create(client, &wl_touch_interface, wl_resource_get_version(resource), id); if (cr == NULL) { wl_client_post_no_memory(client); diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c index 5cc94284..4ea89de0 100644 --- a/libweston/libinput-device.c +++ b/libweston/libinput-device.c @@ -192,8 +192,8 @@ handle_pointer_button(struct libinput_device *libinput_device, libinput_event_pointer_get_time_usec(pointer_event)); notify_button(device->seat, &time, - libinput_event_pointer_get_button(pointer_event), - button_state); + libinput_event_pointer_get_button(pointer_event), + button_state); return true; } diff --git a/libweston/log.c b/libweston/log.c index da57e034..911feae4 100644 --- a/libweston/log.c +++ b/libweston/log.c @@ -71,8 +71,8 @@ static log_func_t log_continue_handler = default_log_handler; static int default_log_handler(const char *fmt, va_list ap) { - fprintf(stderr, "weston_log_set_handler() must be called before using of weston_log().\n"); - abort(); + fprintf(stderr, "weston_log_set_handler() must be called before using of weston_log().\n"); + abort(); } /** Install the log handler diff --git a/libweston/pixman-renderer.c b/libweston/pixman-renderer.c index 78a0bcb8..ebc0fa79 100644 --- a/libweston/pixman-renderer.c +++ b/libweston/pixman-renderer.c @@ -669,7 +669,7 @@ pixman_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) wl_shm_buffer_get_format(shm_buffer)); weston_buffer_reference(&ps->buffer_ref, NULL); weston_buffer_release_reference(&ps->buffer_release_ref, NULL); - weston_buffer_send_server_error(buffer, + weston_buffer_send_server_error(buffer, "disconnecting due to unhandled buffer type"); return; break; diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index 898cb907..ea98f768 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -593,7 +593,7 @@ texture_region(struct weston_view *ev, vtxcnt = wl_array_add(&gr->vtxcnt, nrects * nsurf * sizeof *vtxcnt); inv_width = 1.0 / gs->pitch; - inv_height = 1.0 / gs->height; + inv_height = 1.0 / gs->height; for (i = 0; i < nrects; i++) { pixman_box32_t *rect = &rects[i]; @@ -2960,7 +2960,7 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) gs->buffer_type = BUFFER_TYPE_NULL; gs->y_inverted = true; es->is_opaque = false; - weston_buffer_send_server_error(buffer, + weston_buffer_send_server_error(buffer, "disconnecting due to unhandled buffer type"); } } diff --git a/libweston/weston-log-wayland.c b/libweston/weston-log-wayland.c index 0add7728..8b977140 100644 --- a/libweston/weston-log-wayland.c +++ b/libweston/weston-log-wayland.c @@ -59,7 +59,7 @@ struct weston_log_debug_wayland { static struct weston_log_debug_wayland * to_weston_log_debug_wayland(struct weston_log_subscriber *sub) { - return container_of(sub, struct weston_log_debug_wayland, base); + return container_of(sub, struct weston_log_debug_wayland, base); } static void diff --git a/shared/platform.h b/shared/platform.h index 9264bb43..86811f34 100644 --- a/shared/platform.h +++ b/shared/platform.h @@ -93,8 +93,8 @@ weston_platform_get_egl_display(EGLenum platform, void *native_display, if (!get_platform_display) { get_platform_display = (PFNEGLGETPLATFORMDISPLAYEXTPROC) - weston_platform_get_egl_proc_address( - "eglGetPlatformDisplayEXT"); + weston_platform_get_egl_proc_address( + "eglGetPlatformDisplayEXT"); } if (get_platform_display) @@ -114,8 +114,8 @@ weston_platform_create_egl_surface(EGLDisplay dpy, EGLConfig config, if (!create_platform_window) { create_platform_window = (PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) - weston_platform_get_egl_proc_address( - "eglCreatePlatformWindowSurfaceEXT"); + weston_platform_get_egl_proc_address( + "eglCreatePlatformWindowSurfaceEXT"); } if (create_platform_window) diff --git a/tests/weston-test.c b/tests/weston-test.c index 772e5d03..bf132960 100644 --- a/tests/weston-test.c +++ b/tests/weston-test.c @@ -171,7 +171,7 @@ test_surface_committed(struct weston_surface *surface, int32_t sx, int32_t sy) static int test_surface_get_label(struct weston_surface *surface, char *buf, size_t len) { - return snprintf(buf, len, "test suite surface"); + return snprintf(buf, len, "test suite surface"); } static void diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 9c2413d9..ef8d92b0 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -1497,7 +1497,7 @@ weston_wm_window_create(struct weston_wm *wm, geometry_cookie = xcb_get_geometry(wm->conn, id); values[0] = XCB_EVENT_MASK_PROPERTY_CHANGE | - XCB_EVENT_MASK_FOCUS_CHANGE; + XCB_EVENT_MASK_FOCUS_CHANGE; xcb_change_window_attributes(wm->conn, id, XCB_CW_EVENT_MASK, values); window->wm = wm;