[MPlayer-dev-eng] Re: [PATCH] updated diff for libdvdread-0.9.5

Rich Felker dalias at aerifal.cx
Wed Apr 19 15:53:41 CEST 2006


On Wed, Apr 19, 2006 at 04:32:06AM -0400, The Wanderer wrote:
> Rich Felker wrote:
> 
> >On Tue, Apr 18, 2006 at 04:42:02PM +0200, Diego Biurrun wrote:
> >
> >>On Wed, Mar 22, 2006 at 10:45:02PM +0100, Emanuele Giaquinta wrote:
> >>
> >>>This patch fixes the rtp demuxer with the new libdvdread;
> >>>ifo_types.h needs the macros UINT8_MAX UINT16_MAX and INT32_MAX,
> >>>in stdint.h, which are not defined when the language is c++
> >>>unless
> >>>__STDC_LIMIT_MACROS
> >>>is defined.
> >>
> >>Patch applied, thanks.
> >
> >Incidentally, using UINT8_MAX UINT16_MAX and INT32_MAX is absolutely
> >idiotic. These are not system-specific limits but the numbers 255,
> >65535, and 2147483647.
> 
> That doesn't necessarily make it idiotic to use symbolic names for them;
> it makes the code (potentially/arguably) more readable, by referring to
> the reason why this specific number is being used instead of just having
> an apparently arbitrary number. I've done vaguely similar things in some
> of my own code, a few times in the past, albeit with names I defined
> myself rather than more broadly general ones.

(1<<8)-1, etc. are quite readable and explicit at the same time..
Same goes for 0xff, 0xffff, ...

Rich




More information about the MPlayer-dev-eng mailing list