Re: [PATCH:xserver 2/2] xkb: Fix case checks for Latin 8.

2011-06-03 Thread Daniel Stone
On Tue, May 24, 2011 at 01:08:28PM +0200, Cyril Brulebois wrote:
 Spotted by -Wlogical-op:
 |   CC xkbfmisc.lo
 | xkbfmisc.c: In function '_XkbKSCheckCase':
 | xkbfmisc.c:104:3: warning: logical 'and' of mutually exclusive tests is 
 always false [-Wlogical-op]
 | xkbfmisc.c:118:3: warning: logical 'and' of mutually exclusive tests is 
 always false [-Wlogical-op]
 
 A quick look at the keysymdef.h file (from xproto) suggests the
 implementor chose to use interval checks to determine the case, but
 since lines weren't sorted by codepoints, checks were quite wrong.
 
 Implement _XkbKSUpper/_XkbKSLower checks based on a grep for
 CAPITAL/SMALL (respectively) on the Latin 8 part of the said file.
 
 Signed-off-by: Cyril Brulebois k...@debian.org

Reviewed-by: Daniel Stone dan...@fooishbar.org

I think someone noted a case statement would be nicer here, but it's
entirely consistent with the rest of the file, so either is fine by me.

Cheers,
Daniel
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH:xserver 2/2] xkb: Fix case checks for Latin 8.

2011-06-03 Thread Cyril Brulebois
Daniel Stone dan...@fooishbar.org (03/06/2011):
 Reviewed-by: Daniel Stone dan...@fooishbar.org

Thanks,

 I think someone noted a case statement would be nicer here, but it's
 entirely consistent with the rest of the file, so either is fine by
 me.

indeed, I usually try to stick to the current style (or lack thereof).

Mraw,
KiBi.


signature.asc
Description: Digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH:xserver 2/2] xkb: Fix case checks for Latin 8.

2011-05-24 Thread Cyril Brulebois
Spotted by -Wlogical-op:
|   CC xkbfmisc.lo
| xkbfmisc.c: In function '_XkbKSCheckCase':
| xkbfmisc.c:104:3: warning: logical 'and' of mutually exclusive tests is 
always false [-Wlogical-op]
| xkbfmisc.c:118:3: warning: logical 'and' of mutually exclusive tests is 
always false [-Wlogical-op]

A quick look at the keysymdef.h file (from xproto) suggests the
implementor chose to use interval checks to determine the case, but
since lines weren't sorted by codepoints, checks were quite wrong.

Implement _XkbKSUpper/_XkbKSLower checks based on a grep for
CAPITAL/SMALL (respectively) on the Latin 8 part of the said file.

Signed-off-by: Cyril Brulebois k...@debian.org
---
 xkb/xkbfmisc.c |   41 ++---
 1 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c
index dea3473..1ac9d82 100644
--- a/xkb/xkbfmisc.c
+++ b/xkb/xkbfmisc.c
@@ -99,23 +99,34 @@ unsignedset,rtrn;
}
break;
case 18:/* latin 8 */
-   if ((ks==XK_Babovedot)||
-((ks=XK_Dabovedot)(ks=XK_Wacute))||
-   ((ks=XK_Ygrave)(ks=XK_Fabovedot))||
-   (ks==XK_Mabovedot)||
-   (ks==XK_Pabovedot)||
-   (ks==XK_Sabovedot)||
-   (ks==XK_Wdiaeresis)||
-   ((ks=XK_Wcircumflex)(ks=XK_Ycircumflex))) {
+   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_Wgrave)||
+   (ks==XK_Wacute)||
+   (ks==XK_Wdiaeresis)||
+   (ks==XK_Ygrave)) {
rtrn|= _XkbKSUpper;
}
-   if ((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))) {
+   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_wgrave)||
+   (ks==XK_wacute)||
+   (ks==XK_wdiaeresis)||
+   (ks==XK_ygrave)) {
rtrn|= _XkbKSLower;
}
break;
-- 
1.7.5.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel