HomeClusterLabs Projects

Refactor: libcrmcommon: define new functions for testing flags

Description

Refactor: libcrmcommon: define new functions for testing flags

This deprecates is_set(), is_set_any(), and is_not_set() in favor of new inline
functions named according to current guidelines. The new names make it obvious
how multiple bits are treated when tested together.

There is no equivalent of is_not_set() because developers often forgot it
existed and just used !is_set(). Also is_set() was replaced by two alternatives,
pcmk_all_flags_set() and pcmk_any_flags_set(), and coming up with equivalent
"not set" functions would have just made things more confusing.

The functions remain public API only so they can be used by other public macros
and inline functions.

Details

Provenance
kgaillotAuthored on Jun 25 2020, 2:30 PM
Parents
rP91a2b2e417d0: Refactor: various: use new boolean-to-string functions where appropriate
Branches
Unknown
Tags
Unknown

Event Timeline