Fix latin8 upper/lower case check GCC complained: misc.c:235:13: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op] misc.c:248:13: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op] Looking at keysymdef.h shows that the check is indeed wrong. This commit updates the check to match the latin8 section of keysymdef exactly. Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/src/misc.c b/src/misc.c
index 8e49e02..03ffeb7 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -230,22 +230,29 @@ _XkbcKSCheckCase(xkb_keysym_t ks)
rtrn |= _XkbKSLower;
break;
case 18: /* latin 8 */
- if ((ks == XK_Babovedot) ||
- (ks >= XK_Dabovedot && ks <= XK_Wacute) ||
- (ks >= XK_Ygrave && ks <= XK_Fabovedot) ||
+ if ((ks == XK_Wcircumflex) ||
+ (ks == XK_Ycircumflex) ||
+ (ks == XK_Babovedot) ||
+ (ks == XK_Dabovedot) ||
+ (ks == XK_Fabovedot) ||
(ks == XK_Mabovedot) ||
(ks == XK_Pabovedot) ||
(ks == XK_Sabovedot) ||
+ (ks == XK_Tabovedot) ||
(ks == XK_Wdiaeresis) ||
- (ks >= XK_Wcircumflex && ks <= XK_Ycircumflex))
+ (ks == XK_Ygrave))
rtrn |= _XkbKSUpper;
- if ((ks == XK_babovedot) ||
+ if ((ks == XK_wcircumflex) ||
+ (ks == XK_ycircumflex) ||
+ (ks == XK_babovedot) ||
(ks == XK_dabovedot) ||
(ks == XK_fabovedot) ||
(ks == XK_mabovedot) ||
- (ks >= XK_wgrave && ks <= XK_wacute) ||
- (ks == XK_ygrave) ||
- (ks >= XK_wdiaeresis && ks <= XK_ycircumflex))
+ (ks == XK_pabovedot) ||
+ (ks == XK_sabovedot) ||
+ (ks == XK_tabovedot) ||
+ (ks == XK_wdiaeresis) ||
+ (ks == XK_ygrave))
rtrn |= _XkbKSLower;
break;
case 19: /* latin 9 */