Re: Failure in detecting keyboard

2010-02-02 Thread Amey
On Mon, Feb 1, 2010 at 9:02 AM, Dan Nicholson  wrote:

> On Sun, Jan 31, 2010 at 4:58 PM, Peter Hutterer
>  wrote:
> > On Sat, Jan 30, 2010 at 09:17:12AM +0530, Amey wrote:
> >> Hello all,
> >>I am a final year graduate student and I am trying to
> >> configure X server.In that when I tried to run X server after all the
> >> configuration done with following commands:
> >>
> >> *1) sudo /etc/init.d/gdm stop
> >> 2) sudo startx -- /opt/mpx/bin/Xorg verbose :0   (P.S. I installed all
> the
> >> packages with prefix /opt/mpx )
> >> *
> >> then X server didn't run initialy  and I got the following log:
> >>
> >> (II) AIGLX: Loaded and initialized /opt/mpx/lib/dri/swrast_dri.so
> >> (II) GLX: Initialized DRISWRAST GL provider for screen 0
> >> (II) NV(0): Setting screen physical size to 338 x 211
> >> (EE) Error compiling keymap (server-0)
> >> (EE) XKB: Couldn't compile keymap
> >> XKB: Failed to compile keymap
> >> Keyboard initialization failed. This could be a missing or incorrect
> setup
> >> of xkeyboard-config.
> >
> > This is often the case if /opt/mpx/share/X11/xkb/compiled/ doesn't exist
> or
> > isn't writable. Check for that too.
> >
> >> For above error  I configured xkeyboard-config package with prefix
> /opt/mpx/
> >> and again tried to run X server with above sequence of  commands.But
> still
> >> error was there. So checked for "xkbcomp" in /opt/mpx then found it
> here:
> >>
> >> /opt/mpx/share/X11/xkb
> >
> > this is weird, xkbcomp should not be in this directory. Please
> reconfigure
> > with the right prefix and reinstall instead of the symlink.
> > that aside - is there any reason you disable hotplugging?
>
> This comes from some dubious behavior in xkeyboard-config. It creates
> a symlink to xkbcomp in the xkb base directory unless you pass a
> --disable-xkbcomp-symlink or something like that.
>
> Amey, just build xkbcomp with --prefix=/opt/mpx and make sure it uses
> a base path of /opt/mpx/share/X11/xkb so it will pick up your config
> files. There should be a configure option if it doesn't just follow
> --prefix by default.
>
>
Thanks Dan, It worked by configuring xkbcomp package by
following the instructions you told.
But still I have one more problem which is of reattaching the master pointer
to plugged mouse i.e. slave device.
When I used *'list'* option of *xinput* command it shows some 2
virtual core pointers and one master ( that I created earlier by
'create-master' option ) .For that I had configured *lib-hal-dev* package
from synaptics and also checked for *dbus* package so it ws already there so
didn't install again.But still when I plug in an usb mouse its not getting
recognised when I checked using 'list' option of xinput command.

P.S. I have configured X server on ubuntu interpid-ibex.



> --
> Dan
>



-- 
Thanks,
Amey.
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: "empty" model/layout for xkb

2010-02-02 Thread Peter Hutterer
On Tue, Jan 26, 2010 at 12:36:55PM -0800, Jeremy Huddleston wrote:
> I'm trying to modify xkeyboard-config to create an "empty" xbk rules set.
> This way, we can set "empty" as the default in XQuartz and have a clean
> slate.
> 
> I'm having a bit of trouble getting this to work.  Firstly, I can't seem
> to figure out how to NOT set the +aliases(qwerty) variant on the keycodes.
> Secondly, it doesn't seem to recognize my empty symbols file.
> 
> Can someone fill me in on what I'm missing?

the evdev rules file is combined from the base* as well (look at the
Makefile.am). So for the +aliases to disappear you need to add it to
base.l_k.part.

that's the only thing I can spot immediately. I take it the rules file is
composed correctly and the resulting files in /usr/share/X11/xkb (or
whatever prefix) look alright?

Cheers,
  Peter
> 
> diff --git a/keycodes/Makefile.am b/keycodes/Makefile.am
> index c289e14..68c9a54 100644
> --- a/keycodes/Makefile.am
> +++ b/keycodes/Makefile.am
> @@ -6,6 +6,7 @@ dist_keycodes_DATA = \
>  aliases \
>  amiga \
>  ataritt \
> +empty \
>  evdev \
>  fujitsu \
>  hp \
> diff --git a/keycodes/empty b/keycodes/empty
> new file mode 100644
> index 000..eedc943
> --- /dev/null
> +++ b/keycodes/empty
> @@ -0,0 +1,4 @@
> +default xkb_keycodes "empty" {
> +minimum= 8;
> +maximum= 255;
> +};
> diff --git a/rules/base.m_k.part b/rules/base.m_k.part
> index dd0c391..6d5eda0 100644
> --- a/rules/base.m_k.part
> +++ b/rules/base.m_k.part
> @@ -1,5 +1,6 @@
>amiga  =   amiga(de)
>ataritt=   ataritt(de)
> +  empty =   empty
>sun4   =   sun(type4_euro)
>sun5   =   sun(type5_euro)
>sun6   =   sun(type6_usb)
> diff --git a/rules/base.ml_s.part b/rules/base.ml_s.part
> index 1c16b6b..31e5d33 100644
> --- a/rules/base.ml_s.part
> +++ b/rules/base.ml_s.part
> @@ -3,6 +3,8 @@
>amiga  $nonlatin   =   
> xfree68_vndr/amiga(usa1)+%l%(v):2
>amiga  *   =   
> xfree68_vndr/amiga(usa1)+%l%(v)
>classmate  us  =   pc+%l(classmate)
> +  empty *   =   empty
> +  * empty   =   empty
>sun4   $nonlatin   =   
> latin+sun_vndr/us(type4)+%l%(v):2
>sun4   *   =   
> latin+sun_vndr/us(type4)+%l%(v)
>sun5   $nonlatin   =   
> latin+sun_vndr/us(type5)+%l%(v):2
> diff --git a/symbols/Makefile.am b/symbols/Makefile.am
> index d22d6c3..7724984 100644
> --- a/symbols/Makefile.am
> +++ b/symbols/Makefile.am
> @@ -30,7 +30,7 @@ terminate \
>  tj tm tr \
>  ua us uz vn \
>  za \
> -altwin capslock compose ctrl eurosign group inet \
> +altwin capslock compose ctrl empty eurosign group inet \
>  keypad kpdl level3 level5 nbsp olpc shift srvr_ctrl typo
>  
>  dir_data = $(dist_symbols_DATA)
> diff --git a/symbols/empty b/symbols/empty
> new file mode 100644
> index 000..72eb127
> --- /dev/null
> +++ b/symbols/empty
> @@ -0,0 +1,6 @@
> +// $XKeyboardConfig$
> +
> +default
> +xkb_symbols "basic" {
> +name[Group1]= "Empty";
> +};
> 
> 
> In my DDX, I'm doing this to set the rules:
> 
> +XkbRMLVOSet rmlvo = { .rules = "base", .model = "empty", .layout = 
> "empty",
> +  .variant = NULL, .options = NULL };
> +/* We need to really have rules... or something... */
> +XkbSetRulesDflts(&rmlvo);
> 
> These changes result in:
> 
> xkb_keymap {
> xkb_keycodes "empty+aliases(qwerty)" {
> minimum = 8;
> maximum = 255;
> virtual indicator 1 = "Caps Lock";
> virtual indicator 2 = "Num Lock";
> virtual indicator 3 = "Shift Lock";
> virtual indicator 4 = "Group 2";
> virtual indicator 5 = "Mouse Keys";
> virtual indicator 6 = "Scroll Lock";
> };
> 
> xkb_types "complete" {
> ...
> };
> 
> xkb_compatibility "complete" {
> ...
> }
> 
> xkb_symbols "unknown" {
> 
> key <> {
> symbols[Group1]= [   a,   A ],
> symbols[Group2]= [   aring,   Aring ]
> };
> modifier_map Mod2 { <> };
> modifier_map Shift { <> };
> modifier_map Lock { <> };
> modifier_map Mod1 { <> };
> modifier_map Control { <> };
> modifier_map Shift { <> };
> modifier_map Mod1 { <> };
> modifier_map Control { <> };
> modifier_map Mod2 { <> };
> };
> 
> };
> 

___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: Failure in detecting keyboard

2010-02-02 Thread Dan Nicholson
On Tue, Feb 2, 2010 at 12:26 AM, Amey  wrote:
>
> On Mon, Feb 1, 2010 at 9:02 AM, Dan Nicholson  wrote:
>>
>> On Sun, Jan 31, 2010 at 4:58 PM, Peter Hutterer
>>  wrote:
>> > On Sat, Jan 30, 2010 at 09:17:12AM +0530, Amey wrote:
>> >> Hello all,
>> >>                I am a final year graduate student and I am trying to
>> >> configure X server.In that when I tried to run X server after all the
>> >> configuration done with following commands:
>> >>
>> >> *1) sudo /etc/init.d/gdm stop
>> >> 2) sudo startx -- /opt/mpx/bin/Xorg verbose :0   (P.S. I installed all
>> >> the
>> >> packages with prefix /opt/mpx )
>> >> *
>> >> then X server didn't run initialy  and I got the following log:
>> >>
>> >> (II) AIGLX: Loaded and initialized /opt/mpx/lib/dri/swrast_dri.so
>> >> (II) GLX: Initialized DRISWRAST GL provider for screen 0
>> >> (II) NV(0): Setting screen physical size to 338 x 211
>> >> (EE) Error compiling keymap (server-0)
>> >> (EE) XKB: Couldn't compile keymap
>> >> XKB: Failed to compile keymap
>> >> Keyboard initialization failed. This could be a missing or incorrect
>> >> setup
>> >> of xkeyboard-config.
>> >
>> > This is often the case if /opt/mpx/share/X11/xkb/compiled/ doesn't exist
>> > or
>> > isn't writable. Check for that too.
>> >
>> >> For above error  I configured xkeyboard-config package with prefix
>> >> /opt/mpx/
>> >> and again tried to run X server with above sequence of  commands.But
>> >> still
>> >> error was there. So checked for "xkbcomp" in /opt/mpx then found it
>> >> here:
>> >>
>> >> /opt/mpx/share/X11/xkb
>> >
>> > this is weird, xkbcomp should not be in this directory. Please
>> > reconfigure
>> > with the right prefix and reinstall instead of the symlink.
>> > that aside - is there any reason you disable hotplugging?
>>
>> This comes from some dubious behavior in xkeyboard-config. It creates
>> a symlink to xkbcomp in the xkb base directory unless you pass a
>> --disable-xkbcomp-symlink or something like that.
>>
>> Amey, just build xkbcomp with --prefix=/opt/mpx and make sure it uses
>> a base path of /opt/mpx/share/X11/xkb so it will pick up your config
>> files. There should be a configure option if it doesn't just follow
>> --prefix by default.
>>
>
>     Thanks Dan, It worked by configuring xkbcomp package by
> following the instructions you told.
> But still I have one more problem which is of reattaching the master pointer
> to plugged mouse i.e. slave device.
>     When I used 'list' option of xinput command it shows some 2
> virtual core pointers and one master ( that I created earlier by
> 'create-master' option ) .For that I had configured lib-hal-dev package from
> synaptics and also checked for dbus package so it ws already there so didn't
> install again.But still when I plug in an usb mouse its not getting
> recognised when I checked using 'list' option of xinput command.
>
> P.S. I have configured X server on ubuntu interpid-ibex.

Possibly the server was not built with hal support for hotplugging. If
you attach a Xorg.0.log, it should shed some light.

--
Dan
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: "empty" model/layout for xkb

2010-02-02 Thread Dan Nicholson
On Tue, Jan 26, 2010 at 12:36 PM, Jeremy Huddleston
 wrote:
> I'm trying to modify xkeyboard-config to create an "empty" xbk rules set.  
> This way, we can set "empty" as the default in XQuartz and have a clean slate.
>
> I'm having a bit of trouble getting this to work.  Firstly, I can't seem to 
> figure out how to NOT set the +aliases(qwerty) variant on the keycodes.  
> Secondly, it doesn't seem to recognize my empty symbols file.
>
> Can someone fill me in on what I'm missing?

I was guessing the same as Peter where base was adding the aliases for
all fallbacks, but it looks like you're trying to handle that. Sergey,
do you have any ideas with the xkb-config changes below?

--
Dan

>
> Thanks,
> Jeremy
>
>
> diff --git a/keycodes/Makefile.am b/keycodes/Makefile.am
> index c289e14..68c9a54 100644
> --- a/keycodes/Makefile.am
> +++ b/keycodes/Makefile.am
> @@ -6,6 +6,7 @@ dist_keycodes_DATA = \
>  aliases \
>  amiga \
>  ataritt \
> +empty \
>  evdev \
>  fujitsu \
>  hp \
> diff --git a/keycodes/empty b/keycodes/empty
> new file mode 100644
> index 000..eedc943
> --- /dev/null
> +++ b/keycodes/empty
> @@ -0,0 +1,4 @@
> +default xkb_keycodes "empty" {
> +    minimum= 8;
> +    maximum= 255;
> +};
> diff --git a/rules/base.m_k.part b/rules/base.m_k.part
> index dd0c391..6d5eda0 100644
> --- a/rules/base.m_k.part
> +++ b/rules/base.m_k.part
> @@ -1,5 +1,6 @@
>   amiga                =       amiga(de)
>   ataritt      =       ataritt(de)
> +  empty         =       empty
>   sun4         =       sun(type4_euro)
>   sun5         =       sun(type5_euro)
>   sun6         =       sun(type6_usb)
> diff --git a/rules/base.ml_s.part b/rules/base.ml_s.part
> index 1c16b6b..31e5d33 100644
> --- a/rules/base.ml_s.part
> +++ b/rules/base.ml_s.part
> @@ -3,6 +3,8 @@
>   amiga                $nonlatin               =       
> xfree68_vndr/amiga(usa1)+%l%(v):2
>   amiga                *                       =       
> xfree68_vndr/amiga(usa1)+%l%(v)
>   classmate    us                      =       pc+%l(classmate)
> +  empty         *                       =       empty
> +  *             empty                   =       empty
>   sun4         $nonlatin               =       
> latin+sun_vndr/us(type4)+%l%(v):2
>   sun4         *                       =       latin+sun_vndr/us(type4)+%l%(v)
>   sun5         $nonlatin               =       
> latin+sun_vndr/us(type5)+%l%(v):2
> diff --git a/symbols/Makefile.am b/symbols/Makefile.am
> index d22d6c3..7724984 100644
> --- a/symbols/Makefile.am
> +++ b/symbols/Makefile.am
> @@ -30,7 +30,7 @@ terminate \
>  tj tm tr \
>  ua us uz vn \
>  za \
> -altwin capslock compose ctrl eurosign group inet \
> +altwin capslock compose ctrl empty eurosign group inet \
>  keypad kpdl level3 level5 nbsp olpc shift srvr_ctrl typo
>
>  dir_data = $(dist_symbols_DATA)
> diff --git a/symbols/empty b/symbols/empty
> new file mode 100644
> index 000..72eb127
> --- /dev/null
> +++ b/symbols/empty
> @@ -0,0 +1,6 @@
> +// $XKeyboardConfig$
> +
> +default
> +xkb_symbols "basic" {
> +    name[Group1]= "Empty";
> +};
>
>
> In my DDX, I'm doing this to set the rules:
>
> +    XkbRMLVOSet rmlvo = { .rules = "base", .model = "empty", .layout = 
> "empty",
> +                          .variant = NULL, .options = NULL };
> +    /* We need to really have rules... or something... */
> +    XkbSetRulesDflts(&rmlvo);
>
> These changes result in:
>
> xkb_keymap {
> xkb_keycodes "empty+aliases(qwerty)" {
>    minimum = 8;
>    maximum = 255;
>    virtual indicator 1 = "Caps Lock";
>    virtual indicator 2 = "Num Lock";
>    virtual indicator 3 = "Shift Lock";
>    virtual indicator 4 = "Group 2";
>    virtual indicator 5 = "Mouse Keys";
>    virtual indicator 6 = "Scroll Lock";
> };
>
> xkb_types "complete" {
> ...
> };
>
> xkb_compatibility "complete" {
> ...
> }
>
> xkb_symbols "unknown" {
>
>    key     <> {
>        symbols[Group1]= [               a,               A ],
>        symbols[Group2]= [           aring,           Aring ]
>    };
>    modifier_map Mod2 { <> };
>    modifier_map Shift { <> };
>    modifier_map Lock { <> };
>    modifier_map Mod1 { <> };
>    modifier_map Control { <> };
>    modifier_map Shift { <> };
>    modifier_map Mod1 { <> };
>    modifier_map Control { <> };
>    modifier_map Mod2 { <> };
> };
>
> };
>
>
> ___
> xorg-devel mailing list
> xorg-devel@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-devel
>
>
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: "empty" model/layout for xkb

2010-02-02 Thread Dan Nicholson
On Tue, Feb 2, 2010 at 6:09 AM, Sergey Udaltsov
 wrote:
> Dan
>
> Well, these changes look a bit odd, but ok, let's have them. Could you
> please create a bug in bugzilla and attach your patch there. Just for
> accountability sake.

I think Jeremy was more asking why they weren't working as expected.
He still gets aliases set in the variant even though he's trying to
disable that.

--
Dan

>
> Thanks,
>
> Sergey
>
> On Tue, Feb 2, 2010 at 2:06 PM, Dan Nicholson  wrote:
>> On Tue, Jan 26, 2010 at 12:36 PM, Jeremy Huddleston
>>  wrote:
>>> I'm trying to modify xkeyboard-config to create an "empty" xbk rules set.  
>>> This way, we can set "empty" as the default in XQuartz and have a clean 
>>> slate.
>>>
>>> I'm having a bit of trouble getting this to work.  Firstly, I can't seem to 
>>> figure out how to NOT set the +aliases(qwerty) variant on the keycodes.  
>>> Secondly, it doesn't seem to recognize my empty symbols file.
>>>
>>> Can someone fill me in on what I'm missing?
>>
>> I was guessing the same as Peter where base was adding the aliases for
>> all fallbacks, but it looks like you're trying to handle that. Sergey,
>> do you have any ideas with the xkb-config changes below?
>>
>> --
>> Dan
>>
>>>
>>> Thanks,
>>> Jeremy
>>>
>>>
>>> diff --git a/keycodes/Makefile.am b/keycodes/Makefile.am
>>> index c289e14..68c9a54 100644
>>> --- a/keycodes/Makefile.am
>>> +++ b/keycodes/Makefile.am
>>> @@ -6,6 +6,7 @@ dist_keycodes_DATA = \
>>>  aliases \
>>>  amiga \
>>>  ataritt \
>>> +empty \
>>>  evdev \
>>>  fujitsu \
>>>  hp \
>>> diff --git a/keycodes/empty b/keycodes/empty
>>> new file mode 100644
>>> index 000..eedc943
>>> --- /dev/null
>>> +++ b/keycodes/empty
>>> @@ -0,0 +1,4 @@
>>> +default xkb_keycodes "empty" {
>>> +    minimum= 8;
>>> +    maximum= 255;
>>> +};
>>> diff --git a/rules/base.m_k.part b/rules/base.m_k.part
>>> index dd0c391..6d5eda0 100644
>>> --- a/rules/base.m_k.part
>>> +++ b/rules/base.m_k.part
>>> @@ -1,5 +1,6 @@
>>>   amiga                =       amiga(de)
>>>   ataritt      =       ataritt(de)
>>> +  empty         =       empty
>>>   sun4         =       sun(type4_euro)
>>>   sun5         =       sun(type5_euro)
>>>   sun6         =       sun(type6_usb)
>>> diff --git a/rules/base.ml_s.part b/rules/base.ml_s.part
>>> index 1c16b6b..31e5d33 100644
>>> --- a/rules/base.ml_s.part
>>> +++ b/rules/base.ml_s.part
>>> @@ -3,6 +3,8 @@
>>>   amiga                $nonlatin               =       
>>> xfree68_vndr/amiga(usa1)+%l%(v):2
>>>   amiga                *                       =       
>>> xfree68_vndr/amiga(usa1)+%l%(v)
>>>   classmate    us                      =       pc+%l(classmate)
>>> +  empty         *                       =       empty
>>> +  *             empty                   =       empty
>>>   sun4         $nonlatin               =       
>>> latin+sun_vndr/us(type4)+%l%(v):2
>>>   sun4         *                       =       
>>> latin+sun_vndr/us(type4)+%l%(v)
>>>   sun5         $nonlatin               =       
>>> latin+sun_vndr/us(type5)+%l%(v):2
>>> diff --git a/symbols/Makefile.am b/symbols/Makefile.am
>>> index d22d6c3..7724984 100644
>>> --- a/symbols/Makefile.am
>>> +++ b/symbols/Makefile.am
>>> @@ -30,7 +30,7 @@ terminate \
>>>  tj tm tr \
>>>  ua us uz vn \
>>>  za \
>>> -altwin capslock compose ctrl eurosign group inet \
>>> +altwin capslock compose ctrl empty eurosign group inet \
>>>  keypad kpdl level3 level5 nbsp olpc shift srvr_ctrl typo
>>>
>>>  dir_data = $(dist_symbols_DATA)
>>> diff --git a/symbols/empty b/symbols/empty
>>> new file mode 100644
>>> index 000..72eb127
>>> --- /dev/null
>>> +++ b/symbols/empty
>>> @@ -0,0 +1,6 @@
>>> +// $XKeyboardConfig$
>>> +
>>> +default
>>> +xkb_symbols "basic" {
>>> +    name[Group1]= "Empty";
>>> +};
>>>
>>>
>>> In my DDX, I'm doing this to set the rules:
>>>
>>> +    XkbRMLVOSet rmlvo = { .rules = "base", .model = "empty", .layout = 
>>> "empty",
>>> +                          .variant = NULL, .options = NULL };
>>> +    /* We need to really have rules... or something... */
>>> +    XkbSetRulesDflts(&rmlvo);
>>>
>>> These changes result in:
>>>
>>> xkb_keymap {
>>> xkb_keycodes "empty+aliases(qwerty)" {
>>>    minimum = 8;
>>>    maximum = 255;
>>>    virtual indicator 1 = "Caps Lock";
>>>    virtual indicator 2 = "Num Lock";
>>>    virtual indicator 3 = "Shift Lock";
>>>    virtual indicator 4 = "Group 2";
>>>    virtual indicator 5 = "Mouse Keys";
>>>    virtual indicator 6 = "Scroll Lock";
>>> };
>>>
>>> xkb_types "complete" {
>>> ...
>>> };
>>>
>>> xkb_compatibility "complete" {
>>> ...
>>> }
>>>
>>> xkb_symbols "unknown" {
>>>
>>>    key     <> {
>>>        symbols[Group1]= [               a,               A ],
>>>        symbols[Group2]= [           aring,           Aring ]
>>>    };
>>>    modifier_map Mod2 { <> };
>>>    modifier_map Shift { <> };
>>>    modifier_map Lock { <> };
>>>    modifier_map Mod1 { <> };
>>>    modifier_map Control { <> };
>>>    modifier_map Shift { <> };
>>>    modifier

Re: "empty" model/layout for xkb

2010-02-02 Thread Sergey Udaltsov
Dan

Well, these changes look a bit odd, but ok, let's have them. Could you
please create a bug in bugzilla and attach your patch there. Just for
accountability sake.

Thanks,

Sergey

On Tue, Feb 2, 2010 at 2:06 PM, Dan Nicholson  wrote:
> On Tue, Jan 26, 2010 at 12:36 PM, Jeremy Huddleston
>  wrote:
>> I'm trying to modify xkeyboard-config to create an "empty" xbk rules set.  
>> This way, we can set "empty" as the default in XQuartz and have a clean 
>> slate.
>>
>> I'm having a bit of trouble getting this to work.  Firstly, I can't seem to 
>> figure out how to NOT set the +aliases(qwerty) variant on the keycodes.  
>> Secondly, it doesn't seem to recognize my empty symbols file.
>>
>> Can someone fill me in on what I'm missing?
>
> I was guessing the same as Peter where base was adding the aliases for
> all fallbacks, but it looks like you're trying to handle that. Sergey,
> do you have any ideas with the xkb-config changes below?
>
> --
> Dan
>
>>
>> Thanks,
>> Jeremy
>>
>>
>> diff --git a/keycodes/Makefile.am b/keycodes/Makefile.am
>> index c289e14..68c9a54 100644
>> --- a/keycodes/Makefile.am
>> +++ b/keycodes/Makefile.am
>> @@ -6,6 +6,7 @@ dist_keycodes_DATA = \
>>  aliases \
>>  amiga \
>>  ataritt \
>> +empty \
>>  evdev \
>>  fujitsu \
>>  hp \
>> diff --git a/keycodes/empty b/keycodes/empty
>> new file mode 100644
>> index 000..eedc943
>> --- /dev/null
>> +++ b/keycodes/empty
>> @@ -0,0 +1,4 @@
>> +default xkb_keycodes "empty" {
>> +    minimum= 8;
>> +    maximum= 255;
>> +};
>> diff --git a/rules/base.m_k.part b/rules/base.m_k.part
>> index dd0c391..6d5eda0 100644
>> --- a/rules/base.m_k.part
>> +++ b/rules/base.m_k.part
>> @@ -1,5 +1,6 @@
>>   amiga                =       amiga(de)
>>   ataritt      =       ataritt(de)
>> +  empty         =       empty
>>   sun4         =       sun(type4_euro)
>>   sun5         =       sun(type5_euro)
>>   sun6         =       sun(type6_usb)
>> diff --git a/rules/base.ml_s.part b/rules/base.ml_s.part
>> index 1c16b6b..31e5d33 100644
>> --- a/rules/base.ml_s.part
>> +++ b/rules/base.ml_s.part
>> @@ -3,6 +3,8 @@
>>   amiga                $nonlatin               =       
>> xfree68_vndr/amiga(usa1)+%l%(v):2
>>   amiga                *                       =       
>> xfree68_vndr/amiga(usa1)+%l%(v)
>>   classmate    us                      =       pc+%l(classmate)
>> +  empty         *                       =       empty
>> +  *             empty                   =       empty
>>   sun4         $nonlatin               =       
>> latin+sun_vndr/us(type4)+%l%(v):2
>>   sun4         *                       =       
>> latin+sun_vndr/us(type4)+%l%(v)
>>   sun5         $nonlatin               =       
>> latin+sun_vndr/us(type5)+%l%(v):2
>> diff --git a/symbols/Makefile.am b/symbols/Makefile.am
>> index d22d6c3..7724984 100644
>> --- a/symbols/Makefile.am
>> +++ b/symbols/Makefile.am
>> @@ -30,7 +30,7 @@ terminate \
>>  tj tm tr \
>>  ua us uz vn \
>>  za \
>> -altwin capslock compose ctrl eurosign group inet \
>> +altwin capslock compose ctrl empty eurosign group inet \
>>  keypad kpdl level3 level5 nbsp olpc shift srvr_ctrl typo
>>
>>  dir_data = $(dist_symbols_DATA)
>> diff --git a/symbols/empty b/symbols/empty
>> new file mode 100644
>> index 000..72eb127
>> --- /dev/null
>> +++ b/symbols/empty
>> @@ -0,0 +1,6 @@
>> +// $XKeyboardConfig$
>> +
>> +default
>> +xkb_symbols "basic" {
>> +    name[Group1]= "Empty";
>> +};
>>
>>
>> In my DDX, I'm doing this to set the rules:
>>
>> +    XkbRMLVOSet rmlvo = { .rules = "base", .model = "empty", .layout = 
>> "empty",
>> +                          .variant = NULL, .options = NULL };
>> +    /* We need to really have rules... or something... */
>> +    XkbSetRulesDflts(&rmlvo);
>>
>> These changes result in:
>>
>> xkb_keymap {
>> xkb_keycodes "empty+aliases(qwerty)" {
>>    minimum = 8;
>>    maximum = 255;
>>    virtual indicator 1 = "Caps Lock";
>>    virtual indicator 2 = "Num Lock";
>>    virtual indicator 3 = "Shift Lock";
>>    virtual indicator 4 = "Group 2";
>>    virtual indicator 5 = "Mouse Keys";
>>    virtual indicator 6 = "Scroll Lock";
>> };
>>
>> xkb_types "complete" {
>> ...
>> };
>>
>> xkb_compatibility "complete" {
>> ...
>> }
>>
>> xkb_symbols "unknown" {
>>
>>    key     <> {
>>        symbols[Group1]= [               a,               A ],
>>        symbols[Group2]= [           aring,           Aring ]
>>    };
>>    modifier_map Mod2 { <> };
>>    modifier_map Shift { <> };
>>    modifier_map Lock { <> };
>>    modifier_map Mod1 { <> };
>>    modifier_map Control { <> };
>>    modifier_map Shift { <> };
>>    modifier_map Mod1 { <> };
>>    modifier_map Control { <> };
>>    modifier_map Mod2 { <> };
>> };
>>
>> };
>>
>>
>> ___
>> xorg-devel mailing list
>> xorg-devel@lists.x.org
>> http://lists.x.org/mailman/listinfo/xorg-devel
>>
>>
>
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.or

[PATCH] parser: corrected xf86getBoolValue to use case insensitive compare

2010-02-02 Thread Oliver McFadden
commit c6e8637e29e0ca11dfb35c02da7ca6002ac8c597 introduced this
regression; it can cause existing config files to be parsed incorrectly.

Signed-off-by: Oliver McFadden 
---
 hw/xfree86/parser/scan.c |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index b80fbfb..b0e0cdf 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -1195,21 +1195,21 @@ xf86getBoolValue(Bool *val, const char *str)
if (*str == '\0') {
*val = TRUE;
} else {
-   if (strcmp(str, "1") == 0)
+   if (xf86NameCmp(str, "1") == 0)
*val = TRUE;
-   else if (strcmp(str, "on") == 0)
+   else if (xf86NameCmp(str, "on") == 0)
*val = TRUE;
-   else if (strcmp(str, "true") == 0)
+   else if (xf86NameCmp(str, "true") == 0)
*val = TRUE;
-   else if (strcmp(str, "yes") == 0)
+   else if (xf86NameCmp(str, "yes") == 0)
*val = TRUE;
-   else if (strcmp(str, "0") == 0)
+   else if (xf86NameCmp(str, "0") == 0)
*val = FALSE;
-   else if (strcmp(str, "off") == 0)
+   else if (xf86NameCmp(str, "off") == 0)
*val = FALSE;
-   else if (strcmp(str, "false") == 0)
+   else if (xf86NameCmp(str, "false") == 0)
*val = FALSE;
-   else if (strcmp(str, "no") == 0)
+   else if (xf86NameCmp(str, "no") == 0)
*val = FALSE;
else
return FALSE;
-- 
1.6.1

___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: "empty" model/layout for xkb

2010-02-02 Thread Jeremy Huddleston

On Feb 2, 2010, at 03:18, Peter Hutterer wrote:

> On Tue, Jan 26, 2010 at 12:36:55PM -0800, Jeremy Huddleston wrote:
>> I'm trying to modify xkeyboard-config to create an "empty" xbk rules set.
>> This way, we can set "empty" as the default in XQuartz and have a clean
>> slate.
>> 
>> I'm having a bit of trouble getting this to work.  Firstly, I can't seem
>> to figure out how to NOT set the +aliases(qwerty) variant on the keycodes.
>> Secondly, it doesn't seem to recognize my empty symbols file.
>> 
>> Can someone fill me in on what I'm missing?
> 
> the evdev rules file is combined from the base* as well (look at the
> Makefile.am). So for the +aliases to disappear you need to add it to
> base.l_k.part.

What would I add there?  I've had both of these before the '* = 
+aliases(qwerty)" line with no success:

empty = 
or
empty = empty

> that's the only thing I can spot immediately. I take it the rules file is
> composed correctly and the resulting files in /usr/share/X11/xkb (or
> whatever prefix) look alright?

They look alright to me.  I'm still puzzled why the symbols get defined like 
this:

xkb_symbols "unknown" {

   key <> {
   symbols[Group1]= [   a,   A ],
   symbols[Group2]= [   aring,   Aring ]
   };
   modifier_map Mod2 { <> };
   modifier_map Shift { <> };
   modifier_map Lock { <> };
   modifier_map Mod1 { <> };
   modifier_map Control { <> };
   modifier_map Shift { <> };
   modifier_map Mod1 { <> };
   modifier_map Control { <> };
   modifier_map Mod2 { <> };
};

given that the empty symbols file is just:

+++ b/symbols/empty
@@ -0,0 +1,6 @@
+// $XKeyboardConfig$
+
+default
+xkb_symbols "basic" {
+name[Group1]= "Empty";
+};


___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


-fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Jeremy Huddleston
What's the rationale behind having -fno-strict-aliasing in CWARNFLAGS?

Do we actually have code somewhere that needs -fno-strict-aliasing?  If so, we 
should restrict -fno-strict-aliasing to that project (and try to address the 
reason for the need) rather than putting it in util-macros.


___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] parser: corrected xf86getBoolValue to use case insensitive compare

2010-02-02 Thread Dan Nicholson
On Tue, Feb 2, 2010 at 6:43 AM, Oliver McFadden
 wrote:
> commit c6e8637e29e0ca11dfb35c02da7ca6002ac8c597 introduced this
> regression; it can cause existing config files to be parsed incorrectly.
>
> Signed-off-by: Oliver McFadden 
> ---
>  hw/xfree86/parser/scan.c |   16 
>  1 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
> index b80fbfb..b0e0cdf 100644
> --- a/hw/xfree86/parser/scan.c
> +++ b/hw/xfree86/parser/scan.c
> @@ -1195,21 +1195,21 @@ xf86getBoolValue(Bool *val, const char *str)
>        if (*str == '\0') {
>                *val = TRUE;
>        } else {
> -               if (strcmp(str, "1") == 0)
> +               if (xf86NameCmp(str, "1") == 0)
>                        *val = TRUE;
> -               else if (strcmp(str, "on") == 0)
> +               else if (xf86NameCmp(str, "on") == 0)
>                        *val = TRUE;
> -               else if (strcmp(str, "true") == 0)
> +               else if (xf86NameCmp(str, "true") == 0)
>                        *val = TRUE;
> -               else if (strcmp(str, "yes") == 0)
> +               else if (xf86NameCmp(str, "yes") == 0)
>                        *val = TRUE;
> -               else if (strcmp(str, "0") == 0)
> +               else if (xf86NameCmp(str, "0") == 0)
>                        *val = FALSE;
> -               else if (strcmp(str, "off") == 0)
> +               else if (xf86NameCmp(str, "off") == 0)
>                        *val = FALSE;
> -               else if (strcmp(str, "false") == 0)
> +               else if (xf86NameCmp(str, "false") == 0)
>                        *val = FALSE;
> -               else if (strcmp(str, "no") == 0)
> +               else if (xf86NameCmp(str, "no") == 0)
>                        *val = FALSE;
>                else
>                        return FALSE;
> --
> 1.6.1

Oops. Can you change this to xf86nameCompare? That's actually
prototyped in parser/, and xf86NameCmp is just a wrapper around it.
Otherwise,

Reviewed-by: Dan Nicholson 

--
Dan
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH libX11 0/4] Diverse manual improvements

2010-02-02 Thread Dirk Wallenstein
If the patch in response to the bug arrived already I'm sorry. I'll change my
subsription to my main account (halsmit).

Dirk Wallenstein (4):
  man: Redirect users from XKeycodeToKeysym to XkbKeycodeToKeysym #25732
  man: Fix return value specification of XkbKeyActionEntry
  man: Fix value of XkbAllComponentsMask in XkbGetKeyboard
  man: Return value of XkbGetState is Status and not Bool

 man/XStringToKeysym.man   |4 
 man/xkb/XkbGetKeyboard.man|2 +-
 man/xkb/XkbGetState.man   |2 +-
 man/xkb/XkbKeyActionEntry.man |8 
 4 files changed, 10 insertions(+), 6 deletions(-)

___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH libX11 4/4] man: Return value of XkbGetState is Status and not Bool

2010-02-02 Thread Dirk Wallenstein
Signed-off-by: Dirk Wallenstein 
---
 man/xkb/XkbGetState.man |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/man/xkb/XkbGetState.man b/man/xkb/XkbGetState.man
index d591b1e..4e0 100644
--- a/man/xkb/XkbGetState.man
+++ b/man/xkb/XkbGetState.man
@@ -24,7 +24,7 @@
 XkbGetState \-  Obtains the keyboard state 
 .SH SYNOPSIS
 .HP
-.B Bool XkbGetState
+.B Status XkbGetState
 .BI "(\^Display *" "display" "\^,"
 .BI "unsigned int " "device_spec" "\^,"
 .BI "XkbStatePtr " "state_return" "\^);"
-- 
1.6.5.3

___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH libX11 3/4] man: Fix value of XkbAllComponentsMask in XkbGetKeyboard

2010-02-02 Thread Dirk Wallenstein
XkbAllComponentsMask is the combination of all component masks not just
a single bit.

Signed-off-by: Dirk Wallenstein 
---
 man/xkb/XkbGetKeyboard.man |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/man/xkb/XkbGetKeyboard.man b/man/xkb/XkbGetKeyboard.man
index ab6b8d7..0ae0715 100644
--- a/man/xkb/XkbGetKeyboard.man
+++ b/man/xkb/XkbGetKeyboard.man
@@ -73,7 +73,7 @@ XkbIndicatorMapMask   indicators  (1L<<3)
 XkbNamesMask   names   (1L<<4)
 XkbCompatMapMask   compat  (1L<<5)
 XkbGeometryMaskgeom(1L<<6)
-XkbAllComponentsMask   All Fields  (1L<<7)
+XkbAllComponentsMask   All Fields  (0x7f)
 .TE
 
 .I XkbGetKeyboard 
-- 
1.6.5.3

___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH libX11 1/4] man: Redirect users from XKeycodeToKeysym to XkbKeycodeToKeysym #25732

2010-02-02 Thread Dirk Wallenstein
XKeycodeToKeysym keeps compatibility with pre-XKB and thus only sees 2
groups with 2 levels each. It wraps the index into the next group.
This behavior confuses the unaware user, and therefore this will add a
reference to XkbKeycodeToKeysym in the corresponding man paragraph.

Another bug had that issue, too. #5349

Signed-off-by: Dirk Wallenstein 
---
 man/XStringToKeysym.man |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/man/XStringToKeysym.man b/man/XStringToKeysym.man
index 62212db..067765b 100644
--- a/man/XStringToKeysym.man
+++ b/man/XStringToKeysym.man
@@ -202,6 +202,10 @@ If no symbol is defined,
 .ZN XKeycodeToKeysym
 returns
 .ZN NoSymbol .
+.ZN XKeycodeToKeysym
+predates the XKB extension. If you want to lookup a KeySym while
+using XKB you have to use
+.ZN XkbKeycodeToKeysym .
 .LP
 If the specified KeySym is not defined for any KeyCode,
 .ZN XKeysymToKeycode
-- 
1.6.5.3

___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH libX11 2/4] man: Fix return value specification of XkbKeyActionEntry

2010-02-02 Thread Dirk Wallenstein
The XkbKeyActionEntry macro expands to a pointer.

Signed-off-by: Dirk Wallenstein 
---
 man/xkb/XkbKeyActionEntry.man |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/man/xkb/XkbKeyActionEntry.man b/man/xkb/XkbKeyActionEntry.man
index 5acc7e8..c6ebc18 100644
--- a/man/xkb/XkbKeyActionEntry.man
+++ b/man/xkb/XkbKeyActionEntry.man
@@ -21,13 +21,13 @@
 .\"
 .TH XkbKeyActionEntry __libmansuffix__ __xorgversion__ "XKB FUNCTIONS"
 .SH NAME
-XkbKeyActionEntry \- Returns the key action corresponding to group grp and 
shift 
-level lvl from the 
-two-dimensional table of key actions associated with the key corresponding to 
+XkbKeyActionEntry \- Returns a pointer to the key action corresponding to 
+group grp and shift level lvl from the two-dimensional table of key actions
+associated with the key corresponding to 
 keycode
 .SH SYNOPSIS
 .HP
-.B XkbAction XkbKeyActionEntry
+.B XkbAction * XkbKeyActionEntry
 .BI "(\^XkbDescPtr " "xkb" "\^,"
 .BI "KeyCode " "keycode" "\^,"
 .BI "int " "shift" "\^,"
-- 
1.6.5.3

___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] parser: corrected xf86getBoolValue to use case insensitive compare

2010-02-02 Thread Julien Cristau
On Tue, Feb  2, 2010 at 16:43:00 +0200, Oliver McFadden wrote:

> commit c6e8637e29e0ca11dfb35c02da7ca6002ac8c597 introduced this
> regression; it can cause existing config files to be parsed incorrectly.
> 
> Signed-off-by: Oliver McFadden 

Acked-by: Julien Cristau 

(with or without the change Dan suggested)

Cheers,
Julien
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libX11 3/4] man: Fix value of XkbAllComponentsMask in XkbGetKeyboard

2010-02-02 Thread Julien Cristau
On Tue, Feb  2, 2010 at 21:24:31 +0100, Dirk Wallenstein wrote:

> XkbAllComponentsMask is the combination of all component masks not just
> a single bit.
> 
> Signed-off-by: Dirk Wallenstein 

Reviewed-by: Julien Cristau 

Cheers,
Julien
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libX11 4/4] man: Return value of XkbGetState is Status and not Bool

2010-02-02 Thread Julien Cristau
On Tue, Feb  2, 2010 at 21:24:32 +0100, Dirk Wallenstein wrote:

> Signed-off-by: Dirk Wallenstein 

Reviewed-by: Julien Cristau 

Cheers,
Julien
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Gaetan Nadon
On Tue, 2010-02-02 at 09:28 -0800, Jeremy Huddleston wrote:

> What's the rationale behind having -fno-strict-aliasing in CWARNFLAGS?
> 
> Do we actually have code somewhere that needs -fno-strict-aliasing?  If so, 
> we should restrict -fno-strict-aliasing to that project (and try to address 
> the reason for the need) rather than putting it in util-macros.
> 
> 

I did a bit of research. This option has been used since the first day
in git for xserver:

+if test "x$GCC" = "xyes"; then
+ GCC_WARNINGS1="-Wall -Wpointer-arith -Wstrict-prototypes"
+ GCC_WARNINGS2="-Wmissing-prototypes -Wmissing-declarations"
+ GCC_WARNINGS3="-Wnested-externs -fno-strict-aliasing"
+ GCC_WARNINGS="$GCC_WARNINGS1 $GCC_WARNINGS2 $GCC_WARNINGS3"
+ if test "x$WERROR" = "xyes"; then
+ GCC_WARNINGS="${GCC_WARNINGS} -Werror"
+ fi
+ XSERVER_CFLAGS="$GCC_WARNINGS $XSERVER_CFLAGS"
+fi

This is not a warning option, so it should not be there to begin with
(or the macro name was wrong). I tried to understand why it's there. The
gcc compiler makes optimization based on aliasing assumptions. If the
code does not follow the rules, it can cause runtime failure.


According to this post, the Perl code has removed the
-fno-strict-aliasing as it cannot safely assume that compilers
won't optimize anyway. They figured it was better to fix the
code, where applicable. That was in 2002.


http://www.nntp.perl.org/group/perl.perl6.internals/2002/12/msg14281.html

 There are posts about "good" code that failed under strict
aliasing optimization, only to be flagged afterwards by others
who demonstrated that the code worked "by luck" when not
optimized.

Help with understanding strict aliasing rules:

http://mail-index.netbsd.org/tech-kern/2003/08/11/0001.html

The rules about pointer type conversions are at 6.3.2.3.  The
appropriate paragraphs are paragraphs 1 and 7:
http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf


I have not seen any compelling reasons to turn off this optimization.
Maybe 10 years ago when it was first introduced. I have seen reports of
large number of warnings, but from older gcc versions. As it is today,
we are losing some optimization that could be beneficial.

This option has been there for so long (most likely copied along), I
doubt you will will get a clear answer for each of the 240 xorg modules.
It would take a few modules to try it out first.


> ___
> xorg-devel mailing list
> xorg-devel@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-devel


signature.asc
Description: This is a digitally signed message part
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libX11 2/4] man: Fix return value specification of XkbKeyActionEntry

2010-02-02 Thread Julien Cristau
On Tue, Feb  2, 2010 at 21:24:30 +0100, Dirk Wallenstein wrote:

> The XkbKeyActionEntry macro expands to a pointer.
> 
> Signed-off-by: Dirk Wallenstein 

wow.  what a mess of macros...

Reviewed-by: Julien Cristau 
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libX11 3/4] man: Fix value of XkbAllComponentsMask in XkbGetKeyboard

2010-02-02 Thread Jeremy Huddleston
I'd prefer to see this written as:

(1L<<7) - 1L

On Feb 2, 2010, at 12:24, Dirk Wallenstein wrote:

> XkbAllComponentsMask is the combination of all component masks not just
> a single bit.
> 
> Signed-off-by: Dirk Wallenstein 
> ---
> man/xkb/XkbGetKeyboard.man |2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/man/xkb/XkbGetKeyboard.man b/man/xkb/XkbGetKeyboard.man
> index ab6b8d7..0ae0715 100644
> --- a/man/xkb/XkbGetKeyboard.man
> +++ b/man/xkb/XkbGetKeyboard.man
> @@ -73,7 +73,7 @@ XkbIndicatorMapMask indicators  (1L<<3)
> XkbNamesMask  names   (1L<<4)
> XkbCompatMapMask  compat  (1L<<5)
> XkbGeometryMask   geom(1L<<6)
> -XkbAllComponentsMask All Fields  (1L<<7)
> +XkbAllComponentsMask All Fields  (0x7f)
> .TE
> 
> .I XkbGetKeyboard 
> -- 
> 1.6.5.3
> 
> ___
> xorg-devel mailing list
> xorg-devel@lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-devel

___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Jeremy Huddleston

On Feb 2, 2010, at 13:18, Gaetan Nadon wrote:

> I have not seen any compelling reasons to turn off this optimization.
> Maybe 10 years ago when it was first introduced. I have seen reports of
> large number of warnings, but from older gcc versions. As it is today,
> we are losing some optimization that could be beneficial.
> 
> This option has been there for so long (most likely copied along), I
> doubt you will will get a clear answer for each of the 240 xorg modules.
> It would take a few modules to try it out first.

I see it in libX11 has historically used -fno-strict-aliasing:
http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=db7c6fdeeaef9475458498e4cf09d6b1329e9aa3

but adding XORG_CWARNFLAGS to XORG_DEFAULT_OPTIONS has caused this to change 
for other modules.

Looking at historic versions of modules, I see it present in:

libICE
libSM
libX11
libXau
libXfont
libXft
libXpm
libXres
xorg-server

of course most of these seem to have just copied the entire GCC_WARNINGS block 
and probably didn't actually need -fno-strict-aliasing
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH util-macros 2/2] Add -Wformat=2 to the default CWARNFLAGS

2010-02-02 Thread Jeremy Huddleston
This will include -Wformat-security to catch possible security problems in 
formatting in printf, scanf, etc.

Signed-off-by: Jeremy Huddleston 
---
 xorg-macros.m4.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index 40f5939..6d6f044 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -589,7 +589,7 @@ AC_REQUIRE([AC_PROG_CC])
 if  test "x$GCC" = xyes ; then
 CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes 
\
 -Wmissing-declarations -Wnested-externs -Wstrict-aliasing=2 \
--Wbad-function-cast"
+-Wbad-function-cast -Wformat=2"
 case `$CC -dumpversion` in
 3.4.* | 4.*)
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition 
-Wdeclaration-after-statement"
-- 
1.6.2


___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH util-macros 1/2] Don't disable strict aliasing (-fno-strict-aliasing) globally

2010-02-02 Thread Jeremy Huddleston
Instead, we warn where this optimization might cause a problem!

This was included for historic reasons and has persisted to the point of now
infecting all X.org modules.  Historically, it was just present in these
modules before adding XORG_CWARNFLAGS to XORG_DEFAULT_OPTIONS:

libICE
libSM
libX11
libXau
libXfont
libXft
libXpm
libXres
xorg-server

Most of these modules probably don't even need to disable this optimization,
but if it is decided that this optimization should be disabled, it should be
restricted to the required module rather than a global option.

Signed-off-by: Jeremy Huddleston 
---
 xorg-macros.m4.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
index caf61c2..40f5939 100644
--- a/xorg-macros.m4.in
+++ b/xorg-macros.m4.in
@@ -588,7 +588,7 @@ AC_DEFUN([XORG_CWARNFLAGS], [
 AC_REQUIRE([AC_PROG_CC])
 if  test "x$GCC" = xyes ; then
 CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes 
\
--Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wmissing-declarations -Wnested-externs -Wstrict-aliasing=2 \
 -Wbad-function-cast"
 case `$CC -dumpversion` in
 3.4.* | 4.*)
-- 
1.6.2


___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libX11 2/4] man: Fix return value specification of XkbKeyActionEntry

2010-02-02 Thread Dan Nicholson
On Tue, Feb 2, 2010 at 1:32 PM, Julien Cristau  wrote:
> On Tue, Feb  2, 2010 at 21:24:30 +0100, Dirk Wallenstein wrote:
>
>> The XkbKeyActionEntry macro expands to a pointer.
>>
>> Signed-off-by: Dirk Wallenstein 
>
> wow.  what a mess of macros...
>
> Reviewed-by: Julien Cristau 

Venture into the XKB headers at your peril...

--
Dan
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH libX11 1/2] Fix warnings for recent bigreqsproto, xcmiscproto, and xf86bigfontproto

2010-02-02 Thread Jeremy Huddleston

Signed-off-by: Jeremy Huddleston 
---
 configure.ac  |6 +++---
 src/Font.c|2 +-
 src/OpenDis.c |2 +-
 src/XlibInt.c |2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0eea575..00ab51c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,13 +60,13 @@ AM_CONDITIONAL(XCB, test x$ac_cv_use_xcb != xno)
 # Checks for pkg-config packages
 
 # Always required
-X11_REQUIRES='xproto >= 7.0.13 xextproto xtrans'
+X11_REQUIRES='[xproto >= 7.0.13] xextproto xtrans'
 
 PKG_PROG_PKG_CONFIG()
 
 case "$ac_cv_use_xcb" in
 no)
-   X11_REQUIRES="${X11_REQUIRES} xau xcmiscproto bigreqsproto"
+   X11_REQUIRES="${X11_REQUIRES} xau [xcmiscproto >= 1.2.0] [bigreqsproto 
>= 1.1.0]"
X11_EXTRA_DEPS="xau"
PKG_CHECK_MODULES(XDMCP, xdmcp,
AC_CHECK_LIB(Xdmcp, XdmcpWrap,
@@ -330,7 +330,7 @@ AC_ARG_ENABLE(xf86bigfont,
[Disable XF86BigFont extension support]),
  [XF86BIGFONT=$enableval],[XF86BIGFONT="yes"])
 if test "x$XF86BIGFONT" = "xyes"; then
-PKG_CHECK_MODULES(BIGFONT, xf86bigfontproto,
+PKG_CHECK_MODULES(BIGFONT, [xf86bigfontproto >= 1.2.0],
  AC_DEFINE(XF86BIGFONT,1,[Enable XF86BIGFONT 
extension]),XF86BIGFONT="no")
 AC_SUBST(BIGFONT_CFLAGS)
 AC_SUBST(BIGFONT_LIBS)
diff --git a/src/Font.c b/src/Font.c
index b664b8d..5479c83 100644
--- a/src/Font.c
+++ b/src/Font.c
@@ -45,7 +45,7 @@ authorization from the X Consortium and the XFree86 Project.
 
 #include 
 #include 
-#include 
+#include 
 #endif
 
 #include "Xlcint.h"
diff --git a/src/OpenDis.c b/src/OpenDis.c
index 46e1026..78cf74b 100644
--- a/src/OpenDis.c
+++ b/src/OpenDis.c
@@ -34,7 +34,7 @@ in this Software without prior written authorization from The 
Open Group.
 #include "Xxcbint.h"
 #else /* !USE_XCB */
 #include 
-#include 
+#include 
 #endif /* USE_XCB */
 #include 
 #include 
diff --git a/src/XlibInt.c b/src/XlibInt.c
index fb6e715..0f30f74 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -44,7 +44,7 @@ from The Open Group.
 #include 
 #if !USE_XCB
 #include 
-#include 
+#include 
 #endif /* !USE_XCB */
 #include 
 #include 
-- 
1.6.2


___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


[PATCH libX11 2/2] Fix various build warnings

2010-02-02 Thread Jeremy Huddleston

imLcIm.c: In function '_XimCachedFileName':
imLcIm.c:361: warning: format '%03x' expects type 'unsigned int', but argument 
8 has type 'long unsigned int'
imLcIm.c:364: warning: format '%03x' expects type 'unsigned int', but argument 
8 has type 'long unsigned int'

imRm.c: In function '_XimDefaultArea':
imRm.c:597: warning: cast from pointer to integer of different size
imRm.c: In function '_XimDefaultColormap':
imRm.c:626: warning: cast from pointer to integer of different size

lcFile.c:224: warning: no previous prototype for 'xlocaledir'

lcUTF8.c: In function 'iconv_cstombs':
lcUTF8.c:1841: warning: assignment discards qualifiers from pointer target type
lcUTF8.c:1869: warning: pointer targets in passing argument 1 of 'wctomb' 
differ in signedness
lcUTF8.c:1873: warning: pointer targets in passing argument 1 of 'wctomb' 
differ in signedness
lcUTF8.c: In function 'iconv_mbstocs':
lcUTF8.c:1935: warning: pointer targets in passing argument 2 of 'mbtowc' 
differ in signedness
lcUTF8.c: In function 'iconv_mbtocs':
lcUTF8.c:2031: warning: pointer targets in passing argument 2 of 'mbtowc' 
differ in signedness
lcUTF8.c: In function 'iconv_mbstostr':
lcUTF8.c:2121: warning: pointer targets in passing argument 2 of 'mbtowc' 
differ in signedness
lcUTF8.c: In function 'iconv_strtombs':
lcUTF8.c:2180: warning: pointer targets in passing argument 1 of 'wctomb' 
differ in signedness
lcUTF8.c: In function '_XlcAddGB18030LocaleConverters':
lcUTF8.c:2367: warning: passing argument 5 of '_XlcSetConverter' from 
incompatible pointer type
lcUTF8.c:2368: warning: passing argument 5 of '_XlcSetConverter' from 
incompatible pointer type
lcUTF8.c:2373: warning: passing argument 5 of '_XlcSetConverter' from 
incompatible pointer type
lcUTF8.c:2374: warning: passing argument 5 of '_XlcSetConverter' from 
incompatible pointer type
lcUTF8.c:2375: warning: passing argument 5 of '_XlcSetConverter' from 
incompatible pointer type
lcUTF8.c:2376: warning: passing argument 5 of '_XlcSetConverter' from 
incompatible pointer type
lcUTF8.c:2377: warning: passing argument 5 of '_XlcSetConverter' from 
incompatible pointer type

XlibInt.c: In function '_XGetHostname':
XlibInt.c:3441: warning: implicit declaration of function 'gethostname'
XlibInt.c:3441: warning: nested extern declaration of 'gethostname'

ConnDis.c: In function '_XDisconnectDisplay':
ConnDis.c:540: warning: old-style function definition
ConnDis.c: In function '_XSendClientPrefix':
ConnDis.c:554: warning: old-style function definition
ConnDis.c: In function 'XSetAuthorization':
ConnDis.c:677: warning: old-style function definition

Signed-off-by: Jeremy Huddleston 
---
 include/X11/Xlibint.h  |7 +++
 modules/im/ximcp/imLcIm.c  |4 ++--
 modules/im/ximcp/imLcPrs.c |5 -
 modules/im/ximcp/imRm.c|4 ++--
 src/ConnDis.c  |   21 +
 src/XlibInt.c  |4 
 src/xlibi18n/lcUTF8.c  |   28 ++--
 7 files changed, 38 insertions(+), 35 deletions(-)

diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h
index 767b083..0e97fd9 100644
--- a/include/X11/Xlibint.h
+++ b/include/X11/Xlibint.h
@@ -1391,6 +1391,13 @@ extern Bool _XCopyEventCookie(
 XGenericEventCookie *in,
 XGenericEventCookie *out);
 
+/* lcFile.c */
+
+extern void xlocaledir(
+char *buf,
+int buf_len
+);
+
 _XFUNCPROTOEND
 
 #endif /* _XLIBINT_H_ */
diff --git a/modules/im/ximcp/imLcIm.c b/modules/im/ximcp/imLcIm.c
index eb41603..83f216a 100644
--- a/modules/im/ximcp/imLcIm.c
+++ b/modules/im/ximcp/imLcIm.c
@@ -359,10 +359,10 @@ Private int _XimCachedFileName (
 
 if (len == 0 || dir [len-1] != '/')
sprintf (*res, "%s/%c%d_%03x_%08x_%08x", dir, _XimGetMyEndian(),
-   XIM_CACHE_VERSION, sizeof (DefTree), hash, hash2);
+   XIM_CACHE_VERSION, (unsigned int)sizeof (DefTree), hash, hash2);
 else
sprintf (*res, "%s%c%d_%03x_%08x_%08x", dir, _XimGetMyEndian(),
-   XIM_CACHE_VERSION, sizeof (DefTree), hash, hash2);
+   XIM_CACHE_VERSION, (unsigned int)sizeof (DefTree), hash, hash2);
 
 /* fprintf (stderr, "-> %s\n", *res); */
 if ( (fd = _XOpenFile (*res, O_RDONLY)) == -1)
diff --git a/modules/im/ximcp/imLcPrs.c b/modules/im/ximcp/imLcPrs.c
index c080172..75449ef 100644
--- a/modules/im/ximcp/imLcPrs.c
+++ b/modules/im/ximcp/imLcPrs.c
@@ -44,11 +44,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
 
 #define XLC_BUFSIZE 256
 
-extern void xlocaledir(
-char *buf,
-int buf_len
-);
-
 extern int _Xmbstowcs(
 wchar_t*wstr,
 char   *str,
diff --git a/modules/im/ximcp/imRm.c b/modules/im/ximcp/imRm.c
index 94190e9..8e02b13 100644
--- a/modules/im/ximcp/imRm.c
+++ b/modules/im/ximcp/imRm.c
@@ -594,7 +594,7 @@ _XimDefaultArea(
 if(XGetGeometry(im->core.display, (Drawable)ic->core.focus_window,
&root_return, &x_return, &y_return, &width_return,
&height_return, &border_width_return, &

Re: "empty" model/layout for xkb

2010-02-02 Thread Sergey Udaltsov
Jeremy,

I just tried

setxkbmap -model "" -layout "" -option "" -print
xkb_keymap {
xkb_keycodes  { include "evdev" };
xkb_types { include "complete"  };
xkb_geometry  { include "pc(pc104)" };
};

The values for keycodes, types, geometry are taken from rules/evdev
! model =  keycodes
...
*   =   evdev
...
! model = types
...
* =   complete
...
! model =   geometry
...
  * =   pc(pc104)

Since there are no default symbols - nothing is used, and that makes
xkbdomp very unhappy. You should explicitly specify empty symbols
section, I guess. Same applies to compat.

And I do not see any aliases!

Sergey

On Tue, Feb 2, 2010 at 2:11 PM, Dan Nicholson  wrote:
> On Tue, Feb 2, 2010 at 6:09 AM, Sergey Udaltsov
>  wrote:
>> Dan
>>
>> Well, these changes look a bit odd, but ok, let's have them. Could you
>> please create a bug in bugzilla and attach your patch there. Just for
>> accountability sake.
>
> I think Jeremy was more asking why they weren't working as expected.
> He still gets aliases set in the variant even though he's trying to
> disable that.
>
> --
> Dan
>
>>
>> Thanks,
>>
>> Sergey
>>
>> On Tue, Feb 2, 2010 at 2:06 PM, Dan Nicholson  wrote:
>>> On Tue, Jan 26, 2010 at 12:36 PM, Jeremy Huddleston
>>>  wrote:
 I'm trying to modify xkeyboard-config to create an "empty" xbk rules set.  
 This way, we can set "empty" as the default in XQuartz and have a clean 
 slate.

 I'm having a bit of trouble getting this to work.  Firstly, I can't seem 
 to figure out how to NOT set the +aliases(qwerty) variant on the keycodes. 
  Secondly, it doesn't seem to recognize my empty symbols file.

 Can someone fill me in on what I'm missing?
>>>
>>> I was guessing the same as Peter where base was adding the aliases for
>>> all fallbacks, but it looks like you're trying to handle that. Sergey,
>>> do you have any ideas with the xkb-config changes below?
>>>
>>> --
>>> Dan
>>>

 Thanks,
 Jeremy


 diff --git a/keycodes/Makefile.am b/keycodes/Makefile.am
 index c289e14..68c9a54 100644
 --- a/keycodes/Makefile.am
 +++ b/keycodes/Makefile.am
 @@ -6,6 +6,7 @@ dist_keycodes_DATA = \
  aliases \
  amiga \
  ataritt \
 +empty \
  evdev \
  fujitsu \
  hp \
 diff --git a/keycodes/empty b/keycodes/empty
 new file mode 100644
 index 000..eedc943
 --- /dev/null
 +++ b/keycodes/empty
 @@ -0,0 +1,4 @@
 +default xkb_keycodes "empty" {
 +    minimum= 8;
 +    maximum= 255;
 +};
 diff --git a/rules/base.m_k.part b/rules/base.m_k.part
 index dd0c391..6d5eda0 100644
 --- a/rules/base.m_k.part
 +++ b/rules/base.m_k.part
 @@ -1,5 +1,6 @@
   amiga                =       amiga(de)
   ataritt      =       ataritt(de)
 +  empty         =       empty
   sun4         =       sun(type4_euro)
   sun5         =       sun(type5_euro)
   sun6         =       sun(type6_usb)
 diff --git a/rules/base.ml_s.part b/rules/base.ml_s.part
 index 1c16b6b..31e5d33 100644
 --- a/rules/base.ml_s.part
 +++ b/rules/base.ml_s.part
 @@ -3,6 +3,8 @@
   amiga                $nonlatin               =       
 xfree68_vndr/amiga(usa1)+%l%(v):2
   amiga                *                       =       
 xfree68_vndr/amiga(usa1)+%l%(v)
   classmate    us                      =       pc+%l(classmate)
 +  empty         *                       =       empty
 +  *             empty                   =       empty
   sun4         $nonlatin               =       
 latin+sun_vndr/us(type4)+%l%(v):2
   sun4         *                       =       
 latin+sun_vndr/us(type4)+%l%(v)
   sun5         $nonlatin               =       
 latin+sun_vndr/us(type5)+%l%(v):2
 diff --git a/symbols/Makefile.am b/symbols/Makefile.am
 index d22d6c3..7724984 100644
 --- a/symbols/Makefile.am
 +++ b/symbols/Makefile.am
 @@ -30,7 +30,7 @@ terminate \
  tj tm tr \
  ua us uz vn \
  za \
 -altwin capslock compose ctrl eurosign group inet \
 +altwin capslock compose ctrl empty eurosign group inet \
  keypad kpdl level3 level5 nbsp olpc shift srvr_ctrl typo

  dir_data = $(dist_symbols_DATA)
 diff --git a/symbols/empty b/symbols/empty
 new file mode 100644
 index 000..72eb127
 --- /dev/null
 +++ b/symbols/empty
 @@ -0,0 +1,6 @@
 +// $XKeyboardConfig$
 +
 +default
 +xkb_symbols "basic" {
 +    name[Group1]= "Empty";
 +};


 In my DDX, I'm doing this to set the rules:

 +    XkbRMLVOSet rmlvo = { .rules = "base", .model = "empty", .layout = 
 "empty",
 +                          .variant = NULL, .options = NULL };
 +    /* We need to really have rules... or something... */
 +    XkbSetRulesDflts(&rmlvo);

 These ch

Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Gaetan Nadon
On Tue, 2010-02-02 at 14:00 -0800, Jeremy Huddleston wrote:

> On Feb 2, 2010, at 13:18, Gaetan Nadon wrote:
> 
> > I have not seen any compelling reasons to turn off this optimization.
> > Maybe 10 years ago when it was first introduced. I have seen reports of
> > large number of warnings, but from older gcc versions. As it is today,
> > we are losing some optimization that could be beneficial.
> > 
> > This option has been there for so long (most likely copied along), I
> > doubt you will will get a clear answer for each of the 240 xorg modules.
> > It would take a few modules to try it out first.
> 
> I see it in libX11 has historically used -fno-strict-aliasing:
> http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=db7c6fdeeaef9475458498e4cf09d6b1329e9aa3
> 
> but adding XORG_CWARNFLAGS to XORG_DEFAULT_OPTIONS has caused this to change 
> for other modules.
> 
> Looking at historic versions of modules, I see it present in:
> 
> libICE
> libSM
> libX11
> libXau
> libXfont
> libXft
> libXpm
> libXres
> xorg-server
> 
> of course most of these seem to have just copied the entire GCC_WARNINGS 
> block and probably didn't actually need -fno-strict-aliasing

Of course. Whatever the reasons were, if anyone remembers, may not apply
anymore. Devising a plan for it's removal will not be an easy task. I
see 3 options:

1) take it out of macros, 1 patch
2) transfer it to all makefiles and then removing it gradually, that's
2*240 +1 patches
3) override in 'n' makefiles until proven safe. Then take it out macros.
That's 2*n +1 patches.

I am curious how you can about this. 



signature.asc
Description: This is a digitally signed message part
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Jeremy Huddleston

On Feb 2, 2010, at 17:11, Gaetan Nadon wrote:

> On Tue, 2010-02-02 at 14:00 -0800, Jeremy Huddleston wrote:
> 
>> On Feb 2, 2010, at 13:18, Gaetan Nadon wrote:
>> 
>>> I have not seen any compelling reasons to turn off this optimization.
>>> Maybe 10 years ago when it was first introduced. I have seen reports of
>>> large number of warnings, but from older gcc versions. As it is today,
>>> we are losing some optimization that could be beneficial.
>>> 
>>> This option has been there for so long (most likely copied along), I
>>> doubt you will will get a clear answer for each of the 240 xorg modules.
>>> It would take a few modules to try it out first.
>> 
>> I see it in libX11 has historically used -fno-strict-aliasing:
>> http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=db7c6fdeeaef9475458498e4cf09d6b1329e9aa3
>> 
>> but adding XORG_CWARNFLAGS to XORG_DEFAULT_OPTIONS has caused this to change 
>> for other modules.
>> 
>> Looking at historic versions of modules, I see it present in:
>> 
>> libICE
>> libSM
>> libX11
>> libXau
>> libXfont
>> libXft
>> libXpm
>> libXres
>> xorg-server
>> 
>> of course most of these seem to have just copied the entire GCC_WARNINGS 
>> block and probably didn't actually need -fno-strict-aliasing
> 
> Of course. Whatever the reasons were, if anyone remembers, may not apply
> anymore. Devising a plan for it's removal will not be an easy task. I
> see 3 options:
> 
> 1) take it out of macros, 1 patch

I sent that patch already.

> 2) transfer it to all makefiles and then removing it gradually, that's
> 2*240 +1 patches

I don't think that's wise.  If anything, you should just put it in the ones 
where it was prior to XORG_CWARNFLAGS (the 9 mentioned above).

That being said, I also enabled the warning which should mention when it 
discovers code sensitive to the -fstrict-aliasing optimization, and none of the 
libs in the list above spewed such a warning.

> 3) override in 'n' makefiles until proven safe. Then take it out macros.
> That's 2*n +1 patches.

We could do that for the 9 modules above.  I'm fairly confident that the libs 
don't need it, but I haven't rebuilt all of the server to be confident it 
doesn't spew any warnings about strict-aliasing.



___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: -fno-strict-aliasing in CWARNFLAGS?

2010-02-02 Thread Gaetan Nadon
On Tue, 2010-02-02 at 17:34 -0800, Jeremy Huddleston wrote:

> On Feb 2, 2010, at 17:11, Gaetan Nadon wrote:
> 
> > On Tue, 2010-02-02 at 14:00 -0800, Jeremy Huddleston wrote:
> > 
> >> On Feb 2, 2010, at 13:18, Gaetan Nadon wrote:
> >> 
> >>> I have not seen any compelling reasons to turn off this optimization.
> >>> Maybe 10 years ago when it was first introduced. I have seen reports of
> >>> large number of warnings, but from older gcc versions. As it is today,
> >>> we are losing some optimization that could be beneficial.
> >>> 
> >>> This option has been there for so long (most likely copied along), I
> >>> doubt you will will get a clear answer for each of the 240 xorg modules.
> >>> It would take a few modules to try it out first.
> >> 
> >> I see it in libX11 has historically used -fno-strict-aliasing:
> >> http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=db7c6fdeeaef9475458498e4cf09d6b1329e9aa3
> >> 
> >> but adding XORG_CWARNFLAGS to XORG_DEFAULT_OPTIONS has caused this to 
> >> change for other modules.
> >> 
> >> Looking at historic versions of modules, I see it present in:
> >> 
> >> libICE
> >> libSM
> >> libX11
> >> libXau
> >> libXfont
> >> libXft
> >> libXpm
> >> libXres
> >> xorg-server
> >> 
> >> of course most of these seem to have just copied the entire GCC_WARNINGS 
> >> block and probably didn't actually need -fno-strict-aliasing
> > 
> > Of course. Whatever the reasons were, if anyone remembers, may not apply
> > anymore. Devising a plan for it's removal will not be an easy task. I
> > see 3 options:
> > 
> > 1) take it out of macros, 1 patch
> 
> I sent that patch already.
> 
> > 2) transfer it to all makefiles and then removing it gradually, that's
> > 2*240 +1 patches
> 
> I don't think that's wise.  If anything, you should just put it in the ones 
> where it was prior to XORG_CWARNFLAGS (the 9 mentioned above).
> 
> That being said, I also enabled the warning which should mention when it 
> discovers code sensitive to the -fstrict-aliasing optimization, and none of 
> the libs in the list above spewed such a warning.
> 
> > 3) override in 'n' makefiles until proven safe. Then take it out macros.
> > That's 2*n +1 patches.
> 
> We could do that for the 9 modules above.  I'm fairly confident that the libs 
> don't need it, but I haven't rebuilt all of the server to be confident it 
> doesn't spew any warnings about strict-aliasing.



Oh, just 9. It thought these were just examples and that there were many more. 
I noticed the patch later, sorry. I had a quick look in xserver and I saw some 
warnings, as expected.


signature.asc
Description: This is a digitally signed message part
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libX11 2/2] Fix various build warnings

2010-02-02 Thread Dan Nicholson
On Tue, Feb 2, 2010 at 5:03 PM, Jeremy Huddleston
 wrote:
>
> imLcIm.c: In function '_XimCachedFileName':
> imLcIm.c:361: warning: format '%03x' expects type 'unsigned int', but 
> argument 8 has type 'long unsigned int'
> imLcIm.c:364: warning: format '%03x' expects type 'unsigned int', but 
> argument 8 has type 'long unsigned int'
>
> imRm.c: In function '_XimDefaultArea':
> imRm.c:597: warning: cast from pointer to integer of different size
> imRm.c: In function '_XimDefaultColormap':
> imRm.c:626: warning: cast from pointer to integer of different size
>
> lcFile.c:224: warning: no previous prototype for 'xlocaledir'
>
> lcUTF8.c: In function 'iconv_cstombs':
> lcUTF8.c:1841: warning: assignment discards qualifiers from pointer target 
> type
> lcUTF8.c:1869: warning: pointer targets in passing argument 1 of 'wctomb' 
> differ in signedness
> lcUTF8.c:1873: warning: pointer targets in passing argument 1 of 'wctomb' 
> differ in signedness
> lcUTF8.c: In function 'iconv_mbstocs':
> lcUTF8.c:1935: warning: pointer targets in passing argument 2 of 'mbtowc' 
> differ in signedness
> lcUTF8.c: In function 'iconv_mbtocs':
> lcUTF8.c:2031: warning: pointer targets in passing argument 2 of 'mbtowc' 
> differ in signedness
> lcUTF8.c: In function 'iconv_mbstostr':
> lcUTF8.c:2121: warning: pointer targets in passing argument 2 of 'mbtowc' 
> differ in signedness
> lcUTF8.c: In function 'iconv_strtombs':
> lcUTF8.c:2180: warning: pointer targets in passing argument 1 of 'wctomb' 
> differ in signedness
> lcUTF8.c: In function '_XlcAddGB18030LocaleConverters':
> lcUTF8.c:2367: warning: passing argument 5 of '_XlcSetConverter' from 
> incompatible pointer type
> lcUTF8.c:2368: warning: passing argument 5 of '_XlcSetConverter' from 
> incompatible pointer type
> lcUTF8.c:2373: warning: passing argument 5 of '_XlcSetConverter' from 
> incompatible pointer type
> lcUTF8.c:2374: warning: passing argument 5 of '_XlcSetConverter' from 
> incompatible pointer type
> lcUTF8.c:2375: warning: passing argument 5 of '_XlcSetConverter' from 
> incompatible pointer type
> lcUTF8.c:2376: warning: passing argument 5 of '_XlcSetConverter' from 
> incompatible pointer type
> lcUTF8.c:2377: warning: passing argument 5 of '_XlcSetConverter' from 
> incompatible pointer type
>
> XlibInt.c: In function '_XGetHostname':
> XlibInt.c:3441: warning: implicit declaration of function 'gethostname'
> XlibInt.c:3441: warning: nested extern declaration of 'gethostname'
>
> ConnDis.c: In function '_XDisconnectDisplay':
> ConnDis.c:540: warning: old-style function definition
> ConnDis.c: In function '_XSendClientPrefix':
> ConnDis.c:554: warning: old-style function definition
> ConnDis.c: In function 'XSetAuthorization':
> ConnDis.c:677: warning: old-style function definition
>
> Signed-off-by: Jeremy Huddleston 
> ---
>  include/X11/Xlibint.h      |    7 +++
>  modules/im/ximcp/imLcIm.c  |    4 ++--
>  modules/im/ximcp/imLcPrs.c |    5 -
>  modules/im/ximcp/imRm.c    |    4 ++--
>  src/ConnDis.c              |   21 +
>  src/XlibInt.c              |    4 
>  src/xlibi18n/lcUTF8.c      |   28 ++--
>  7 files changed, 38 insertions(+), 35 deletions(-)
>
> diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h
> index 767b083..0e97fd9 100644
> --- a/include/X11/Xlibint.h
> +++ b/include/X11/Xlibint.h
> @@ -1391,6 +1391,13 @@ extern Bool _XCopyEventCookie(
>         XGenericEventCookie *in,
>         XGenericEventCookie *out);
>
> +/* lcFile.c */
> +
> +extern void xlocaledir(
> +    char *buf,
> +    int buf_len
> +);
> +
>  _XFUNCPROTOEND
>
>  #endif /* _XLIBINT_H_ */
> diff --git a/modules/im/ximcp/imLcIm.c b/modules/im/ximcp/imLcIm.c
> index eb41603..83f216a 100644
> --- a/modules/im/ximcp/imLcIm.c
> +++ b/modules/im/ximcp/imLcIm.c
> @@ -359,10 +359,10 @@ Private int _XimCachedFileName (
>
>     if (len == 0 || dir [len-1] != '/')
>        sprintf (*res, "%s/%c%d_%03x_%08x_%08x", dir, _XimGetMyEndian(),
> -               XIM_CACHE_VERSION, sizeof (DefTree), hash, hash2);
> +               XIM_CACHE_VERSION, (unsigned int)sizeof (DefTree), hash, 
> hash2);
>     else
>        sprintf (*res, "%s%c%d_%03x_%08x_%08x", dir, _XimGetMyEndian(),
> -               XIM_CACHE_VERSION, sizeof (DefTree), hash, hash2);
> +               XIM_CACHE_VERSION, (unsigned int)sizeof (DefTree), hash, 
> hash2);

How about just changing the specifier to %zu?

>
>  /* fprintf (stderr, "-> %s\n", *res); */
>     if ( (fd = _XOpenFile (*res, O_RDONLY)) == -1)
> diff --git a/modules/im/ximcp/imLcPrs.c b/modules/im/ximcp/imLcPrs.c
> index c080172..75449ef 100644
> --- a/modules/im/ximcp/imLcPrs.c
> +++ b/modules/im/ximcp/imLcPrs.c
> @@ -44,11 +44,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
>
>  #define XLC_BUFSIZE 256
>
> -extern void xlocaledir(
> -    char *buf,
> -    int buf_len
> -);
> -
>  extern int _Xmbstowcs(
>     wchar_t    *wstr,
>     char       *str,
> diff --git a/modules/im/ximcp/imRm.c b/modules/im/ximc

Re: [PATCH libX11 1/2] Fix warnings for recent bigreqsproto, xcmiscproto, and xf86bigfontproto

2010-02-02 Thread Dan Nicholson
On Tue, Feb 2, 2010 at 5:03 PM, Jeremy Huddleston
 wrote:
>
> Signed-off-by: Jeremy Huddleston 
> ---
>  configure.ac  |    6 +++---
>  src/Font.c    |    2 +-
>  src/OpenDis.c |    2 +-
>  src/XlibInt.c |    2 +-
>  4 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 0eea575..00ab51c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -60,13 +60,13 @@ AM_CONDITIONAL(XCB, test x$ac_cv_use_xcb != xno)
>  # Checks for pkg-config packages
>
>  # Always required
> -X11_REQUIRES='xproto >= 7.0.13 xextproto xtrans'
> +X11_REQUIRES='[xproto >= 7.0.13] xextproto xtrans'
>
>  PKG_PROG_PKG_CONFIG()
>
>  case "$ac_cv_use_xcb" in
>  no)
> -       X11_REQUIRES="${X11_REQUIRES} xau xcmiscproto bigreqsproto"
> +       X11_REQUIRES="${X11_REQUIRES} xau [xcmiscproto >= 1.2.0] 
> [bigreqsproto >= 1.1.0]"

Do these actually change anything? autoconf is just going to remove
the [] after processing through m4, and having >= within quotes in
shell is fine. There's a lot of this excessive quoting/unquoting in
the x configure.ac's, and all that's really needed is to make sure
that the arguments to the autoconf m4 macros are quoted...

>        X11_EXTRA_DEPS="xau"
>        PKG_CHECK_MODULES(XDMCP, xdmcp,
>                AC_CHECK_LIB(Xdmcp, XdmcpWrap,
> @@ -330,7 +330,7 @@ AC_ARG_ENABLE(xf86bigfont,
>                [Disable XF86BigFont extension support]),
>              [XF86BIGFONT=$enableval],[XF86BIGFONT="yes"])
>  if test "x$XF86BIGFONT" = "xyes"; then
> -    PKG_CHECK_MODULES(BIGFONT, xf86bigfontproto,
> +    PKG_CHECK_MODULES(BIGFONT, [xf86bigfontproto >= 1.2.0],

like this. Can you show the warning that was being printed?

--
Dan
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libX11 1/2] Fix warnings for recent bigreqsproto, xcmiscproto, and xf86bigfontproto

2010-02-02 Thread Jeremy Huddleston

On Feb 2, 2010, at 19:49, Dan Nicholson wrote:

>> -   X11_REQUIRES="${X11_REQUIRES} xau xcmiscproto bigreqsproto"
>> +   X11_REQUIRES="${X11_REQUIRES} xau [xcmiscproto >= 1.2.0] 
>> [bigreqsproto >= 1.1.0]"
> 
> Do these actually change anything? autoconf is just going to remove
> the [] after processing through m4, and having >= within quotes in
> shell is fine. There's a lot of this excessive quoting/unquoting in
> the x configure.ac's, and all that's really needed is to make sure
> that the arguments to the autoconf m4 macros are quoted...

I did it more for stylistic reasons.

>> -PKG_CHECK_MODULES(BIGFONT, xf86bigfontproto,
>> +PKG_CHECK_MODULES(BIGFONT, [xf86bigfontproto >= 1.2.0],
> 
> like this. Can you show the warning that was being printed?

I'm not sure what you mean... I thought it was fairly obvious from the commit 
message.

$ echo "#include " | gcc -E - -o /dev/null 
In file included from :1:
./xf86bigfstr.h:1:2: warning: #warning "xf86bigfstr.h is obsolete and may be 
removed in the future."
./xf86bigfstr.h:2:2: warning: #warning "include 
 for the protocol defines."


___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: Failure in detecting keyboard

2010-02-02 Thread Peter Hutterer
On Mon, Feb 01, 2010 at 08:43:58AM +, Sergey Udaltsov wrote:
> Hi Peter
> 
> > Sergey, is there still reason for doing this? I note the commit dates back
> > to 2004.
> Well, at that point in 2004 something did not work without it, so I
> created it. If you're saying that now it is not necessary, I will
> disable that feature forever. No problem at all.

A quick check shows we've disabled this in Fedora since 2006 without any
side effects. I don't know what required it originally, but I'm pretty sure
it not needed anymore now.

Cheers,
  Peter
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel