Tiago Vignatti wrote:
> On Tue, Apr 27, 2010 at 04:17:10AM +0200, ext Jamey Sharp wrote:
>> The screen number can be inferred from the position in the vfbScreens
>> array, and it was only used in two places, so it was hardly important.
>
> ...
>
>> - sprintf(pvfb->mmap_file, "%s/Xvfb_screen%d", pfbdir, pvfb->scrnum);
>> + sprintf(pvfb->mmap_file, "%s/Xvfb_screen%d", pfbdir, (int) (pvfb -
>> vfbScreens));
>
> ...
>
>> - ErrorF("screen %d shmid %d\n", pvfb->scrnum, pvfb->shmid);
>> + ErrorF("screen %d shmid %d\n", (int) (pvfb - vfbScreens), pvfb->shmid);
>
> That's a really nice catch :) But hey, do we need to be verbose here? I'd
> prefer to avoid these pointer calculation, which is really bad for readability
> of code.
That could be avoided by just passing scrnum down as an argument through the
vfbAllocate* functions, since it's an argument (index) to the vfbScreenInit()
that calls vfbAllocateFramebufferMemory() in the first place.
--
-Alan Coopersmith- [email protected]
Oracle Solaris Platform Engineering: X Window System
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel