On Mon, Oct 17, 2011 at 09:19:02AM +1000, Peter Hutterer wrote: > On Fri, Oct 14, 2011 at 06:42:02PM +0200, Jamey Sharp wrote: > > The GetReq family of macros is so evil. I'm not going to go so far as > > to NAK this patch or anything, but please consider whether you can > > implement this as a proper function or something. Perhaps: > > > > void *XGetReq(CARD8 reqType, size_t sz); > > > > (I think the other macros could be re-implemented on top of that > > function, so long as the function continues to behave in a manner > > compatible with code compiled using the current macros.) > > > > Also, do you care about big-requests here? I can't remember how Xlib > > handles that extension. > > fwiw, GetReqSized is more-or-less a copy of GetReqExtra with one parameter > replaced. And GetReqExtra in turn is a copy of GetReq.
I certainly recognized the pattern. It's an awful pattern and I want it to stop. :-) > From a quick glance neither of them handle big-req directly. If I had looked at the source, I'd have noticed that SetReqLen is apparently the standard way to fix up a request to be a big-request, after GetReq returns a standard one. > I'll have a look at getting this to a function instead of a macro. Thanks! Jamey
signature.asc
Description: Digital signature
_______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel