<html><head></head><body>What happens with vlc_align(INT_MAX, 2) then?<br><br><div class="gmail_quote">Le 13 février 2020 11:03:11 GMT+02:00, Thomas Guillem <thomas@gllm.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">What about using intmax_t (and not uintmax_t) ?<br><br>Rémi, is this a good use case ?<br><br>On Thu, Feb 13, 2020, at 08:14, Steve Lhomme wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">On 2020-02-12 18:54, Marvin Scholz wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">On 12 Feb 2020, at 17:41, Rémi Denis-Courmont wrote:<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">Le keskiviikkona 12. helmikuuta 2020, 15.50.12 EET Marvin Scholz a <br>écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;"><hr>  include/vlc_common.h | 11 +++++++++++<br>  1 file changed, 11 insertions(+)<br><br> diff --git a/include/vlc_common.h b/include/vlc_common.h<br> index e4c5cd85c9..9d9d0375c9 100644<br> --- a/include/vlc_common.h<br> +++ b/include/vlc_common.h<br> @@ -548,6 +548,17 @@ typedef int ( * vlc_list_callback_t ) ( <br> vlc_object_t *,<br>      /* variable's objec /* clip v in [min, max] */<br>  #define VLC_CLIP(v, min, max)    __MIN(__MAX((v), (min)), (max))<br><br> +/**<br> + * Make integer v a multiple of align<br> + *<br> + * \note align must be a power of 2<br> + */<br> +VLC_USED<br> +static inline size_t vlc_align(size_t v, size_t align)<br> +{<br> +    return ((v) + ((align) - 1)) & ~((align) - 1);<br></blockquote> Useless parenthesis.<br><br></blockquote>Thanks, fixed locally.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;">+}<br>+<br></blockquote> This is an intrinsically questionable case because it should be a <br> function for<br> expansion safety, but a macro to expand as a constant (e.g., as an array<br> sizes) - which are contradictory requirements.<br><br></blockquote>Yeah I agree it’s not ideal, although currently there is no case where <br>it is<br>used as a constant.<br></blockquote>So LGTM.<br><br>Also I'm not sure aligning a constant make sense. Just set the constant <br>properly in the first place.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">I have no strong opinions here at all, it just made<br>sense to me to have it in common seeing how many modules use it.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;"> /** Greatest common divisor */<br> VLC_USED<br> static inline int64_t GCD ( int64_t a, int64_t b )<br></blockquote> -- <br> レミ・デニ-クールモン<br> <a href="http://www.remlab.net/">http://www.remlab.net/</a><hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>