Subject: Re: mmap problems
To: Matthias Scheler <tron@zhadum.de>
From: Chuck Silvers <chuq@chuq.com>
List: tech-x11
Date: 06/10/2001 18:11:19
what is this "offset" supposed to be, anyway?
if it's a memory or bus address, defining it as "int"
may make it impossible to support this on a 64-bit platform.

making it "unsigned int" will also fix the sign-extension problem,
but I don't know if that will make things any better on a 64-bit platform.

-Chuck


On Sun, Jun 10, 2001 at 12:17:21PM +0000, Matthias Scheler wrote:
> In article <20010527224700.S23342-100000@blackhole.invisible.ca>,
> 	"Jared D. McNeill" <jmcneill@invisible.yi.org> writes:
> > In xsrc/xc/lib/Xxf86dga/XF86DGA.c, in XF86DGAGetVideo(), I changed the line:
> >    int offset, fd;
> > to read:
> >    int fd;
> >    unsigned long offset;
> > 
> > The libXxf86dga code compiles (with a warning), but snes9x works like a
> > charm with DGA (and as a result, full-screen mode works now too).
> 
> This is incorret because it will cause serious problems on LP64 systems.
> A few lines later you will find this code:
> 
>    XF86DGAGetVideoLL(dis, screen , &offset, width, bank, ram);
> 
> And "XF86DGAGetVideoLL" expects a pointer to an "int" (32Bit on LP64) while
> with your patch it will get a pointer to a "unsigned long" (64Bit on LP64).
> 
> 	Kind regards
> 
> -- 
> Matthias Scheler                                  http://scheler.de/~matthias/