xserver: Branch 'master'

Matthias Hopf mhopf at suse.de
Thu Nov 23 09:13:48 PST 2006


On Nov 17, 06 17:40:01 +0100, Matthias Hopf wrote:
> On Nov 17, 06 13:54:07 +0000, Daniel Stone wrote:
> > On Fri, Nov 17, 2006 at 01:44:15PM +0100, Matthias Hopf wrote:
> > > Hm. All cases I've seen so far set i->identifier explicitely to NULL at
> > > the end of the list.
> > 
> > Right, but identifier is not guaranteed to be non-NULL for valid
> > entries.
> 
> So you're basically saying all this code is broken because it has no
> real end-of-list marking? Great. Seems like another place for general
> overhaul... :-/

I finally got some time and scanned the code. You really sure about
identifiers not guaranteed to be != NULL? Then we have a much larger
problem. Please correct me if I'm completely mistaken here.

If this problem *does* exist, I can either just *make* identifier !=
NULL always, or rehaul the whole code...

Up to a first scan there are currently 8 places in xf86Config.c that
rely on identifier being NULL only(!) at the end of the list:


366
    while (xf86ConfigLayout.inactives[j++].identifier)
        count++;

380
    while (xf86ConfigLayout.inactives[j].identifier)
        modulearray[count++] = xf86ConfigLayout.inactives[j++].driver;

421
        while (idp->identifier) {
            count++;
            idp++;
        }

436
    while (idp->identifier) {
        modulearray[count] = idp->driver;
        count++;
        idp++;
    }

1160
    for (indp = servlayoutp->inputs; indp->identifier; indp++) {
        [...]

1225
            for (indp = servlayoutp->inputs; indp->identifier; indp++)
                if (indp == corePointer)
                    break;

1228
            for (; indp->identifier; indp++)
                indp[0] = indp[1];

1310 (mine)
    for (i = servlayoutp->inputs; i->identifier && i->driver; i++) {
        if (!strcmp(i->driver, "void") || !strcmp(i->driver, "mouse")) {
            found = 1; break;
        }
    }

1351
            for (indp = servlayoutp->inputs; indp->identifier; indp++)
                if (indp == coreKeyboard)
                    break;


CU

Matthias

-- 
Matthias Hopf <mhopf at suse.de>       __        __   __
Maxfeldstr. 5 / 90409 Nuernberg    (_   | |  (_   |__         mat at mshopf.de
Phone +49-911-74053-715            __)  |_|  __)  |__  labs   www.mshopf.de



More information about the xorg mailing list