misc: replace all explicit zero-initializers with empty initializers

This commit is contained in:
Daniel Eklöf 2020-04-13 12:03:11 +02:00
parent d67f437458
commit c96a0b3b3c
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 15 additions and 15 deletions

View file

@ -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);

View file

@ -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) {

View file

@ -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

View file

@ -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) {

View file

@ -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