diff --git a/config.c b/config.c index d3bdb365..3634a701 100644 --- a/config.c +++ b/config.c @@ -506,7 +506,7 @@ verify_key_combo(const struct config *conf, const char *combo, const char *path, struct xkb_context *ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS); struct xkb_keymap *keymap = xkb_keymap_new_from_names( - ctx, &(struct xkb_rule_names){0}, XKB_KEYMAP_COMPILE_NO_FLAGS); + ctx, &(struct xkb_rule_names){}, XKB_KEYMAP_COMPILE_NO_FLAGS); bool valid_combo = input_parse_key_binding(keymap, combo, NULL); diff --git a/input.c b/input.c index 43b7d259..a6415b31 100644 --- a/input.c +++ b/input.c @@ -344,7 +344,7 @@ stop_repeater(struct wayland *wayl, uint32_t key) if (key != -1 && key != wayl->kbd.repeat.key) return true; - if (timerfd_settime(wayl->kbd.repeat.fd, 0, &(struct itimerspec){{0}}, NULL) < 0) { + if (timerfd_settime(wayl->kbd.repeat.fd, 0, &(struct itimerspec){}, NULL) < 0) { LOG_ERRNO("failed to disarm keyboard repeat timer"); return false; } @@ -615,7 +615,7 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, * Compose, and maybe emit "normal" character */ - uint8_t buf[64] = {0}; + uint8_t buf[64] = {}; int count = 0; if (compose_status == XKB_COMPOSE_COMPOSED) { diff --git a/render.c b/render.c index 84550799..df67d85b 100644 --- a/render.c +++ b/render.c @@ -38,7 +38,7 @@ static struct { size_t zero; /* commits presented in less than one frame interval */ size_t one; /* commits presented in one frame interval */ size_t two; /* commits presented in two or more frame intervals */ -} presentation_statistics = {0}; +} presentation_statistics = {}; static void fdm_hook_refresh_pending_terminals(struct fdm *fdm, void *data); @@ -853,11 +853,11 @@ get_csd_data(const struct terminal *term, enum csd_surface surf_idx) case CSD_SURF_COUNT: assert(false); - return (struct csd_data){0}; + return (struct csd_data){}; } assert(false); - return (struct csd_data){0}; + return (struct csd_data){}; } static void diff --git a/search.c b/search.c index fcc08587..547ac643 100644 --- a/search.c +++ b/search.c @@ -598,7 +598,7 @@ search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, } } - uint8_t buf[64] = {0}; + uint8_t buf[64] = {}; int count = 0; if (compose_status == XKB_COMPOSE_COMPOSED) { diff --git a/terminal.c b/terminal.c index 8c0ec60c..b2017afc 100644 --- a/terminal.c +++ b/terminal.c @@ -129,7 +129,7 @@ fdm_ptmx_out(struct fdm *fdm, int fd, int events, void *data) } #if PTMX_TIMING -static struct timespec last = {0}; +static struct timespec last = {}; #endif static bool @@ -325,7 +325,7 @@ fdm_blink(struct fdm *fdm, int fd, int events, void *data) term->blink.active = false; term->blink.state = BLINK_ON; - static const struct itimerspec disarm = {{0}}; + static const struct itimerspec disarm = {}; if (timerfd_settime(term->blink.fd, 0, &disarm, NULL) < 0) LOG_ERRNO("failed to disarm blink timer"); } else @@ -423,11 +423,11 @@ fdm_delayed_render(struct fdm *fdm, int fd, int events, void *data) return true; #if PTMX_TIMING - last = (struct timespec){0}; + last = (struct timespec){}; #endif /* Reset timers */ - struct itimerspec reset = {{0}}; + struct itimerspec reset = {}; timerfd_settime(term->delayed_render_timer.lower_fd, 0, &reset, NULL); timerfd_settime(term->delayed_render_timer.upper_fd, 0, &reset, NULL); term->delayed_render_timer.is_armed = false; @@ -1502,7 +1502,7 @@ cursor_blink_start_timer(struct terminal *term) static bool cursor_blink_stop_timer(struct terminal *term) { - return timerfd_settime(term->cursor_blink.fd, 0, &(struct itimerspec){{0}}, NULL) == 0; + return timerfd_settime(term->cursor_blink.fd, 0, &(struct itimerspec){}, NULL) == 0; } void @@ -2069,10 +2069,10 @@ term_enable_app_sync_updates(struct terminal *term) /* Disarm delayed rendering timers */ timerfd_settime( term->delayed_render_timer.lower_fd, 0, - &(struct itimerspec){{0}}, NULL); + &(struct itimerspec){}, NULL); timerfd_settime( term->delayed_render_timer.upper_fd, 0, - &(struct itimerspec){{0}}, NULL); + &(struct itimerspec){}, NULL); term->delayed_render_timer.is_armed = false; } @@ -2089,7 +2089,7 @@ term_disable_app_sync_updates(struct terminal *term) /* Reset timers */ timerfd_settime( term->render.app_sync_updates.timer_fd, 0, - &(struct itimerspec){{0}}, NULL); + &(struct itimerspec){}, NULL); } static inline void