mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
Zero-initialize structs in init functions
Ensures there is no field left to its previous undefined value after calling an init function.
This commit is contained in:
parent
54653b5d95
commit
6c350799b2
20 changed files with 29 additions and 1 deletions
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
void wlr_backend_init(struct wlr_backend *backend,
|
||||
const struct wlr_backend_impl *impl) {
|
||||
assert(backend);
|
||||
memset(backend, 0, sizeof(*backend));
|
||||
backend->impl = impl;
|
||||
wl_signal_init(&backend->events.destroy);
|
||||
wl_signal_init(&backend->events.new_input);
|
||||
|
|
|
|||
|
|
@ -380,6 +380,7 @@ static bool drm_crtc_page_flip(struct wlr_drm_connector *conn,
|
|||
static void drm_connector_state_init(struct wlr_drm_connector_state *state,
|
||||
struct wlr_drm_connector *conn,
|
||||
const struct wlr_output_state *base) {
|
||||
memset(state, 0, sizeof(*state));
|
||||
state->base = base;
|
||||
state->modeset = base->committed &
|
||||
(WLR_OUTPUT_STATE_ENABLED | WLR_OUTPUT_STATE_MODE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue