aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/src/xkb/XKBBind.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-04-27 14:10:57 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-04-27 14:10:57 +0200
commit91d9218c0cc659f40918af6ac6c035c6c48d2c6d (patch)
tree79054df1730d4723658b02cec311bc8ba7655662 /nx-X11/lib/src/xkb/XKBBind.c
parenta502149a844736dcc7f7dedd7c63229c74a448ee (diff)
parent4875a15ca61358a1c95b156b2279fce092451278 (diff)
downloadnx-libs-91d9218c0cc659f40918af6ac6c035c6c48d2c6d.tar.gz
nx-libs-91d9218c0cc659f40918af6ac6c035c6c48d2c6d.tar.bz2
nx-libs-91d9218c0cc659f40918af6ac6c035c6c48d2c6d.zip
Merge branch 'uli42-pr/update_libX11_2022' into 3.6.x
Attributes GH PR #1037: https://github.com/ArcticaProject/nx-libs/pull/1037
Diffstat (limited to 'nx-X11/lib/src/xkb/XKBBind.c')
-rw-r--r--nx-X11/lib/src/xkb/XKBBind.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/nx-X11/lib/src/xkb/XKBBind.c b/nx-X11/lib/src/xkb/XKBBind.c
index ffe5ad9d7..726f3b2cc 100644
--- a/nx-X11/lib/src/xkb/XKBBind.c
+++ b/nx-X11/lib/src/xkb/XKBBind.c
@@ -179,7 +179,7 @@ XKeysymToKeycode(Display *dpy, KeySym ks)
for (i = dpy->min_keycode; i <= dpy->max_keycode; i++) {
if (j < (int) XkbKeyNumSyms(xkb, i)) {
gotOne = 1;
- if (XkbKeySym(xkb, i, j) == ks)
+ if ((XkbKeySym(xkb, i, j) == ks))
return i;
}
}
@@ -236,7 +236,21 @@ XLookupKeysym(register XKeyEvent * event, int col)
if (_XkbUnavailable(dpy))
return _XLookupKeysym(event, col);
_XkbCheckPendingRefresh(dpy, dpy->xkb_info);
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
return XKeycodeToKeysym(dpy, event->keycode, col);
+#ifdef __clang__
+#pragma clang diagnostic pop
+#elif defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
+
}
/*
@@ -601,8 +615,8 @@ _XkbReloadDpy(Display *dpy)
}
int
-XkbTranslateKeySym(register Display *dpy,
- register KeySym *sym_rtrn,
+XkbTranslateKeySym(Display *dpy,
+ KeySym *sym_rtrn,
unsigned int mods,
char *buffer,
int nbytes,
@@ -770,7 +784,7 @@ XkbLookupKeyBinding(Display *dpy,
*extra_rtrn = (tmp - nbytes);
tmp = nbytes;
}
- memcpy(buffer, p->string, tmp);
+ memcpy(buffer, p->string, (size_t) tmp);
if (tmp < nbytes)
buffer[tmp] = '\0';
return tmp;