From 79864c6ec22370ae31d3259a17e0c93db3cdae61 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Tue, 3 May 2022 22:54:33 -0400 Subject: add const to const * strings I don't think this will amke any difference except maybe for hosted ports Change-Id: I84f898aea92a6963901a6d889dd18b63f24c9a41 --- apps/gui/skin_engine/skin_parser.c | 6 +++--- apps/misc.c | 2 +- apps/recorder/albumart.c | 2 +- apps/recorder/recording.c | 2 +- apps/shortcuts.c | 2 +- apps/tagcache.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'apps') diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 1a6861ff16..d89ca8b534 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -601,7 +601,7 @@ static int parse_viewporttextstyle(struct skin_element *element, *line = (struct line_desc)LINE_DESC_DEFINIT; unsigned colour; - static const char *vp_options[] = { "invert", "color", "colour", + static const char * const vp_options[] = { "invert", "color", "colour", "clear", "gradient", NULL}; int vp_op = string_option(mode, vp_options, false); @@ -1401,7 +1401,7 @@ static int parse_skinvar( struct skin_element *element, return 0; case SKIN_TOKEN_VAR_SET: { - static const char *sv_options[] = {"touch", "set", "inc", "dec", NULL}; + static const char * const sv_options[] = {"touch", "set", "inc", "dec", NULL}; struct skin_var_changer *data = skin_buffer_alloc(sizeof(*data)); if (!data) @@ -1705,7 +1705,7 @@ static int parse_touchregion(struct skin_element *element, if (region->action == ACTION_NONE) return WPS_ERROR_INVALID_PARAM; } - static const char *pm_options[] = {"allow_while_locked", "reverse_bar", + static const char * const pm_options[] = {"allow_while_locked", "reverse_bar", "repeat_press", "long_press", NULL}; int pm_op; diff --git a/apps/misc.c b/apps/misc.c index d5e8bb5d98..63aa3589b2 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -1395,7 +1395,7 @@ int split_string(char *str, const char split_char, char *vector[], const int vec /* returns match index from option list * returns -1 if option was not found * option list is array of char pointers with the final item set to null - * ex - const char *option[] = { "op_a", "op_b", "op_c", NULL} + * ex - const char * const option[] = { "op_a", "op_b", "op_c", NULL} */ int string_option(const char *option, const char *const oplist[], bool ignore_case) { diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c index 5b3658a1cb..9ff9c72f80 100644 --- a/apps/recorder/albumart.c +++ b/apps/recorder/albumart.c @@ -98,7 +98,7 @@ static void fix_path_part(char* path, int offset, int count) } #ifdef USE_JPEG_COVER -static const char * extensions[] = { "jpeg", "jpg", "bmp" }; +static const char * const extensions[] = { "jpeg", "jpg", "bmp" }; static const unsigned char extension_lens[] = { 4, 3, 3 }; /* Try checking for several file extensions, return true if a file is found and * leaving the path modified to include the matching extension. diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index a54b762566..db8d892b7c 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -189,7 +189,7 @@ static short balance_mem[BAL_MEM_SIZE]; #define AGC_MODE_SIZE 5 #define AGC_SAFETY_MODE 0 -static const char* agc_preset_str[] = +static const char* const agc_preset_str[] = { "Off", "S", "L", "D", "M", "V" }; /* "Off", "Safety (clip)", diff --git a/apps/shortcuts.c b/apps/shortcuts.c index 754bd83b80..2b032f1fd4 100644 --- a/apps/shortcuts.c +++ b/apps/shortcuts.c @@ -312,7 +312,7 @@ static int readline_cb(int n, char *buf, void *parameters) } else if (sc && settings_parseline(buf, &name, &value)) { - static const char *nm_options[] = {"type", "name", "data", + static const char * const nm_options[] = {"type", "name", "data", "icon", "talkclip", NULL}; int nm_op = string_option(name, nm_options, false); diff --git a/apps/tagcache.c b/apps/tagcache.c index b6d15e7a1f..436d85812b 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -137,7 +137,7 @@ static int tempbuf_handle; (1LU << tag_virt_canonicalartist)) /* String presentation of the tags defined in tagcache.h. Must be in correct order! */ -static const char *tags_str[] = { "artist", "album", "genre", "title", +static const char * const tags_str[] = { "artist", "album", "genre", "title", "filename", "composer", "comment", "albumartist", "grouping", "year", "discnumber", "tracknumber", "canonicalartist", "bitrate", "length", "playcount", "rating", "playtime", "lastplayed", "commitid", "mtime", @@ -151,7 +151,7 @@ static const char *tags_str[] = { "artist", "album", "genre", "title", "tag_virt_entryage", "tag_virt_autoscore" }; /* more debug strings */ -static const char *tag_type_str[] = { +static const char * const tag_type_str[] = { [clause_none] = "clause_none", [clause_is] = "clause_is", [clause_is_not] = "clause_is_not", [clause_gt] = "clause_gt", [clause_gteq] = "clause_gteq", [clause_lt] = "clause_lt", -- cgit v1.2.3