Subject: Re: hpckbd vs. -Wcast-qual
To: None <tech-kern@NetBSD.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: tech-kern
Date: 07/12/2006 18:06:59
On Wed, Jul 12, 2006 at 10:59:45 +0200, Peter Postma wrote:

> > > +	/* fix keydesc table, the UNCONST is "OK". */
> > >  	desc = (struct wscons_keydesc *)__UNCONST(hpckbd_keymapdata.keydesc);
> > >  	for (i = 0; desc[i].name != 0; i++) {
> > >  		if ((desc[i].name & KB_MACHDEP) && desc[i].map == NULL) {
> > 
> > If you drop const from teh array, you don't need __UNCONST (and the
> > comment) here.
> > 
> 
> But the "keydesc" member in struct wskbd_mapdata is marked as const,
> so the compiler will warn if this __UNCONST is removed. I'm not sure
> if it's a good idea to remove that const from the member.

Ah, right.  Should not make quick responces late in the night.

I think we should either deconst recursively or rework the way machdep
layouts are handled.  As long as wscons_keydesc can have machdep
entries, we cannot claim constness.

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/          |       Ist zu Grunde gehen