diff options
Diffstat (limited to 'xwayland')
-rw-r--r-- | xwayland/selection/incoming.c | 6 | ||||
-rw-r--r-- | xwayland/selection/outgoing.c | 3 | ||||
-rw-r--r-- | xwayland/server.c | 3 | ||||
-rw-r--r-- | xwayland/xwayland.c | 4 | ||||
-rw-r--r-- | xwayland/xwm.c | 13 |
5 files changed, 12 insertions, 17 deletions
diff --git a/xwayland/selection/incoming.c b/xwayland/selection/incoming.c index 755ce16c..c2e1e712 100644 --- a/xwayland/selection/incoming.c +++ b/xwayland/selection/incoming.c @@ -402,8 +402,7 @@ static void xwm_selection_get_targets(struct wlr_xwm_selection *selection) { struct wlr_xwm *xwm = selection->xwm; if (selection == &xwm->clipboard_selection) { - struct x11_data_source *source = - calloc(1, sizeof(struct x11_data_source)); + struct x11_data_source *source = calloc(1, sizeof(*source)); if (source == NULL) { return; } @@ -421,8 +420,7 @@ static void xwm_selection_get_targets(struct wlr_xwm_selection *selection) { wlr_data_source_destroy(&source->base); } } else if (selection == &xwm->primary_selection) { - struct x11_primary_selection_source *source = - calloc(1, sizeof(struct x11_primary_selection_source)); + struct x11_primary_selection_source *source = calloc(1, sizeof(*source)); if (source == NULL) { return; } diff --git a/xwayland/selection/outgoing.c b/xwayland/selection/outgoing.c index 3e5432f0..d2d0932c 100644 --- a/xwayland/selection/outgoing.c +++ b/xwayland/selection/outgoing.c @@ -269,8 +269,7 @@ static bool xwm_selection_send_data(struct wlr_xwm_selection *selection, return false; } - struct wlr_xwm_selection_transfer *transfer = - calloc(1, sizeof(struct wlr_xwm_selection_transfer)); + struct wlr_xwm_selection_transfer *transfer = calloc(1, sizeof(*transfer)); if (transfer == NULL) { wlr_log(WLR_ERROR, "Allocation failed"); return false; diff --git a/xwayland/server.c b/xwayland/server.c index aee15002..d53f8ada 100644 --- a/xwayland/server.c +++ b/xwayland/server.c @@ -454,8 +454,7 @@ struct wlr_xwayland_server *wlr_xwayland_server_create( return NULL; } - struct wlr_xwayland_server *server = - calloc(1, sizeof(struct wlr_xwayland_server)); + struct wlr_xwayland_server *server = calloc(1, sizeof(*server)); if (!server) { return NULL; } diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index 7f3a6eae..b66dde65 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -82,7 +82,7 @@ void wlr_xwayland_destroy(struct wlr_xwayland *xwayland) { struct wlr_xwayland *wlr_xwayland_create(struct wl_display *wl_display, struct wlr_compositor *compositor, bool lazy) { - struct wlr_xwayland *xwayland = calloc(1, sizeof(struct wlr_xwayland)); + struct wlr_xwayland *xwayland = calloc(1, sizeof(*xwayland)); if (!xwayland) { return NULL; } @@ -139,7 +139,7 @@ void wlr_xwayland_set_cursor(struct wlr_xwayland *xwayland, free(xwayland->cursor); - xwayland->cursor = calloc(1, sizeof(struct wlr_xwayland_cursor)); + xwayland->cursor = calloc(1, sizeof(*xwayland->cursor)); if (xwayland->cursor == NULL) { return; } diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 0c30d8f6..17123899 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -135,8 +135,7 @@ static int xwayland_surface_handle_ping_timeout(void *data) { static struct wlr_xwayland_surface *xwayland_surface_create( struct wlr_xwm *xwm, xcb_window_t window_id, int16_t x, int16_t y, uint16_t width, uint16_t height, bool override_redirect) { - struct wlr_xwayland_surface *surface = - calloc(1, sizeof(struct wlr_xwayland_surface)); + struct wlr_xwayland_surface *surface = calloc(1, sizeof(*surface)); if (!surface) { wlr_log(WLR_ERROR, "Could not allocate wlr xwayland surface"); return NULL; @@ -681,7 +680,7 @@ static void read_surface_hints(struct wlr_xwm *xwm, } free(xsurface->hints); - xsurface->hints = calloc(1, sizeof(xcb_icccm_wm_hints_t)); + xsurface->hints = calloc(1, sizeof(*xsurface->hints)); if (xsurface->hints == NULL) { return; } @@ -704,7 +703,7 @@ static void read_surface_normal_hints(struct wlr_xwm *xwm, } free(xsurface->size_hints); - xsurface->size_hints = calloc(1, sizeof(xcb_size_hints_t)); + xsurface->size_hints = calloc(1, sizeof(*xsurface->size_hints)); if (xsurface->size_hints == NULL) { return; } @@ -777,7 +776,7 @@ static void read_surface_strut_partial(struct wlr_xwm *xwm, } free(xsurface->strut_partial); - xsurface->strut_partial = calloc(1, sizeof(xcb_ewmh_wm_strut_partial_t)); + xsurface->strut_partial = calloc(1, sizeof(*xsurface->strut_partial)); if (xsurface->strut_partial == NULL) { return; } @@ -1433,7 +1432,7 @@ static void xwm_handle_net_startup_info_message(struct wlr_xwm *xwm, start = curr->msg + curr->len; curr->len += buf_len; } else { - curr = calloc(1, sizeof(struct pending_startup_id)); + curr = calloc(1, sizeof(*curr)); if (!curr) return; curr->window = ev->window; @@ -2111,7 +2110,7 @@ void xwm_set_cursor(struct wlr_xwm *xwm, const uint8_t *pixels, uint32_t stride, } struct wlr_xwm *xwm_create(struct wlr_xwayland *xwayland, int wm_fd) { - struct wlr_xwm *xwm = calloc(1, sizeof(struct wlr_xwm)); + struct wlr_xwm *xwm = calloc(1, sizeof(*xwm)); if (xwm == NULL) { return NULL; } |