aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorfalkTX <falktx@falktx.com>2023-10-21 13:33:25 +0200
committerDavid Robillard <d@drobilla.net>2023-10-21 10:44:58 -0400
commit0fed0b5f864cf70e2ed3a82236fd81554f52948e (patch)
tree73d25e527a21d39f872963e1e9dff3a6103cd7ec /src
parenta7803c92f144221edba9a966eb664da8049ce7bf (diff)
downloadpugl-0fed0b5f864cf70e2ed3a82236fd81554f52948e.tar.gz
pugl-0fed0b5f864cf70e2ed3a82236fd81554f52948e.tar.bz2
pugl-0fed0b5f864cf70e2ed3a82236fd81554f52948e.zip
X11: Use PUGL_INIT_STRUCT to initialize char arrays
Diffstat (limited to 'src')
-rw-r--r--src/x11.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/x11.c b/src/x11.c
index 07642fc..2de7d1c 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -665,7 +665,7 @@ puglRealize(PuglView* const view)
updateSizeHints(view);
// Set PID and hostname so the window manager can access our process
- char hostname[256] = {0};
+ char hostname[256] = PUGL_INIT_STRUCT;
const long pid = (long)getpid();
if (pid > 0 && !gethostname(hostname, sizeof(hostname))) {
hostname[sizeof(hostname) - 1] = '\0';
@@ -884,7 +884,7 @@ translateKey(PuglView* const view, XEvent* const xevent, PuglEvent* const event)
xevent->xkey.state = xevent->xkey.state & ~(unsigned)(ControlMask|ShiftMask);
// Lookup unshifted key
- char ustr[8] = {0};
+ char ustr[8] = PUGL_INIT_STRUCT;
KeySym sym = 0;
const int ufound = XLookupString(&xevent->xkey, ustr, 8, &sym, NULL);
const PuglKey special = keySymToSpecial(sym);
@@ -899,7 +899,7 @@ translateKey(PuglView* const view, XEvent* const xevent, PuglEvent* const event)
// Lookup shifted key for possible text event
xevent->xkey.state = state;
- char sstr[8] = {0};
+ char sstr[8] = PUGL_INIT_STRUCT;
const int sfound = lookupString(view->impl->xic, xevent, sstr, &sym);
if (sfound > 0) {
// Dispatch key event now