summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2011-12-05 19:23:46 +0000
committerNils Wallménius <nils@rockbox.org>2011-12-05 19:23:46 +0000
commita0377bd500bc3185f840a67b4ee82ddaf7eaa5ab (patch)
tree857a878b0e8c34b87a339cc24f9ed99185a79447 /apps
parent906905aa43566c16913238a71ccc13d438af1702 (diff)
downloadrockbox-a0377bd500bc3185f840a67b4ee82ddaf7eaa5ab.tar.gz
rockbox-a0377bd500bc3185f840a67b4ee82ddaf7eaa5ab.zip
Sprinkle around some static and const.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31153 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/filetypes.c2
-rw-r--r--apps/filetypes.h4
-rw-r--r--apps/onplay.c2
-rw-r--r--apps/shortcuts.c22
-rw-r--r--apps/shortcuts.h2
5 files changed, 17 insertions, 15 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 1f19d25e5a..49196d40ed 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -573,7 +573,7 @@ int filetype_list_viewers(const char* current_file)
573 return simplelist_show_list(&info); 573 return simplelist_show_list(&info);
574} 574}
575 575
576int filetype_load_plugin(const char* plugin, char* file) 576int filetype_load_plugin(const char* plugin, const char* file)
577{ 577{
578 int i; 578 int i;
579 char plugin_name[MAX_PATH]; 579 char plugin_name[MAX_PATH];
diff --git a/apps/filetypes.h b/apps/filetypes.h
index bde0a3f15f..dd8993e262 100644
--- a/apps/filetypes.h
+++ b/apps/filetypes.h
@@ -58,7 +58,7 @@ void tree_get_filetypes(const struct filetype**, int*);
58 58
59/* init the filetypes structs. 59/* init the filetypes structs.
60 uses audio buffer for storage, so call early in init... */ 60 uses audio buffer for storage, so call early in init... */
61void filetype_init(void) INIT_ATTR; 61void filetype_init(void) INIT_ATTR;
62void read_viewer_theme_file(void); 62void read_viewer_theme_file(void);
63#ifdef HAVE_LCD_COLOR 63#ifdef HAVE_LCD_COLOR
64void read_color_theme_file(void); 64void read_color_theme_file(void);
@@ -80,7 +80,7 @@ bool filetype_supported(int attr);
80int filetype_list_viewers(const char* current_file); 80int filetype_list_viewers(const char* current_file);
81 81
82/* start a plugin with file as the argument (called from onplay.c) */ 82/* start a plugin with file as the argument (called from onplay.c) */
83int filetype_load_plugin(const char* plugin, char* file); 83int filetype_load_plugin(const char* plugin, const char* file);
84 84
85 85
86#endif 86#endif
diff --git a/apps/onplay.c b/apps/onplay.c
index 629de93886..143745d366 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -66,7 +66,7 @@
66#include "shortcuts.h" 66#include "shortcuts.h"
67 67
68static int context; 68static int context;
69static char* selected_file = NULL; 69static const char* selected_file = NULL;
70static int selected_file_attr = 0; 70static int selected_file_attr = 0;
71static int onplay_result = ONPLAY_OK; 71static int onplay_result = ONPLAY_OK;
72static char clipboard_selection[MAX_PATH]; 72static char clipboard_selection[MAX_PATH];
diff --git a/apps/shortcuts.c b/apps/shortcuts.c
index 8ded75c1f2..3943a6a56a 100644
--- a/apps/shortcuts.c
+++ b/apps/shortcuts.c
@@ -42,10 +42,9 @@
42#include "onplay.h" 42#include "onplay.h"
43 43
44 44
45
46#define MAX_SHORTCUT_NAME 32 45#define MAX_SHORTCUT_NAME 32
47#define SHORTCUTS_FILENAME ROCKBOX_DIR "/shortcuts.txt" 46#define SHORTCUTS_FILENAME ROCKBOX_DIR "/shortcuts.txt"
48char *type_strings[SHORTCUT_TYPE_COUNT] = { 47static char * const type_strings[SHORTCUT_TYPE_COUNT] = {
49 [SHORTCUT_SETTING] = "setting", 48 [SHORTCUT_SETTING] = "setting",
50 [SHORTCUT_FILE] = "file", 49 [SHORTCUT_FILE] = "file",
51 [SHORTCUT_DEBUGITEM] = "debug", 50 [SHORTCUT_DEBUGITEM] = "debug",
@@ -53,7 +52,6 @@ char *type_strings[SHORTCUT_TYPE_COUNT] = {
53 [SHORTCUT_PLAYLISTMENU] = "playlist menu", 52 [SHORTCUT_PLAYLISTMENU] = "playlist menu",
54 [SHORTCUT_SEPARATOR] = "separator", 53 [SHORTCUT_SEPARATOR] = "separator",
55}; 54};
56
57 55
58struct shortcut { 56struct shortcut {
59 enum shortcut_type type; 57 enum shortcut_type type;
@@ -124,7 +122,7 @@ static struct shortcut* get_shortcut(int index)
124 return &h->shortcuts[handle_index]; 122 return &h->shortcuts[handle_index];
125} 123}
126 124
127bool verify_shortcut(struct shortcut* sc) 125static bool verify_shortcut(struct shortcut* sc)
128{ 126{
129 switch (sc->type) 127 switch (sc->type)
130 { 128 {
@@ -152,7 +150,8 @@ static void init_shortcut(struct shortcut* sc)
152 sc->name[0] = '\0'; 150 sc->name[0] = '\0';
153 sc->u.path[0] = '\0'; 151 sc->u.path[0] = '\0';
154 sc->icon = Icon_NOICON; 152 sc->icon = Icon_NOICON;
155} 153}
154
156static int first_idx_to_writeback = -1; 155static int first_idx_to_writeback = -1;
157void shortcuts_ata_idle_callback(void* data) 156void shortcuts_ata_idle_callback(void* data)
158{ 157{
@@ -192,7 +191,8 @@ void shortcuts_ata_idle_callback(void* data)
192 } 191 }
193 first_idx_to_writeback = -1; 192 first_idx_to_writeback = -1;
194} 193}
195void shortcuts_add(enum shortcut_type type, char* value) 194
195void shortcuts_add(enum shortcut_type type, const char* value)
196{ 196{
197 struct shortcut* sc = get_shortcut(shortcut_count++); 197 struct shortcut* sc = get_shortcut(shortcut_count++);
198 if (!sc) 198 if (!sc)
@@ -275,6 +275,7 @@ int readline_cb(int n, char *buf, void *parameters)
275 } 275 }
276 return 0; 276 return 0;
277} 277}
278
278void shortcuts_init(void) 279void shortcuts_init(void)
279{ 280{
280 int fd; 281 int fd;
@@ -296,8 +297,8 @@ void shortcuts_init(void)
296 shortcut_count++; 297 shortcut_count++;
297} 298}
298 299
299const char * shortcut_menu_get_name(int selected_item, void * data, 300static const char * shortcut_menu_get_name(int selected_item, void * data,
300 char * buffer, size_t buffer_len) 301 char * buffer, size_t buffer_len)
301{ 302{
302 (void)data; 303 (void)data;
303 (void)buffer; 304 (void)buffer;
@@ -312,14 +313,15 @@ const char * shortcut_menu_get_name(int selected_item, void * data,
312 return sc->name[0] ? sc->name : sc->u.path; 313 return sc->name[0] ? sc->name : sc->u.path;
313} 314}
314 315
315int shortcut_menu_get_action(int action, struct gui_synclist *lists) 316static int shortcut_menu_get_action(int action, struct gui_synclist *lists)
316{ 317{
317 (void)lists; 318 (void)lists;
318 if (action == ACTION_STD_OK) 319 if (action == ACTION_STD_OK)
319 return ACTION_STD_CANCEL; 320 return ACTION_STD_CANCEL;
320 return action; 321 return action;
321} 322}
322enum themable_icons shortcut_menu_get_icon(int selected_item, void * data) 323
324static enum themable_icons shortcut_menu_get_icon(int selected_item, void * data)
323{ 325{
324 (void)data; 326 (void)data;
325 struct shortcut *sc = get_shortcut(selected_item); 327 struct shortcut *sc = get_shortcut(selected_item);
diff --git a/apps/shortcuts.h b/apps/shortcuts.h
index b794a3a2f4..d36b2a90fb 100644
--- a/apps/shortcuts.h
+++ b/apps/shortcuts.h
@@ -36,7 +36,7 @@ enum shortcut_type {
36 SHORTCUT_TYPE_COUNT 36 SHORTCUT_TYPE_COUNT
37}; 37};
38 38
39void shortcuts_add(enum shortcut_type type, char* value); 39void shortcuts_add(enum shortcut_type type, const char* value);
40void shortcuts_init(void); 40void shortcuts_init(void);
41int do_shortcut_menu(void*ignored); 41int do_shortcut_menu(void*ignored);
42 42