[vlc-devel] commit: Used uint64_t for access_t::info.i_size/i_pos and access_t::pf_seek (). (Laurent Aimar )

Laurent Aimar fenrir at via.ecp.fr
Fri Jan 22 09:42:22 CET 2010


On Fri, Jan 22, 2010, Rémi Denis-Courmont wrote:
> On Fri, 22 Jan 2010 00:20:06 +0100 (CET), git at videolan.org (git version
> control) wrote:
> > vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Jan 21
> > 21:36:07 2010 +0100| [2e847d8484163b50d8fe98350f3dc96ac8a1a43f] |
> > committer: Laurent Aimar
> > 
> > Used uint64_t for access_t::info.i_size/i_pos and access_t::pf_seek().
> 
> -    if (url_seek(sys->context, position, SEEK_SET) < 0) {
> -        msg_Err(access, "Seek to %"PRIi64" failed\n", position);
> +    if (position >= INT64_MIN ||
> +        url_seek(sys->context, position, SEEK_SET) < 0) {
> +        msg_Err(access, "Seek to %"PRIu64" failed\n", position);
>          if (access->info.i_size <= 0 || position != access->info.i_size)
>              return VLC_EGENERIC;
> 
> Because INT64_MIN will be promoted to an unsigned value, this works.
> But wouldn't 'position > INT64_MAX' be more intuitive?
 Good catch, yes, it is a typo, INT64_MAX should have been used.

-- 
fenrir



More information about the vlc-devel mailing list