summaryrefslogtreecommitdiff
path: root/src/pacman/conf.c
diff options
context:
space:
mode:
authorIvy Foster <ivy.foster@gmail.com>2016-10-12 15:13:32 -0500
committerAllan McRae <allan@archlinux.org>2016-10-22 20:50:55 +1000
commitfa06951d90fee028ece95fc7caab39fc7d35d55f (patch)
tree7bdda990838eb07f2adf5b64b7965c2dcd51cad9 /src/pacman/conf.c
parenta55adb81d0f6fcd7fe98cc444806b3b0d25efc9c (diff)
downloadpacman-fa06951d90fee028ece95fc7caab39fc7d35d55f.tar.xz
Represent bitfields as ints, not enums
Many bitfield variables are declared to be enums, because they are generated using bitwise operations on enums such. However, their actual values aren't necessary members of their parent enum, so declaring them 'int' is more accurate. Signed-off-by: Ivy Foster <ivy.foster@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src/pacman/conf.c')
-rw-r--r--src/pacman/conf.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 25de7afa..d8d64fb0 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -325,10 +325,10 @@ int config_set_arch(const char *arch)
* @param linenum current line number in file
* @return 0 on success, 1 on any parsing error
*/
-static int process_siglevel(alpm_list_t *values, alpm_siglevel_t *storage,
- alpm_siglevel_t *storage_mask, const char *file, int linenum)
+static int process_siglevel(alpm_list_t *values, int *storage,
+ int *storage_mask, const char *file, int linenum)
{
- alpm_siglevel_t level = *storage, mask = *storage_mask;
+ int level = *storage, mask = *storage_mask;
alpm_list_t *i;
int ret = 0;
@@ -421,13 +421,12 @@ static int process_siglevel(alpm_list_t *values, alpm_siglevel_t *storage,
}
/**
- * Merge the package entires of two signature verification levels.
+ * Merge the package entries of two signature verification levels.
* @param base initial siglevel
- * @param over overridden siglevel
+ * @param over overriding siglevel
* @return merged siglevel
*/
-static alpm_siglevel_t merge_siglevel(alpm_siglevel_t base,
- alpm_siglevel_t over, alpm_siglevel_t mask)
+static int merge_siglevel(int base, int over, int mask)
{
return mask ? (over & mask) | (base & ~mask) : over;
}
@@ -845,11 +844,11 @@ struct section_t {
int depth;
};
-static int process_usage(alpm_list_t *values, alpm_db_usage_t *usage,
+static int process_usage(alpm_list_t *values, int *usage,
const char *file, int linenum)
{
alpm_list_t *i;
- alpm_db_usage_t level = *usage;
+ int level = *usage;
int ret = 0;
for(i = values; i; i = i->next) {