Draft: [RFC] vlc_tick: add conversion variants for variables
- The upper case variants should be for constants.
- The lower case variants should be for variables, ultimately checking for overflows.
Ultimately the lower case variants should return an error when a multiplication overflowed.
With the current value of CLOCK_FREQ
, the conversions that can overflow are:
- vlc_tick_from_ms() (167 occurences)
- vlc_tick_to_ns() (4 occurences)
- vlc_tick_to_msft() (11 occurences)
- vlc_tick_from_seci() (100+ occurences, hard to tell with the generic)
v6: only the new functions with error check are added. We can call them when we encounter issues in the code.
The unsigned variant of compat version is still needed. Or we may just call mul_overflow()
.
Edited by Steve Lhomme