[MPlayer-dev-eng] Fixing the GCC-3.3 and scale code mess
Zoltan Hidvegi
mplayer at hzoli.2y.net
Tue Jun 28 22:48:43 CEST 2005
Rich Felker wrote:
> I have a proposal to fix all this mess. It seems like the problems is
> coming from having to "fix" constraints like "m"((long)width) which
> gcc4 does not like. Can we PLEASE just change all the functions to
> take long arguments instead of int? It will make no difference on x86,
> but it will allow us to remove all the casts on x86-64 so that no ugly
> hacks are needed to load the values into the asm.
>
> Opinions? IMO this is by far the simplest fix...
Yes, that's the best solution, and it will even speed up C code on
64-bit machines, as the compiler no longer need to generate
unnecessary truncate and extend instructions. int and unsigned local
variables and function arguments should all be changed to long and
unsigned long, and everyone should kick the habbit of using int. int
and unsigned should *never* be used, if someone needs a specific data
size, use int32_t, otherwise, use long and unsigned long. I tend to
like unsigned long the most, but it is too long to write, so I usually
like to have a typedef to ulong. But ulong is defined by some systems
in system headers, so it is a bit of mess to get it right, because in
C, you cannot typedef ulong if it was already typedefed before, even
if it is the same type.
Zoli
More information about the MPlayer-dev-eng
mailing list