mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
Use struct initializers instead of memset()
This is a bit more type-safe.
This commit is contained in:
parent
4966857f21
commit
7a9f8d8d6b
34 changed files with 134 additions and 113 deletions
|
|
@ -34,9 +34,10 @@ void xwm_selection_transfer_destroy_property_reply(
|
|||
|
||||
void xwm_selection_transfer_init(struct wlr_xwm_selection_transfer *transfer,
|
||||
struct wlr_xwm_selection *selection) {
|
||||
memset(transfer, 0, sizeof(*transfer));
|
||||
transfer->selection = selection;
|
||||
transfer->wl_client_fd = -1;
|
||||
*transfer = (struct wlr_xwm_selection_transfer){
|
||||
.selection = selection,
|
||||
.wl_client_fd = -1,
|
||||
};
|
||||
}
|
||||
|
||||
void xwm_selection_transfer_destroy(
|
||||
|
|
@ -175,14 +176,14 @@ int xwm_handle_selection_event(struct wlr_xwm *xwm,
|
|||
|
||||
void xwm_selection_init(struct wlr_xwm_selection *selection,
|
||||
struct wlr_xwm *xwm, xcb_atom_t atom) {
|
||||
memset(selection, 0, sizeof(*selection));
|
||||
*selection = (struct wlr_xwm_selection){
|
||||
.xwm = xwm,
|
||||
.atom = atom,
|
||||
.window = xcb_generate_id(xwm->xcb_conn),
|
||||
};
|
||||
wl_list_init(&selection->incoming);
|
||||
wl_list_init(&selection->outgoing);
|
||||
|
||||
selection->xwm = xwm;
|
||||
selection->atom = atom;
|
||||
selection->window = xcb_generate_id(xwm->xcb_conn);
|
||||
|
||||
if (atom == xwm->atoms[DND_SELECTION]) {
|
||||
xcb_create_window(
|
||||
xwm->xcb_conn,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue