mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-07 04:34:03 -05:00
misc: replace all explicit zero-initializers with empty initializers
This commit is contained in:
parent
d67f437458
commit
c96a0b3b3c
5 changed files with 15 additions and 15 deletions
2
config.c
2
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_context *ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||||
struct xkb_keymap *keymap = xkb_keymap_new_from_names(
|
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);
|
bool valid_combo = input_parse_key_binding(keymap, combo, NULL);
|
||||||
|
|
||||||
|
|
|
||||||
4
input.c
4
input.c
|
|
@ -344,7 +344,7 @@ stop_repeater(struct wayland *wayl, uint32_t key)
|
||||||
if (key != -1 && key != wayl->kbd.repeat.key)
|
if (key != -1 && key != wayl->kbd.repeat.key)
|
||||||
return true;
|
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");
|
LOG_ERRNO("failed to disarm keyboard repeat timer");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -615,7 +615,7 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial,
|
||||||
* Compose, and maybe emit "normal" character
|
* Compose, and maybe emit "normal" character
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint8_t buf[64] = {0};
|
uint8_t buf[64] = {};
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (compose_status == XKB_COMPOSE_COMPOSED) {
|
if (compose_status == XKB_COMPOSE_COMPOSED) {
|
||||||
|
|
|
||||||
6
render.c
6
render.c
|
|
@ -38,7 +38,7 @@ static struct {
|
||||||
size_t zero; /* commits presented in less than one frame interval */
|
size_t zero; /* commits presented in less than one frame interval */
|
||||||
size_t one; /* commits presented in one frame interval */
|
size_t one; /* commits presented in one frame interval */
|
||||||
size_t two; /* commits presented in two or more frame intervals */
|
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);
|
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:
|
case CSD_SURF_COUNT:
|
||||||
assert(false);
|
assert(false);
|
||||||
return (struct csd_data){0};
|
return (struct csd_data){};
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(false);
|
assert(false);
|
||||||
return (struct csd_data){0};
|
return (struct csd_data){};
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
2
search.c
2
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;
|
int count = 0;
|
||||||
|
|
||||||
if (compose_status == XKB_COMPOSE_COMPOSED) {
|
if (compose_status == XKB_COMPOSE_COMPOSED) {
|
||||||
|
|
|
||||||
16
terminal.c
16
terminal.c
|
|
@ -129,7 +129,7 @@ fdm_ptmx_out(struct fdm *fdm, int fd, int events, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if PTMX_TIMING
|
#if PTMX_TIMING
|
||||||
static struct timespec last = {0};
|
static struct timespec last = {};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|
@ -325,7 +325,7 @@ fdm_blink(struct fdm *fdm, int fd, int events, void *data)
|
||||||
term->blink.active = false;
|
term->blink.active = false;
|
||||||
term->blink.state = BLINK_ON;
|
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)
|
if (timerfd_settime(term->blink.fd, 0, &disarm, NULL) < 0)
|
||||||
LOG_ERRNO("failed to disarm blink timer");
|
LOG_ERRNO("failed to disarm blink timer");
|
||||||
} else
|
} else
|
||||||
|
|
@ -423,11 +423,11 @@ fdm_delayed_render(struct fdm *fdm, int fd, int events, void *data)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
#if PTMX_TIMING
|
#if PTMX_TIMING
|
||||||
last = (struct timespec){0};
|
last = (struct timespec){};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Reset timers */
|
/* 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.lower_fd, 0, &reset, NULL);
|
||||||
timerfd_settime(term->delayed_render_timer.upper_fd, 0, &reset, NULL);
|
timerfd_settime(term->delayed_render_timer.upper_fd, 0, &reset, NULL);
|
||||||
term->delayed_render_timer.is_armed = false;
|
term->delayed_render_timer.is_armed = false;
|
||||||
|
|
@ -1502,7 +1502,7 @@ cursor_blink_start_timer(struct terminal *term)
|
||||||
static bool
|
static bool
|
||||||
cursor_blink_stop_timer(struct terminal *term)
|
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
|
void
|
||||||
|
|
@ -2069,10 +2069,10 @@ term_enable_app_sync_updates(struct terminal *term)
|
||||||
/* Disarm delayed rendering timers */
|
/* Disarm delayed rendering timers */
|
||||||
timerfd_settime(
|
timerfd_settime(
|
||||||
term->delayed_render_timer.lower_fd, 0,
|
term->delayed_render_timer.lower_fd, 0,
|
||||||
&(struct itimerspec){{0}}, NULL);
|
&(struct itimerspec){}, NULL);
|
||||||
timerfd_settime(
|
timerfd_settime(
|
||||||
term->delayed_render_timer.upper_fd, 0,
|
term->delayed_render_timer.upper_fd, 0,
|
||||||
&(struct itimerspec){{0}}, NULL);
|
&(struct itimerspec){}, NULL);
|
||||||
term->delayed_render_timer.is_armed = false;
|
term->delayed_render_timer.is_armed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2089,7 +2089,7 @@ term_disable_app_sync_updates(struct terminal *term)
|
||||||
/* Reset timers */
|
/* Reset timers */
|
||||||
timerfd_settime(
|
timerfd_settime(
|
||||||
term->render.app_sync_updates.timer_fd, 0,
|
term->render.app_sync_updates.timer_fd, 0,
|
||||||
&(struct itimerspec){{0}}, NULL);
|
&(struct itimerspec){}, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue