[vlc-devel] [PATCH] libvlc: replace existing title menu bool with int bit mask

Rémi Denis-Courmont remi at remlab.net
Mon Dec 21 13:22:22 CET 2015


Le 2015-12-21 09:10, Steve Lhomme a écrit :
> Would the compiler(s) issue an error if a value ends up out of range
> of an enum ?

As Hugo already noted...
The value must be within the range of 'int'. Anything else is 
undefined.

> Other than that, if the field is only used for bitfield operations, 
> it
> shouldn't matter if the last bit is a sign or not.

Unsigned is of course more natural for bit fields and especially bit 
masks.

For those symbolic constants are better than enumeration members 
anyway:
1) you can use the high order bit (INT_MAX+1),
2) you can use #ifdef.

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list