diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/filetypes.c | 2 | ||||
-rw-r--r-- | apps/filetypes.h | 4 | ||||
-rw-r--r-- | apps/onplay.c | 2 | ||||
-rw-r--r-- | apps/shortcuts.c | 22 | ||||
-rw-r--r-- | apps/shortcuts.h | 2 |
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 | ||
576 | int filetype_load_plugin(const char* plugin, char* file) | 576 | int 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... */ |
61 | void filetype_init(void) INIT_ATTR; | 61 | void filetype_init(void) INIT_ATTR; |
62 | void read_viewer_theme_file(void); | 62 | void read_viewer_theme_file(void); |
63 | #ifdef HAVE_LCD_COLOR | 63 | #ifdef HAVE_LCD_COLOR |
64 | void read_color_theme_file(void); | 64 | void read_color_theme_file(void); |
@@ -80,7 +80,7 @@ bool filetype_supported(int attr); | |||
80 | int filetype_list_viewers(const char* current_file); | 80 | int 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) */ |
83 | int filetype_load_plugin(const char* plugin, char* file); | 83 | int 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 | ||
68 | static int context; | 68 | static int context; |
69 | static char* selected_file = NULL; | 69 | static const char* selected_file = NULL; |
70 | static int selected_file_attr = 0; | 70 | static int selected_file_attr = 0; |
71 | static int onplay_result = ONPLAY_OK; | 71 | static int onplay_result = ONPLAY_OK; |
72 | static char clipboard_selection[MAX_PATH]; | 72 | static 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" |
48 | char *type_strings[SHORTCUT_TYPE_COUNT] = { | 47 | static 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 | ||
58 | struct shortcut { | 56 | struct 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 | ||
127 | bool verify_shortcut(struct shortcut* sc) | 125 | static 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 | |||
156 | static int first_idx_to_writeback = -1; | 155 | static int first_idx_to_writeback = -1; |
157 | void shortcuts_ata_idle_callback(void* data) | 156 | void 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 | } |
195 | void shortcuts_add(enum shortcut_type type, char* value) | 194 | |
195 | void 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 | |||
278 | void shortcuts_init(void) | 279 | void 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 | ||
299 | const char * shortcut_menu_get_name(int selected_item, void * data, | 300 | static 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 | ||
315 | int shortcut_menu_get_action(int action, struct gui_synclist *lists) | 316 | static 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 | } |
322 | enum themable_icons shortcut_menu_get_icon(int selected_item, void * data) | 323 | |
324 | static 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 | ||
39 | void shortcuts_add(enum shortcut_type type, char* value); | 39 | void shortcuts_add(enum shortcut_type type, const char* value); |
40 | void shortcuts_init(void); | 40 | void shortcuts_init(void); |
41 | int do_shortcut_menu(void*ignored); | 41 | int do_shortcut_menu(void*ignored); |
42 | 42 | ||