[MPlayer-dev-eng] [PATCH] configure: avoid warning in endian testing

Dominik 'Rathann' Mierzejewski dominik at greysector.net
Mon Sep 20 17:38:46 CEST 2010


On Wednesday, 15 September 2010 at 12:10, Giorgio wrote:
> >> --- configure (revision 32238)
> >> +++ configure (working copy)
> >> @@ -2441,7 +2441,7 @@
> >>    cat > $TMPC <<EOF
> >>  short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
> >>                         (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
> >> -int main(void) { return (int)ascii_name; }
> >> +int main(void) { return ascii_name[0]; }
> >
> > Just casting to long will avoid the warning as well.  I tested it to
> > work as expected on x86_32, x86_64 and PPC.
> 
> Yes, I had tried that too and it actually silenced the warning, since
> on my system sizeof(long int) = sizeof(short int *). If it works well
> on other platforms, then it's probably the best solution.

AFAIR on Win64 long and int are 4 bytes and pointers are 8 bytes long.
The type you're looking for is intptr_t IIRC.

Regards,
Dominik

-- 
MPlayer http://mplayerhq.hu | RPMFusion http://rpmfusion.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan


More information about the MPlayer-dev-eng mailing list