Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/versioncmp.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-01-24 03:02:53 +0000
committerAaron Griffin <aaron@archlinux.org>2007-01-24 03:02:53 +0000
commit1b61cc8c69025ddd394401a506b21f16df5d4e6d (patch)
treec99b4717e8eeb23295603d60eb97e27cc821a730 /lib/libalpm/versioncmp.c
parent838767205319e5d436194cc4a5aaa08ccf4f6077 (diff)
This mainly deals with code clarity- removing currently unneeded
optimizations in order to make the code much more readable and type-checkable. Every enum in the library now has it's own type that should be used instead of the generic 'unsigned char'. In addition, several #define statements dealing with constants were converted to enums. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Diffstat (limited to 'lib/libalpm/versioncmp.c')
-rw-r--r--lib/libalpm/versioncmp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libalpm/versioncmp.c b/lib/libalpm/versioncmp.c
index 045f2a24..8f7c7389 100644
--- a/lib/libalpm/versioncmp.c
+++ b/lib/libalpm/versioncmp.c
@@ -253,17 +253,19 @@ int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
} else {
int cmp = _alpm_versioncmp(pkg->version, dep->version);
switch(dep->mod) {
- case PM_DEP_MOD_EQ: equal = (cmp == 0); break;
- case PM_DEP_MOD_GE: equal = (cmp >= 0); break;
- case PM_DEP_MOD_LE: equal = (cmp <= 0); break;
+ case PM_DEP_MOD_EQ: equal = (cmp == 0); break;
+ case PM_DEP_MOD_GE: equal = (cmp >= 0); break;
+ case PM_DEP_MOD_LE: equal = (cmp <= 0); break;
+ default: equal = 1; break;
}
}
char *mod = "~=";
switch(dep->mod) {
- case PM_DEP_MOD_EQ: mod = "=="; break;
- case PM_DEP_MOD_GE: mod = ">="; break;
- case PM_DEP_MOD_LE: mod = "<="; break;
+ case PM_DEP_MOD_EQ: mod = "=="; break;
+ case PM_DEP_MOD_GE: mod = ">="; break;
+ case PM_DEP_MOD_LE: mod = "<="; break;
+ default: break;
}
if(strlen(dep->version) > 0) {