add const to const * strings

I don't think this will amke any difference except maybe for hosted ports

Change-Id: I84f898aea92a6963901a6d889dd18b63f24c9a41
This commit is contained in:
William Wilgus 2022-05-03 22:54:33 -04:00 committed by William Wilgus
parent 4dd3c2b33e
commit 79864c6ec2
14 changed files with 25 additions and 25 deletions

View file

@ -601,7 +601,7 @@ static int parse_viewporttextstyle(struct skin_element *element,
*line = (struct line_desc)LINE_DESC_DEFINIT; *line = (struct line_desc)LINE_DESC_DEFINIT;
unsigned colour; unsigned colour;
static const char *vp_options[] = { "invert", "color", "colour", static const char * const vp_options[] = { "invert", "color", "colour",
"clear", "gradient", NULL}; "clear", "gradient", NULL};
int vp_op = string_option(mode, vp_options, false); int vp_op = string_option(mode, vp_options, false);
@ -1401,7 +1401,7 @@ static int parse_skinvar( struct skin_element *element,
return 0; return 0;
case SKIN_TOKEN_VAR_SET: 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)); struct skin_var_changer *data = skin_buffer_alloc(sizeof(*data));
if (!data) if (!data)
@ -1705,7 +1705,7 @@ static int parse_touchregion(struct skin_element *element,
if (region->action == ACTION_NONE) if (region->action == ACTION_NONE)
return WPS_ERROR_INVALID_PARAM; 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}; "repeat_press", "long_press", NULL};
int pm_op; int pm_op;

View file

@ -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 match index from option list
* returns -1 if option was not found * returns -1 if option was not found
* option list is array of char pointers with the final item set to null * 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) int string_option(const char *option, const char *const oplist[], bool ignore_case)
{ {

View file

@ -98,7 +98,7 @@ static void fix_path_part(char* path, int offset, int count)
} }
#ifdef USE_JPEG_COVER #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 }; static const unsigned char extension_lens[] = { 4, 3, 3 };
/* Try checking for several file extensions, return true if a file is found and /* Try checking for several file extensions, return true if a file is found and
* leaving the path modified to include the matching extension. * leaving the path modified to include the matching extension.

View file

@ -189,7 +189,7 @@ static short balance_mem[BAL_MEM_SIZE];
#define AGC_MODE_SIZE 5 #define AGC_MODE_SIZE 5
#define AGC_SAFETY_MODE 0 #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", "S", "L", "D", "M", "V" };
/* "Off", /* "Off",
"Safety (clip)", "Safety (clip)",

View file

@ -312,7 +312,7 @@ static int readline_cb(int n, char *buf, void *parameters)
} }
else if (sc && settings_parseline(buf, &name, &value)) 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}; "icon", "talkclip", NULL};
int nm_op = string_option(name, nm_options, false); int nm_op = string_option(name, nm_options, false);

View file

@ -137,7 +137,7 @@ static int tempbuf_handle;
(1LU << tag_virt_canonicalartist)) (1LU << tag_virt_canonicalartist))
/* String presentation of the tags defined in tagcache.h. Must be in correct order! */ /* 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", "filename", "composer", "comment", "albumartist", "grouping", "year",
"discnumber", "tracknumber", "canonicalartist", "bitrate", "length", "discnumber", "tracknumber", "canonicalartist", "bitrate", "length",
"playcount", "rating", "playtime", "lastplayed", "commitid", "mtime", "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" "tag_virt_entryage", "tag_virt_autoscore"
}; };
/* more debug strings */ /* 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_none] = "clause_none", [clause_is] = "clause_is",
[clause_is_not] = "clause_is_not", [clause_gt] = "clause_gt", [clause_is_not] = "clause_is_not", [clause_gt] = "clause_gt",
[clause_gteq] = "clause_gteq", [clause_lt] = "clause_lt", [clause_gteq] = "clause_gteq", [clause_lt] = "clause_lt",

View file

@ -940,8 +940,8 @@ bool dbg_hw_info_emi(void)
bool dbg_hw_info_audio(void) bool dbg_hw_info_audio(void)
{ {
static const char *hp_sel[2] = {"DAC", "Line1"}; static const char * const hp_sel[2] = {"DAC", "Line1"};
static const char *mux_sel[4] = {"Mic", "Line1", "HP", "Line2"}; static const char * const mux_sel[4] = {"Mic", "Line1", "HP", "Line2"};
lcd_setfont(FONT_SYSFIXED); lcd_setfont(FONT_SYSFIXED);
while(1) while(1)
@ -1171,7 +1171,7 @@ bool dbg_hw_info_button(void)
} }
else if(MAP[i].periph == IMX233_BUTTON_LRADC) else if(MAP[i].periph == IMX233_BUTTON_LRADC)
{ {
static const char *op_name[] = static const char * const op_name[] =
{ {
[IMX233_BUTTON_EQ] = "eq", [IMX233_BUTTON_EQ] = "eq",
[IMX233_BUTTON_GT] = "gt", [IMX233_BUTTON_GT] = "gt",

View file

@ -112,7 +112,7 @@ bool dbg_hw_info(void)
_DEBUG_PRINTF("PMU:"); _DEBUG_PRINTF("PMU:");
for(i=0;i<7;i++) for(i=0;i<7;i++)
{ {
char *device[] = {"(unknown)", static const char * const device[] = {"(unknown)",
"(CLICKWHEEL)", "(CLICKWHEEL)",
"(LCD)", "(LCD)",
"(AUDIO)", "(AUDIO)",
@ -139,7 +139,7 @@ bool dbg_hw_info(void)
char line_cfg[4]; char line_cfg[4];
int abr_stat; int abr_stat;
uint32_t abr_cnt; uint32_t abr_cnt;
char *abrstatus[] = {"Idle", "Launched", "Counting", "Abnormal"}; static const char * const abrstatus[] = {"Idle", "Launched", "Counting", "Abnormal"};
uartc_port_get_line_info(&ser_port, uartc_port_get_line_info(&ser_port,
&tx_stat, &rx_stat, &tx_speed, &rx_speed, line_cfg); &tx_stat, &rx_stat, &tx_speed, &rx_speed, line_cfg);

View file

@ -104,7 +104,7 @@ bool dbg_hw_info(void)
_DEBUG_PRINTF("PMU:"); _DEBUG_PRINTF("PMU:");
for(i=0;i<7;i++) for(i=0;i<7;i++)
{ {
char *device[] = {"unknown", static const char *const device[] = {"unknown",
"unknown", "unknown",
"LCD", "LCD",
"AUDIO", "AUDIO",
@ -157,7 +157,7 @@ bool dbg_hw_info(void)
char line_cfg[4]; char line_cfg[4];
int abr_stat; int abr_stat;
uint32_t abr_cnt; uint32_t abr_cnt;
char *abrstatus[] = {"Idle", "Launched", "Counting", "Abnormal"}; static const char * const abrstatus[] = {"Idle", "Launched", "Counting", "Abnormal"};
uartc_port_get_line_info(&ser_port, uartc_port_get_line_info(&ser_port,
&tx_stat, &rx_stat, &tx_speed, &rx_speed, line_cfg); &tx_stat, &rx_stat, &tx_speed, &rx_speed, line_cfg);

View file

@ -123,7 +123,7 @@ static void* pcm_thread_run(void* nothing)
/* https://github.com/tinyalsa/tinyalsa/blob/master/tinypcminfo.c */ /* https://github.com/tinyalsa/tinyalsa/blob/master/tinypcminfo.c */
static const char* format_lookup[] = static const char* const format_lookup[] =
{ {
/*[0] =*/ "S8", /*[0] =*/ "S8",
"U8", "U8",

View file

@ -32,7 +32,7 @@
#include "sysfs-ibasso.h" #include "sysfs-ibasso.h"
static const char* SYSFS_PATHS[] = static const char* const SYSFS_PATHS[] =
{ {
/* SYSFS_DX50_CODEC_VOLUME */ /* SYSFS_DX50_CODEC_VOLUME */
"/dev/codec_volume", "/dev/codec_volume",

View file

@ -63,8 +63,8 @@ void usb_enable(bool on)
*/ */
int disk_mount_all(void) int disk_mount_all(void)
{ {
const char *dev[] = {"/dev/mmcblk0p1", "/dev/mmcblk0"}; const char * const dev[] = {"/dev/mmcblk0p1", "/dev/mmcblk0"};
const char *fs[] = {"vfat", "exfat"}; const char * const fs[] = {"vfat", "exfat"};
sysfs_set_string("/sys/class/android_usb/android0/f_mass_storage/lun/file", ""); sysfs_set_string("/sys/class/android_usb/android0/f_mass_storage/lun/file", "");

View file

@ -41,7 +41,6 @@
#define MAX_INPUTCOUNT 512 /* Max input count so dst doesn't overflow */ #define MAX_INPUTCOUNT 512 /* Max input count so dst doesn't overflow */
#define FIXED_BUFCOUNT 3072 /* 48KHz factor 3.0 */ #define FIXED_BUFCOUNT 3072 /* 48KHz factor 3.0 */
#define FIXED_OUTBUFCOUNT 4096 #define FIXED_OUTBUFCOUNT 4096
#define NBUFFERS 4
enum tdspeed_ops enum tdspeed_ops
{ {
@ -65,9 +64,9 @@ static struct tdspeed_state_s
int32_t *ovl_buff[2]; /* overlap buffer (L+R) */ int32_t *ovl_buff[2]; /* overlap buffer (L+R) */
} tdspeed_state; } tdspeed_state;
static int32_t *buffers[NBUFFERS] = { NULL, NULL, NULL, NULL }; static int32_t *buffers[TDSPEED_NBUFFERS] = { NULL, NULL, NULL, NULL };
static const int buffer_sizes[NBUFFERS] = static const int buffer_sizes[TDSPEED_NBUFFERS] =
{ {
FIXED_BUFCOUNT * sizeof(int32_t), FIXED_BUFCOUNT * sizeof(int32_t),
FIXED_BUFCOUNT * sizeof(int32_t), FIXED_BUFCOUNT * sizeof(int32_t),
@ -552,7 +551,7 @@ static intptr_t tdspeed_configure(struct dsp_proc_entry *this,
break; break;
case DSP_PROC_INIT: case DSP_PROC_INIT:
if (!tdspeed_alloc_buffers(buffers, buffer_sizes, NBUFFERS)) if (!tdspeed_alloc_buffers(buffers, buffer_sizes, TDSPEED_NBUFFERS))
return -1; /* fail the init */ return -1; /* fail the init */
st->this = this; st->this = this;
@ -564,7 +563,7 @@ static intptr_t tdspeed_configure(struct dsp_proc_entry *this,
st->this = NULL; st->this = NULL;
st->factor = PITCH_SPEED_100; st->factor = PITCH_SPEED_100;
dsp_outbuf.remcount = 0; dsp_outbuf.remcount = 0;
tdspeed_free_buffers(buffers, NBUFFERS); tdspeed_free_buffers(buffers, TDSPEED_NBUFFERS);
break; break;
case DSP_PROC_NEW_FORMAT: case DSP_PROC_NEW_FORMAT:

View file

@ -34,6 +34,7 @@
#define STRETCH_MAX (250L * PITCH_SPEED_PRECISION) /* 250% */ #define STRETCH_MAX (250L * PITCH_SPEED_PRECISION) /* 250% */
#define STRETCH_MIN (35L * PITCH_SPEED_PRECISION) /* 35% */ #define STRETCH_MIN (35L * PITCH_SPEED_PRECISION) /* 35% */
#define TDSPEED_NBUFFERS 4
void dsp_timestretch_enable(bool enable); void dsp_timestretch_enable(bool enable);
void dsp_set_timestretch(int32_t percent); void dsp_set_timestretch(int32_t percent);