[MPlayer-dev-eng] [PATCH] Small cleanup in demux_mpg.c
Rich Felker
dalias at aerifal.cx
Tue Feb 27 05:34:45 CET 2007
On Tue, Feb 27, 2007 at 11:35:42AM +0800, Zuxy Meng wrote:
> Use off_t instead of _LARGEFILE_SOURCE macro.
>
> --
> Zuxy
> Beauty is truth,
> While truth is beauty.
> PGP KeyID: E8555ED6
> Index: libmpdemux/demux_mpg.c
> ===================================================================
> --- libmpdemux/demux_mpg.c ???????? 22356??
> +++ libmpdemux/demux_mpg.c ????????????
> @@ -892,11 +893,7 @@
> if(newpos<demuxer->movi_start) newpos=demuxer->movi_start;
> }
>
> -#ifdef _LARGEFILE_SOURCE
> - newpos&=~((long long)STREAM_BUFFER_SIZE-1); /* sector boundary */
> -#else
> - newpos&=~(STREAM_BUFFER_SIZE-1); /* sector boundary */
> -#endif
> + newpos&=~((off_t)STREAM_BUFFER_SIZE-1); /* sector boundary */
Thanks! The old code was actually _incorrect_ since off_t can be
larger than int without _LARGEFILE_SOURCE. (1. because
_LARGEFILE_SOURCE is nonstandard GNU crap, and 2. because off_t is
long even without _LARGEFILE_SOURCE on GNU, and long is 64bit on 64bit
archs)
Rich
More information about the MPlayer-dev-eng
mailing list