This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=8276dabf7af20c37ada82e84c26f1a3e4657cd83 commit 8276dabf7af20c37ada82e84c26f1a3e4657cd83 Author: Guillem Jover <[email protected]> AuthorDate: Mon Oct 17 01:11:31 2022 +0200 dpkg: Rewrite relationinfos array variable definition Use designated initializers to make the assignments obvious. Changelog: internal --- src/main/enquiry.c | 162 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 143 insertions(+), 19 deletions(-) diff --git a/src/main/enquiry.c b/src/main/enquiry.c index 7cedb5e31..53e7ba0d8 100644 --- a/src/main/enquiry.c +++ b/src/main/enquiry.c @@ -700,29 +700,153 @@ cmpversions(const char *const *argv) }; static const struct relationinfo relationinfos[]= { - /* < = > !a!2!b */ - { "le", 0,0,1, 0,0,1 }, - { "lt", 0,1,1, 0,1,1 }, - { "eq", 1,0,1, 1,0,1 }, - { "ne", 0,1,0, 0,1,0 }, - { "ge", 1,0,0, 1,0,0 }, - { "gt", 1,1,0, 1,1,0 }, + { + .op = "le", + .if_lesser = 0, + .if_equal = 0, + .if_greater = 1, + .if_none_a = 0, + .if_none_both = 0, + .if_none_b = 1, + }, { + .op = "lt", + .if_lesser = 0, + .if_equal = 1, + .if_greater = 1, + .if_none_a = 0, + .if_none_both = 1, + .if_none_b = 1, + }, { + .op = "eq", + .if_lesser = 1, + .if_equal = 0, + .if_greater = 1, + .if_none_a = 1, + .if_none_both = 0, + .if_none_b = 1, + }, { + .op = "ne", + .if_lesser = 0, + .if_equal = 1, + .if_greater = 0, + .if_none_a = 0, + .if_none_both = 1, + .if_none_b = 0, + }, { + .op = "ge", + .if_lesser = 1, + .if_equal = 0, + .if_greater = 0, + .if_none_a = 1, + .if_none_both = 0, + .if_none_b = 0, + }, { + .op = "gt", + .if_lesser = 1, + .if_equal = 1, + .if_greater = 0, + .if_none_a = 1, + .if_none_both = 1, + .if_none_b = 0, + }, /* These treat an empty version as later than any version. */ - { "le-nl", 0,0,1, 1,0,0 }, - { "lt-nl", 0,1,1, 1,1,0 }, - { "ge-nl", 1,0,0, 0,0,1 }, - { "gt-nl", 1,1,0, 0,1,1 }, + { + .op = "le-nl", + .if_lesser = 0, + .if_equal = 0, + .if_greater = 1, + .if_none_a = 1, + .if_none_both = 0, + .if_none_b = 0, + }, { + .op = "lt-nl", + .if_lesser = 0, + .if_equal = 1, + .if_greater = 1, + .if_none_a = 1, + .if_none_both = 1, + .if_none_b = 0, + }, { + .op = "ge-nl", + .if_lesser = 1, + .if_equal = 0, + .if_greater = 0, + .if_none_a = 0, + .if_none_both = 0, + .if_none_b = 1, + }, { + .op = "gt-nl", + .if_lesser = 1, + .if_equal = 1, + .if_greater = 0, + .if_none_a = 0, + .if_none_both = 1, + .if_none_b = 1, + }, /* For compatibility with dpkg control file syntax. */ - { "<", 0,0,1, 0,0,1, .obsolete = true }, - { "<=", 0,0,1, 0,0,1 }, - { "<<", 0,1,1, 0,1,1 }, - { "=", 1,0,1, 1,0,1 }, - { ">", 1,0,0, 1,0,0, .obsolete = true }, - { ">=", 1,0,0, 1,0,0 }, - { ">>", 1,1,0, 1,1,0 }, - { NULL } + { + .op = "<", + .if_lesser = 0, + .if_equal = 0, + .if_greater = 1, + .if_none_a = 0, + .if_none_both = 0, + .if_none_b = 1, + .obsolete = true, + }, { + .op = "<=", + .if_lesser = 0, + .if_equal = 0, + .if_greater = 1, + .if_none_a = 0, + .if_none_both = 0, + .if_none_b = 1, + }, { + .op = "<<", + .if_lesser = 0, + .if_equal = 1, + .if_greater = 1, + .if_none_a = 0, + .if_none_both = 1, + .if_none_b = 1, + }, { + .op = "=", + .if_lesser = 1, + .if_equal = 0, + .if_greater = 1, + .if_none_a = 1, + .if_none_both = 0, + .if_none_b = 1, + }, { + .op = ">", + .if_lesser = 1, + .if_equal = 0, + .if_greater = 0, + .if_none_a = 1, + .if_none_both = 0, + .if_none_b = 0, + .obsolete = true, + }, { + .op = ">=", + .if_lesser = 1, + .if_equal = 0, + .if_greater = 0, + .if_none_a = 1, + .if_none_both = 0, + .if_none_b = 0, + }, { + .op = ">>", + .if_lesser = 1, + .if_equal = 1, + .if_greater = 0, + .if_none_a = 1, + .if_none_both = 1, + .if_none_b = 0, + }, { + .op = NULL, + } }; const struct relationinfo *rip; -- Dpkg.Org's dpkg

