[vlc-devel] [PATCH] introduce CLIP() macro to replace use pair of __MAX() and __MIN()

Rob Jonson rob at hobbyistsoftware.com
Tue Nov 15 22:59:28 CET 2011


Isn't CLAMP more common?

#define CLAMP(x, low, high)  (((x) > (high)) ? (high) : (((x) < (low))
? (low) : (x)))

from
http://developer.gnome.org/glib/2.30/glib-Standard-Macros.html#CLAMP:CAPS

VLC_CLAMP ?

Rob

2011/11/15 Rémi Denis-Courmont <remi at remlab.net>:
> Le mardi 15 novembre 2011 18:01:54 Rafaël Carré, vous avez écrit :
>> We should use __CLIP like the old macros, or use a prefix like VLC_CLIP
>> (because _ prefixes are illegal according to C standard)
>
> The whole point is to be concise though.
>
> That said, I don't like __MAX and __MIN because they are not expansion safe.
> And this is also not expansion-safe :(
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> http://fi.linkedin.com/in/remidenis
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
>



More information about the vlc-devel mailing list