[mplayer-dev at kernel.dk: [MPlayer-dev-eng] [PATCH] sizeof(int) != sizeof(pointer)]

Jens Axboe mplayer-dev at kernel.dk
Wed Mar 12 21:31:21 CET 2003


On Wed, Mar 12 2003, D Richard Felker III wrote:
> On Wed, Mar 12, 2003 at 01:24:52PM +0100, Jens Axboe wrote:
> > On Wed, Mar 12 2003, D Richard Felker III wrote:
> > > On Wed, Mar 12, 2003 at 11:46:10AM +0100, Jens Axboe wrote:
> > > > 
> > > > Is someone going to commit this or not? It's clearly a bug.
> > > > 
> > > > ----- Forwarded message from Jens Axboe <mplayer-dev at kernel.dk> -----
> > > > 
> > > > From: Jens Axboe <mplayer-dev at kernel.dk>
> > > > Reply-To: mplayer-dev-eng at mplayerhq.hu
> > > > Date: Tue, 11 Mar 2003 10:39:28 +0100
> > > > To: mplayer-dev-eng at mplayerhq.hu
> > > > Subject: [MPlayer-dev-eng] [PATCH] sizeof(int) != sizeof(pointer)
> > > > 
> > > > Hi,
> > > > 
> > > > Should not need a lot of comments, this is pretty basic. Though shallt
> > > > not cast pointers to ints, on 64-bit archs this is really bad. Below
> > > > patch fixes segfault on volume up/down for me with mplayer cvs.
> > > 
> > > There is definitely a bug but this is not the correct fix. A quick
> > > glance seems to indicate that the second argument to control() is
> > > always a pointer, so it should just be declared to take a void *!!!
> > > 1000l to whoever wrote that mess!
> > 
> > Well that is fine, fix it that way if you want. As long as it will hold
> > a pointer. void * is just as, if not more so, ugly as unsigned long,
> > though :)
> 
> Sorry if you thought the 1000l was for you; it was for whoever

I don't even know what 1000l means, fwiw...

> originally wrote the mess in libao2. And void * is better, since it's
> guaranteed to work and unsigned long isn't. (it's possible that
> unsigned long is not as big as a pointer!)

void * might be better because it avoids some casts in this case,
however unsigned long will hold a pointer across all archs I know. In
fact, lots of software relies on this fact. So there's no difference
there.

-- 
Jens Axboe



More information about the MPlayer-dev-eng mailing list