diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-09-21 11:10:14 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-09-21 11:10:14 +0300 |
commit | 2fb15a5443c6a1461a53309d3d4ace598996d8b2 (patch) | |
tree | 0ff55a624360ff16a554c801be4873164d1bf226 /lib/rpmpol.h | |
parent | b9168b67355d2da8f62f880adfce37c0e38720d1 (diff) | |
download | rpm-2fb15a5443c6a1461a53309d3d4ace598996d8b2.tar.gz rpm-2fb15a5443c6a1461a53309d3d4ace598996d8b2.tar.bz2 rpm-2fb15a5443c6a1461a53309d3d4ace598996d8b2.zip |
Stop abusing enum typedefs for bitfield types
- Enums are fine for defining the bitfield flags, but the bitfield
itself is not an enumeration. Add a separate typedef on "rpmFlags"
type (presenting a bitfield of flags) for all of these. Compilers
hardly care, but the typedefs give a nice visual clue for
us humans using these flags far away from ho^H^H definitions.
Diffstat (limited to 'lib/rpmpol.h')
-rw-r--r-- | lib/rpmpol.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rpmpol.h b/lib/rpmpol.h index ee74a84fc..f5aef28ad 100644 --- a/lib/rpmpol.h +++ b/lib/rpmpol.h @@ -6,14 +6,18 @@ * Structure(s) used for policy sets. */ +#include <rpm/rpmtypes.h> + #ifdef __cplusplus extern "C" { #endif -typedef enum rpmpolFlags_e { +enum rpmpolFlags_e { RPMPOL_FLAG_NONE = 0, RPMPOL_FLAG_BASE = (1 << 0) -} rpmpolFlags; +}; + +typedef rpmFlags rpmpolFlags; #define RPMPOL_TYPE_DEFAULT "default" |