Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.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 /lib/libalpm/sync.c
parenta55adb81d0f6fcd7fe98cc444806b3b0d25efc9c (diff)
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 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 65c1bbc6..837639d4 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -1056,7 +1056,7 @@ static int check_keyring(alpm_handle_t *handle)
for(i = handle->trans->add; i; i = i->next, current++) {
alpm_pkg_t *pkg = i->data;
- alpm_siglevel_t level;
+ int level;
int percent = (current * 100) / numtargs;
PROGRESS(handle, ALPM_PROGRESS_KEYRING_START, "", percent,
@@ -1126,8 +1126,8 @@ static int check_validity(alpm_handle_t *handle,
alpm_pkg_t *pkg;
char *path;
alpm_siglist_t *siglist;
- alpm_siglevel_t level;
- alpm_pkgvalidation_t validation;
+ int siglevel;
+ int validation;
alpm_errno_t error;
};
size_t current = 0;
@@ -1151,10 +1151,10 @@ static int check_validity(alpm_handle_t *handle,
current_bytes += v.pkg->size;
v.path = _alpm_filecache_find(handle, v.pkg->filename);
- v.level = alpm_db_get_siglevel(alpm_pkg_get_db(v.pkg));
+ v.siglevel = alpm_db_get_siglevel(alpm_pkg_get_db(v.pkg));
if(_alpm_pkg_validate_internal(handle, v.path, v.pkg,
- v.level, &v.siglist, &v.validation) == -1) {
+ v.siglevel, &v.siglist, &v.validation) == -1) {
struct validity *invalid;
v.error = handle->pm_errno;
MALLOC(invalid, sizeof(struct validity), return -1);
@@ -1181,9 +1181,9 @@ static int check_validity(alpm_handle_t *handle,
_("%s: missing required signature\n"), v->pkg->name);
} else if(v->error == ALPM_ERR_PKG_INVALID_SIG) {
_alpm_process_siglist(handle, v->pkg->name, v->siglist,
- v->level & ALPM_SIG_PACKAGE_OPTIONAL,
- v->level & ALPM_SIG_PACKAGE_MARGINAL_OK,
- v->level & ALPM_SIG_PACKAGE_UNKNOWN_OK);
+ v->siglevel & ALPM_SIG_PACKAGE_OPTIONAL,
+ v->siglevel & ALPM_SIG_PACKAGE_MARGINAL_OK,
+ v->siglevel & ALPM_SIG_PACKAGE_UNKNOWN_OK);
prompt_to_delete(handle, v->path, v->error);
} else if(v->error == ALPM_ERR_PKG_INVALID_CHECKSUM) {
prompt_to_delete(handle, v->path, v->error);