[PATCH] xres: Return the atom naming the type, not its internal type number

Adam Jackson ajax at redhat.com
Wed Dec 9 06:27:55 PST 2015


On Wed, 2015-12-09 at 13:37 +0000, Eric Engestrom wrote:
> On 08/12/15 20:08, Adam Jackson wrote:
> 
> > +resourceTypeAtom(int i)
> > +{
> > +    CARD32 ret;
> > +
> > +    const char *name = LookupResourceName(i);
> > +    if (strcmp(name, XREGISTRY_UNKNOWN))
> > +        ret = MakeAtom(name, strlen(name), TRUE);
> > +    else {
> > +        char buf[40];
> > +
> > +        snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
> 
> Shouldn't that be just `i` ?

Probably? It's just factoring out what we were doing before. Though
honestly this whole code path is pretty useless if you're building
without X_RESOURCE_REGISTRY, which is the only way you should be able
to get XREGISTRY_UNKNOWN here. It might make sense in that case to cap
the extension at version 1.1, or throw BadImplementation for the 1.2
requests.

I've got a much longer series of xres accounting updates in the queue,
I'll rework this patch when I've got that in shape.

- ajax


More information about the xorg-devel mailing list