[PATCH libXext (rev3) 1/5] Backwards compat for newer XSync + older servers

James Jones jajones at nvidia.com
Thu Dec 2 11:13:06 PST 2010


On Thursday 02 December 2010 10:35:27 Julien Cristau wrote:
> On Thu, Dec  2, 2010 at 09:26:27 -0800, James Jones wrote:
> > +    for (i = 0; i < NUM_VERSIONS; i++) {
> > +	if (supported_versions[i].major == rep.majorVersion &&
> > +	    supported_versions[i].minor == rep.minorVersion) {
> > +	    return &supported_versions[i];
> > +	}
> > +    }
> > +
> 
> Should this look for the highest pair that has major == rep.majorVersion
> and minor <= rep.minorVersion, so you don't need to add every minor
> version that doesn't change the number of errors?

Hmm, that would break the XSyncInitialize() function unless I added code to 
dynamically allocate the version structure stored in the display extension 
structure and patched up the minor version.  I was trying to avoid dynamically 
allocating the version info so I wouldn't need to handle allocation failures 
in find_display_create_optional() and hand code close display to tear it down.  
The current code also matches libXi's event setup behavior, which this code is 
based on.

Which do you think is best?  Requiring upates to the list of versions on every 
protocol version bump, or dynamically allocating the version info stored in 
the display ext struct?

-James

> Cheers,
> Julien


More information about the xorg-devel mailing list