(Mode I'm-discovering-the-code on) Michel Dänzer <[email protected]> (26/03/2011): > From: Michel Dänzer <[email protected]> > > The latter calls the former, let's cut the middle man and eliminate a branch > in a hot path. > > Signed-off-by: Michel Dänzer <[email protected]>
Since we have: dixRegisterPrivateKey(&exaScreenPrivateKeyRec, PRIVATE_SCREEN, 0) #define exaScreenPrivateKey (&exaScreenPrivateKeyRec) and others with sizeof() instead… it looks like we're indeed in the right branch of dixLookupPrivate()'s if() in all cases, so that looks fine. Reviewed-by: Cyril Brulebois <[email protected]> > -#define ExaGetPixmapPriv(p) > ((ExaPixmapPrivPtr)dixLookupPrivate(&(p)->devPrivates, exaPixmapPrivateKey)) > -#define ExaSetPixmapPriv(p,a) dixSetPrivate(&(p)->devPrivates, > exaPixmapPrivateKey, a) > +#define ExaGetPixmapPriv(p) > ((ExaPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, exaPixmapPrivateKey)) > #define ExaPixmapPriv(p) ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p (Might be worth noting removing ExaSetPixmapPriv() is intended as it's unused, for those who wouldn't be looking at the actual (inexistent) callers in the current code. But not a prerequisite to my r-b.) KiBi.
signature.asc
Description: Digital signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
