[MPlayer-dev-eng] [PATCH] More accurate af_volume
D Richard Felker III
dalias at aerifal.cx
Mon Feb 21 20:08:05 CET 2005
On Mon, Feb 21, 2005 at 10:40:15AM -0600, Zoltan Hidvegi wrote:
> Alex Beregszaszi wrote:
> > > That of course makes sense, but i think we should still not assume it
> > > is always 32bit when writing code and using the standard type int.
> >
> > the appropriate inttypes should be used wherever needed (int32_t, etc),
> > this solves the confusion, or at least only one side has to be fixed,
> > the inttypes.h (or stdint.h in later carnations)
>
> But I'm sure that mplayer is full of code which assumes that int is at
> least 32-bits. I think the best is to use long everywhere where no
> specific bit size is needed, because long has the same size as the
> native machine register on all 32 and 64-bit platforms I know. But
> sometimes I still use int, it's hard to get rid of old habits.
yes. using int32_t etc is VERY BAD practice unless you specifically
need the exact size, e.g. for addressing a video or sound buffer.
otherwise you just make your code slow and ugly to read, like faad
(which uses int16_t all over the place for no reason whatsoever).
rich
More information about the MPlayer-dev-eng
mailing list