From 407ec31d1acee5a78ecc5b4cf0d91f8cd3c99990 Mon Sep 17 00:00:00 2001 From: Otavio Pontes Date: Thu, 14 Mar 2019 13:29:00 -0700 Subject: [PATCH] search: Use allcaps for enum values All caps for enum is the standard we use on swupd and it's easier to read. Signed-off-by: Otavio Pontes --- src/search.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/search.c b/src/search.c index 4b9164c1..8121f761 100644 --- a/src/search.c +++ b/src/search.c @@ -39,13 +39,13 @@ bool csv_format = false; bool init = false; enum sort_type { - alpha, - size + SORT_TYPE_ALPHA, + SORT_TYPE_SIZE }; static char search_type = '0'; static int num_results = INT_MAX; -static int sort = alpha; +static int sort = SORT_TYPE_ALPHA; /* bundle_result contains the information to print */ struct bundle_result { @@ -341,9 +341,9 @@ static bool parse_opt(int opt, char *optarg) switch (opt) { case 'o': if (!strcmp(optarg, "alpha")) { - sort = alpha; + sort = SORT_TYPE_ALPHA; } else if (!strcmp(optarg, "size")) { - sort = size; + sort = SORT_TYPE_SIZE; } else { error("Invalid --order argument\n\n"); return false; @@ -553,10 +553,10 @@ static enum swupd_code do_search(struct manifest *MoM, char search_type, char *s } list_free_list_and_data(bundle_info, free_bundle_result_data); - if (sort == alpha) { + if (sort == SORT_TYPE_ALPHA) { /* sort alphabetically */ sort_results(); - } else if (sort == size) { + } else if (sort == SORT_TYPE_SIZE) { /* sort by bundle size */ results = list_sort(results, bundle_size_cmp); }