From d67f437458ed96b55d475a471d1a16da52ca4cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 13 Apr 2020 11:58:38 +0200 Subject: [PATCH] mbstate: fix compile warning on systems where mbstate_t isn't an integral An empty initializer still ensures the entire object is zero-initialized. --- input.c | 2 +- search.c | 2 +- vt.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/input.c b/input.c index 8b18d168..43b7d259 100644 --- a/input.c +++ b/input.c @@ -695,7 +695,7 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, const wchar_t wc = 0x80 | buf[0]; char utf8[8]; - mbstate_t ps = {0}; + mbstate_t ps = {}; size_t chars = wcrtomb(utf8, wc, &ps); if (chars != (size_t)-1) diff --git a/search.c b/search.c index 9304ab48..fcc08587 100644 --- a/search.c +++ b/search.c @@ -613,7 +613,7 @@ search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, } const char *src = (const char *)buf; - mbstate_t ps = {0}; + mbstate_t ps = {}; size_t wchars = mbsnrtowcs(NULL, &src, count, 0, &ps); if (wchars == -1) { diff --git a/vt.c b/vt.c index 12bc1245..409f9645 100644 --- a/vt.c +++ b/vt.c @@ -536,7 +536,7 @@ static void action_utf8_print(struct terminal *term, uint8_t c) { /* Convert to wchar */ - mbstate_t ps = {0}; + mbstate_t ps = {}; wchar_t wc; size_t count = mbrtowc( &wc, (const char *)term->vt.utf8.data, term->vt.utf8.idx, &ps);