[vlc-devel] [PATCH 02/16] common: make sure the conversion to mtime_t is in mtime_t
Steve Lhomme
robux4 at ycbcr.xyz
Fri Jun 8 08:28:18 CEST 2018
On 2018-06-07 1:37 PM, Rémi Denis-Courmont wrote:
> I would rather the macro preserve constness, so it can be used in
> static initialization, therefore no casting.
OK
>
> Besides, the value is guaranteed to be (at least) 64-bits because of
> CLOCK_FREQ already.
>
> Le 7 juin 2018 12:59:46 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a
> écrit :
>
> ---
> include/vlc_common.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/vlc_common.h b/include/vlc_common.h
> index d79ed61221..1168f2dc1b 100644
> --- a/include/vlc_common.h
> +++ b/include/vlc_common.h
> @@ -288,7 +288,7 @@
> */
> typedef int64_t mtime_t;
>
> -#define MS_TO_MTIME(ms) ((ms) * (CLOCK_FREQ / 1000))
> +#define MS_TO_MTIME(ms) ((mtime_t)((ms) * (CLOCK_FREQ / 1000)))
> #define MTIME_TO_MS(ms) (((ms) * 1000) / CLOCK_FREQ)
>
>
>
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez
> excuser ma brièveté.
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180608/11ae5e88/attachment.html>
More information about the vlc-devel
mailing list