From: Richard Russon Date: Sun, 9 Dec 2018 14:55:20 +0000 (+0000) Subject: globals: upper case X-Git-Tag: 2019-10-25~452^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c33f48b8a0be5e4bd9f2516c9f76971702eec118;p=neomutt globals: upper case --- diff --git a/config/bool.c b/config/bool.c index 6b413d009..e2c6b80ae 100644 --- a/config/bool.c +++ b/config/bool.c @@ -40,11 +40,11 @@ #include "types.h" /** - * bool_values - Valid strings for creating a Bool + * BoolValues - Valid strings for creating a Bool * * These strings are case-insensitive. */ -const char *bool_values[] = { +const char *BoolValues[] = { "no", "yes", "n", "y", "false", "true", "0", "1", "off", "on", NULL, }; @@ -58,9 +58,9 @@ static int bool_string_set(const struct ConfigSet *cs, void *var, struct ConfigD return CSR_ERR_CODE; /* LCOV_EXCL_LINE */ int num = -1; - for (size_t i = 0; bool_values[i]; i++) + for (size_t i = 0; BoolValues[i]; i++) { - if (mutt_str_strcasecmp(bool_values[i], value) == 0) + if (mutt_str_strcasecmp(BoolValues[i], value) == 0) { num = i % 2; break; @@ -118,7 +118,7 @@ static int bool_string_get(const struct ConfigSet *cs, void *var, return CSR_ERR_INVALID | CSR_INV_TYPE; } - mutt_buffer_addstr(result, bool_values[index]); + mutt_buffer_addstr(result, BoolValues[index]); return CSR_SUCCESS; } diff --git a/config/bool.h b/config/bool.h index 75f7c4d2e..112adefe4 100644 --- a/config/bool.h +++ b/config/bool.h @@ -27,7 +27,7 @@ struct Buffer; struct ConfigSet; struct HashElem; -extern const char *bool_values[]; +extern const char *BoolValues[]; void bool_init(struct ConfigSet *cs); int bool_he_toggle(struct ConfigSet *cs, struct HashElem *he, struct Buffer *err); diff --git a/config/magic.c b/config/magic.c index 3a6652838..78678dff2 100644 --- a/config/magic.c +++ b/config/magic.c @@ -38,9 +38,11 @@ #include "types.h" /** - * magic_values - Valid strings for mailbox types + * MagicValues - Valid strings for mailbox types + * + * These strings are case-insensitive. */ -const char *magic_values[] = { +const char *MagicValues[] = { NULL, "mbox", "MMDF", "MH", "Maildir", NULL, }; @@ -60,9 +62,9 @@ static int magic_string_set(const struct ConfigSet *cs, void *var, struct Config } int num = -1; - for (size_t i = 1; magic_values[i]; i++) + for (size_t i = 1; MagicValues[i]; i++) { - if (mutt_str_strcasecmp(magic_values[i], value) == 0) + if (mutt_str_strcasecmp(MagicValues[i], value) == 0) { num = i; break; @@ -114,13 +116,13 @@ static int magic_string_get(const struct ConfigSet *cs, void *var, else value = (int) cdef->initial; - if ((value < 1) || (value >= (mutt_array_size(magic_values) - 1))) + if ((value < 1) || (value >= (mutt_array_size(MagicValues) - 1))) { mutt_debug(1, "Variable has an invalid value: %d\n", value); return CSR_ERR_INVALID | CSR_INV_TYPE; } - mutt_buffer_addstr(result, magic_values[value]); + mutt_buffer_addstr(result, MagicValues[value]); return CSR_SUCCESS; } @@ -133,7 +135,7 @@ static int magic_native_set(const struct ConfigSet *cs, void *var, if (!cs || !var || !cdef) return CSR_ERR_CODE; /* LCOV_EXCL_LINE */ - if ((value < 1) || (value >= (mutt_array_size(magic_values) - 1))) + if ((value < 1) || (value >= (mutt_array_size(MagicValues) - 1))) { mutt_buffer_printf(err, "Invalid magic value: %ld", value); return CSR_ERR_INVALID | CSR_INV_TYPE; diff --git a/config/magic.h b/config/magic.h index a3166004f..c5080dd0a 100644 --- a/config/magic.h +++ b/config/magic.h @@ -25,7 +25,7 @@ struct ConfigSet; -extern const char *magic_values[]; +extern const char *MagicValues[]; /** * enum MailboxType - Supported mailbox formats diff --git a/config/quad.c b/config/quad.c index f84127410..efcbc65bb 100644 --- a/config/quad.c +++ b/config/quad.c @@ -39,11 +39,11 @@ #include "types.h" /** - * quad_values - Valid strings for creating a QuadValue + * QuadValues - Valid strings for creating a QuadValue * * These strings are case-insensitive. */ -const char *quad_values[] = { +const char *QuadValues[] = { "no", "yes", "ask-no", "ask-yes", NULL, }; @@ -57,9 +57,9 @@ static int quad_string_set(const struct ConfigSet *cs, void *var, struct ConfigD return CSR_ERR_CODE; /* LCOV_EXCL_LINE */ int num = -1; - for (size_t i = 0; quad_values[i]; i++) + for (size_t i = 0; QuadValues[i]; i++) { - if (mutt_str_strcasecmp(quad_values[i], value) == 0) + if (mutt_str_strcasecmp(QuadValues[i], value) == 0) { num = i; break; @@ -111,13 +111,13 @@ static int quad_string_get(const struct ConfigSet *cs, void *var, else value = (int) cdef->initial; - if (value >= (mutt_array_size(quad_values) - 1)) + if (value >= (mutt_array_size(QuadValues) - 1)) { mutt_debug(1, "Variable has an invalid value: %d\n", value); return CSR_ERR_INVALID | CSR_INV_TYPE; } - mutt_buffer_addstr(result, quad_values[value]); + mutt_buffer_addstr(result, QuadValues[value]); return CSR_SUCCESS; } @@ -130,7 +130,7 @@ static int quad_native_set(const struct ConfigSet *cs, void *var, if (!cs || !var || !cdef) return CSR_ERR_CODE; /* LCOV_EXCL_LINE */ - if ((value < 0) || (value >= (mutt_array_size(quad_values) - 1))) + if ((value < 0) || (value >= (mutt_array_size(QuadValues) - 1))) { mutt_buffer_printf(err, "Invalid quad value: %ld", value); return CSR_ERR_INVALID | CSR_INV_TYPE; @@ -238,7 +238,7 @@ int quad_he_toggle(struct ConfigSet *cs, struct HashElem *he, struct Buffer *err char *var = cdef->var; char value = *var; - if ((value < 0) || (value >= (mutt_array_size(quad_values) - 1))) + if ((value < 0) || (value >= (mutt_array_size(QuadValues) - 1))) { mutt_buffer_printf(err, "Invalid quad value: %ld", value); return CSR_ERR_INVALID | CSR_INV_TYPE; diff --git a/config/quad.h b/config/quad.h index efe04fe9e..98f623a9a 100644 --- a/config/quad.h +++ b/config/quad.h @@ -27,7 +27,7 @@ struct Buffer; struct ConfigSet; struct HashElem; -extern const char *quad_values[]; +extern const char *QuadValues[]; /** * enum QuadOption - Possible values for a quad-option diff --git a/test/config/magic.c b/test/config/magic.c index 1db4ea557..8d0c4b249 100644 --- a/test/config/magic.c +++ b/test/config/magic.c @@ -147,7 +147,7 @@ static bool test_initial_values(struct ConfigSet *cs, struct Buffer *err) return false; } - TEST_MSG("Cherry = %s\n", magic_values[VarCherry]); + TEST_MSG("Cherry = %s\n", MagicValues[VarCherry]); TEST_MSG("Cherry's initial value is %s\n", value.data); FREE(&value.data);