summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2010-07-30 17:57:19 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2010-07-30 17:57:19 +0200
commite5fb92b077c514962139abb57057041a09ca860c (patch)
treef413ec6a9edfb5e19cc276d0873f4e2af39e4340
parentd3046d174245920c01f2e19fa43f2cccdba9540b (diff)
downloadpianobar-windows-e5fb92b077c514962139abb57057041a09ca860c.tar.gz
pianobar-windows-e5fb92b077c514962139abb57057041a09ca860c.tar.bz2
pianobar-windows-e5fb92b077c514962139abb57057041a09ca860c.zip
Use static const for large read-only arrays
-rw-r--r--src/main.c2
-rw-r--r--src/settings.c6
-rw-r--r--src/ui_act.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index e0c344b..b53b21b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -324,7 +324,7 @@ int main (int argc, char **argv) {
size_t i;
for (i = 0; i < BAR_KS_COUNT; i++) {
if (settings.keys[i] == buf) {
- BarKeyShortcutFunc_t idToF[] = {BarUiActHelp,
+ static const BarKeyShortcutFunc_t idToF[] = {BarUiActHelp,
BarUiActLoveSong, BarUiActBanSong,
BarUiActAddMusic, BarUiActCreateStation,
BarUiActDeleteStation, BarUiActExplain,
diff --git a/src/settings.c b/src/settings.c
index 8aa764c..d085aff 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -89,11 +89,11 @@ void BarSettingsRead (BarSettings_t *settings) {
char configfile[1024], key[256], val[256];
FILE *configfd;
/* _must_ have same order as in BarKeyShortcutId_t */
- const char defaultKeys[] = {'?', '+', '-', 'a', 'c', 'd', 'e', 'g',
+ static const char defaultKeys[] = {'?', '+', '-', 'a', 'c', 'd', 'e', 'g',
'h', 'i', 'j', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'x', '$',
'b',
};
- const char *shortcutFileKeys[] = {
+ static const char *shortcutFileKeys[] = {
"act_help", "act_songlove", "act_songban", "act_stationaddmusic",
"act_stationcreate", "act_stationdelete", "act_songexplain",
"act_stationaddbygenre", "act_history", "act_songinfo",
@@ -162,7 +162,7 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->history = atoi (val);
} else if (strcmp ("sort", key) == 0) {
size_t i;
- char *mapping[] = {"name_az",
+ static const char *mapping[] = {"name_az",
"name_za",
"quickmix_01_name_az",
"quickmix_01_name_za",
diff --git a/src/ui_act.c b/src/ui_act.c
index 7328e40..d907304 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -71,7 +71,7 @@ static int BarTransformIfShared (PianoHandle_t *ph, WaitressHandle_t *waith,
/* print current shortcut configuration
*/
void BarUiActHelp (BAR_KS_ARGS) {
- const char *idToDesc[] = {
+ static const char *idToDesc[] = {
NULL,
"love current song",
"ban current song",