dummy (or not) question about AllocateWindow ()
ajax at nwnk.net
Fri Jun 23 08:25:34 PDT 2006
On Wednesday 21 June 2006 13:52, Carlos Eduardo Rodrigues Diógenes wrote:
> In AllocateWindow () from dix/window.c what this line does:
> ppriv = (DevUnion *)(pWin + 1);
> It's after the first *if* of the function.
> I can't realize this operation. This appear to cast the XID (the 4th
> byte) in DrawableRec (the first struct in _Window) to a DevUnion and
> then make the devPrivate point to the same place.
(pWin + 1) evaluates first. pWin is a pointer; pointer arithmetic works like
arrays, incrementing a pointer gives you a pointer to the memory just after
the object (struct, union, or primitive type) originally pointed to.
We then change the type of that pointer from WindowPtr to DevUnion *, and
assign it to ppriv.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the xorg