diff options
author | Steve Bavin <pondlife@pondlife.me> | 2008-05-12 17:52:50 +0000 |
---|---|---|
committer | Steve Bavin <pondlife@pondlife.me> | 2008-05-12 17:52:50 +0000 |
commit | ad95df2cabdee6f53ae16f1c24774bfc47add36f (patch) | |
tree | bb8851e30b36116a1e3c648114a6d40f38f0f29c | |
parent | 8ea9b94cd95e39f96d3f5cac002ada826a7df5b0 (diff) | |
download | rockbox-ad95df2cabdee6f53ae16f1c24774bfc47add36f.tar.gz rockbox-ad95df2cabdee6f53ae16f1c24774bfc47add36f.zip |
Const police raid.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17474 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/filetree.c | 2 | ||||
-rw-r--r-- | apps/filetypes.c | 2 | ||||
-rw-r--r-- | apps/filetypes.h | 2 | ||||
-rw-r--r-- | apps/gui/backdrop.c | 8 | ||||
-rw-r--r-- | apps/gui/backdrop.h | 6 | ||||
-rw-r--r-- | apps/playlist.c | 22 | ||||
-rw-r--r-- | apps/playlist.h | 2 | ||||
-rw-r--r-- | apps/playlist_catalog.c | 4 | ||||
-rw-r--r-- | apps/playlist_catalog.h | 2 | ||||
-rw-r--r-- | apps/playlist_viewer.c | 9 | ||||
-rw-r--r-- | apps/playlist_viewer.h | 2 |
11 files changed, 32 insertions, 29 deletions
diff --git a/apps/filetree.c b/apps/filetree.c index 29335fdcbe..4f14e48104 100644 --- a/apps/filetree.c +++ b/apps/filetree.c | |||
@@ -552,7 +552,7 @@ int ft_enter(struct tree_context* c) | |||
552 | 552 | ||
553 | default: | 553 | default: |
554 | { | 554 | { |
555 | char* plugin; | 555 | const char* plugin; |
556 | 556 | ||
557 | if (global_settings.party_mode) { | 557 | if (global_settings.party_mode) { |
558 | gui_syncsplash(HZ, ID2P(LANG_PARTY_MODE)); | 558 | gui_syncsplash(HZ, ID2P(LANG_PARTY_MODE)); |
diff --git a/apps/filetypes.c b/apps/filetypes.c index 722456b8f4..ead2295f70 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c | |||
@@ -518,5 +518,5 @@ int filetype_load_plugin(const char* plugin, char* file) | |||
518 | return PLUGIN_ERROR; | 518 | return PLUGIN_ERROR; |
519 | snprintf(plugin_name, MAX_PATH, "%s/%s.%s", | 519 | snprintf(plugin_name, MAX_PATH, "%s/%s.%s", |
520 | PLUGIN_DIR, filetypes[i].plugin, ROCK_EXTENSION); | 520 | PLUGIN_DIR, filetypes[i].plugin, ROCK_EXTENSION); |
521 | return plugin_load(plugin_name,file); | 521 | return plugin_load(plugin_name, file); |
522 | } | 522 | } |
diff --git a/apps/filetypes.h b/apps/filetypes.h index 52e60eab1f..66553e5b24 100644 --- a/apps/filetypes.h +++ b/apps/filetypes.h | |||
@@ -60,7 +60,7 @@ void read_color_theme_file(void); | |||
60 | /* Return the attribute (FILE_ATTR_*) of the file */ | 60 | /* Return the attribute (FILE_ATTR_*) of the file */ |
61 | int filetype_get_attr(const char* file); | 61 | int filetype_get_attr(const char* file); |
62 | #ifdef HAVE_LCD_COLOR | 62 | #ifdef HAVE_LCD_COLOR |
63 | int filetype_get_color(const char * name, int attr); | 63 | int filetype_get_color(const char* name, int attr); |
64 | #endif | 64 | #endif |
65 | int filetype_get_icon(int attr); | 65 | int filetype_get_icon(int attr); |
66 | /* return the plugin filename associated with the file */ | 66 | /* return the plugin filename associated with the file */ |
diff --git a/apps/gui/backdrop.c b/apps/gui/backdrop.c index 0d023602be..67f96a31f2 100644 --- a/apps/gui/backdrop.c +++ b/apps/gui/backdrop.c | |||
@@ -42,7 +42,7 @@ static bool main_backdrop_valid = false; | |||
42 | static bool wps_backdrop_valid = false; | 42 | static bool wps_backdrop_valid = false; |
43 | 43 | ||
44 | /* load a backdrop into a buffer */ | 44 | /* load a backdrop into a buffer */ |
45 | static bool load_backdrop(char* filename, fb_data* backdrop_buffer) | 45 | static bool load_backdrop(const char* filename, fb_data* backdrop_buffer) |
46 | { | 46 | { |
47 | struct bitmap bm; | 47 | struct bitmap bm; |
48 | int ret; | 48 | int ret; |
@@ -62,13 +62,13 @@ static bool load_backdrop(char* filename, fb_data* backdrop_buffer) | |||
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | bool load_main_backdrop(char* filename) | 65 | bool load_main_backdrop(const char* filename) |
66 | { | 66 | { |
67 | main_backdrop_valid = load_backdrop(filename, &main_backdrop[0][0]); | 67 | main_backdrop_valid = load_backdrop(filename, &main_backdrop[0][0]); |
68 | return main_backdrop_valid; | 68 | return main_backdrop_valid; |
69 | } | 69 | } |
70 | 70 | ||
71 | bool load_wps_backdrop(char* filename) | 71 | bool load_wps_backdrop(const char* filename) |
72 | { | 72 | { |
73 | wps_backdrop_valid = load_backdrop(filename, &wps_backdrop[0][0]); | 73 | wps_backdrop_valid = load_backdrop(filename, &wps_backdrop[0][0]); |
74 | return wps_backdrop_valid; | 74 | return wps_backdrop_valid; |
@@ -104,7 +104,7 @@ void show_wps_backdrop(void) | |||
104 | 104 | ||
105 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 | 105 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 |
106 | 106 | ||
107 | static bool load_remote_backdrop(char* filename, fb_remote_data* backdrop_buffer) | 107 | static bool load_remote_backdrop(const char* filename, fb_remote_data* backdrop_buffer) |
108 | { | 108 | { |
109 | struct bitmap bm; | 109 | struct bitmap bm; |
110 | int ret; | 110 | int ret; |
diff --git a/apps/gui/backdrop.h b/apps/gui/backdrop.h index c930a87433..a05cb633f6 100644 --- a/apps/gui/backdrop.h +++ b/apps/gui/backdrop.h | |||
@@ -25,8 +25,8 @@ | |||
25 | #include "lcd.h" | 25 | #include "lcd.h" |
26 | #include "bmp.h" | 26 | #include "bmp.h" |
27 | 27 | ||
28 | bool load_main_backdrop(char* filename); | 28 | bool load_main_backdrop(const char* filename); |
29 | bool load_wps_backdrop(char* filename); | 29 | bool load_wps_backdrop(const char* filename); |
30 | 30 | ||
31 | void unload_main_backdrop(void); | 31 | void unload_main_backdrop(void); |
32 | void unload_wps_backdrop(void); | 32 | void unload_wps_backdrop(void); |
@@ -37,7 +37,7 @@ void show_wps_backdrop(void); | |||
37 | #endif /* LCD_DEPTH > 1 */ | 37 | #endif /* LCD_DEPTH > 1 */ |
38 | 38 | ||
39 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 | 39 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 |
40 | bool load_remote_wps_backdrop(char* filename); | 40 | bool load_remote_wps_backdrop(const char* filename); |
41 | void unload_remote_wps_backdrop(void); | 41 | void unload_remote_wps_backdrop(void); |
42 | void show_remote_wps_backdrop(void); | 42 | void show_remote_wps_backdrop(void); |
43 | void show_remote_main_backdrop(void); /* only clears the wps backdrop */ | 43 | void show_remote_main_backdrop(void); /* only clears the wps backdrop */ |
diff --git a/apps/playlist.c b/apps/playlist.c index c3072ddfd2..30fd0f11e9 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -179,7 +179,7 @@ static int get_next_dir(char *dir, bool is_forward, bool recursion); | |||
179 | static int get_previous_directory(char *dir); | 179 | static int get_previous_directory(char *dir); |
180 | static int check_subdir_for_music(char *dir, char *subdir); | 180 | static int check_subdir_for_music(char *dir, char *subdir); |
181 | static int format_track_path(char *dest, char *src, int buf_length, int max, | 181 | static int format_track_path(char *dest, char *src, int buf_length, int max, |
182 | char *dir); | 182 | const char *dir); |
183 | static void display_playlist_count(int count, const unsigned char *fmt, | 183 | static void display_playlist_count(int count, const unsigned char *fmt, |
184 | bool final); | 184 | bool final); |
185 | static void display_buffer_full(void); | 185 | static void display_buffer_full(void); |
@@ -317,24 +317,26 @@ static void empty_playlist(struct playlist_info* playlist, bool resume) | |||
317 | static void new_playlist(struct playlist_info* playlist, const char *dir, | 317 | static void new_playlist(struct playlist_info* playlist, const char *dir, |
318 | const char *file) | 318 | const char *file) |
319 | { | 319 | { |
320 | const char *fileused = file; | ||
321 | const char *dirused = dir; | ||
320 | empty_playlist(playlist, false); | 322 | empty_playlist(playlist, false); |
321 | 323 | ||
322 | if (!file) | 324 | if (!fileused) |
323 | { | 325 | { |
324 | file = ""; | 326 | fileused = ""; |
325 | 327 | ||
326 | if (dir && playlist->current) /* !current cannot be in_ram */ | 328 | if (dirused && playlist->current) /* !current cannot be in_ram */ |
327 | playlist->in_ram = true; | 329 | playlist->in_ram = true; |
328 | else | 330 | else |
329 | dir = ""; /* empty playlist */ | 331 | dirused = ""; /* empty playlist */ |
330 | } | 332 | } |
331 | 333 | ||
332 | update_playlist_filename(playlist, dir, file); | 334 | update_playlist_filename(playlist, dirused, fileused); |
333 | 335 | ||
334 | if (playlist->control_fd >= 0) | 336 | if (playlist->control_fd >= 0) |
335 | { | 337 | { |
336 | update_control(playlist, PLAYLIST_COMMAND_PLAYLIST, | 338 | update_control(playlist, PLAYLIST_COMMAND_PLAYLIST, |
337 | PLAYLIST_CONTROL_FILE_VERSION, -1, dir, file, NULL); | 339 | PLAYLIST_CONTROL_FILE_VERSION, -1, dirused, fileused, NULL); |
338 | sync_control(playlist, false); | 340 | sync_control(playlist, false); |
339 | } | 341 | } |
340 | } | 342 | } |
@@ -1676,7 +1678,7 @@ static int check_subdir_for_music(char *dir, char *subdir) | |||
1676 | * Returns absolute path of track | 1678 | * Returns absolute path of track |
1677 | */ | 1679 | */ |
1678 | static int format_track_path(char *dest, char *src, int buf_length, int max, | 1680 | static int format_track_path(char *dest, char *src, int buf_length, int max, |
1679 | char *dir) | 1681 | const char *dir) |
1680 | { | 1682 | { |
1681 | int i = 0; | 1683 | int i = 0; |
1682 | int j; | 1684 | int j; |
@@ -2953,13 +2955,13 @@ int playlist_insert_directory(struct playlist_info* playlist, | |||
2953 | /* | 2955 | /* |
2954 | * Insert all tracks from specified playlist into dynamic playlist. | 2956 | * Insert all tracks from specified playlist into dynamic playlist. |
2955 | */ | 2957 | */ |
2956 | int playlist_insert_playlist(struct playlist_info* playlist, char *filename, | 2958 | int playlist_insert_playlist(struct playlist_info* playlist, const char *filename, |
2957 | int position, bool queue) | 2959 | int position, bool queue) |
2958 | { | 2960 | { |
2959 | int fd; | 2961 | int fd; |
2960 | int max; | 2962 | int max; |
2961 | char *temp_ptr; | 2963 | char *temp_ptr; |
2962 | char *dir; | 2964 | const char *dir; |
2963 | unsigned char *count_str; | 2965 | unsigned char *count_str; |
2964 | char temp_buf[MAX_PATH+1]; | 2966 | char temp_buf[MAX_PATH+1]; |
2965 | char trackname[MAX_PATH+1]; | 2967 | char trackname[MAX_PATH+1]; |
diff --git a/apps/playlist.h b/apps/playlist.h index 006ae591c4..d6523bcdcf 100644 --- a/apps/playlist.h +++ b/apps/playlist.h | |||
@@ -142,7 +142,7 @@ int playlist_insert_track(struct playlist_info* playlist, const char *filename, | |||
142 | int playlist_insert_directory(struct playlist_info* playlist, | 142 | int playlist_insert_directory(struct playlist_info* playlist, |
143 | const char *dirname, int position, bool queue, | 143 | const char *dirname, int position, bool queue, |
144 | bool recurse); | 144 | bool recurse); |
145 | int playlist_insert_playlist(struct playlist_info* playlist, char *filename, | 145 | int playlist_insert_playlist(struct playlist_info* playlist, const char *filename, |
146 | int position, bool queue); | 146 | int position, bool queue); |
147 | void playlist_skip_entry(struct playlist_info *playlist, int steps); | 147 | void playlist_skip_entry(struct playlist_info *playlist, int steps); |
148 | int playlist_delete(struct playlist_info* playlist, int index); | 148 | int playlist_delete(struct playlist_info* playlist, int index); |
diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c index 17db24984b..ac86f48109 100644 --- a/apps/playlist_catalog.c +++ b/apps/playlist_catalog.c | |||
@@ -323,7 +323,7 @@ static int add_track_to_playlist(char* filename, void* context) | |||
323 | 323 | ||
324 | /* Add "sel" file into specified "playlist". How to insert depends on type | 324 | /* Add "sel" file into specified "playlist". How to insert depends on type |
325 | of file */ | 325 | of file */ |
326 | static int add_to_playlist(const char* playlist, char* sel, int sel_attr) | 326 | static int add_to_playlist(const char* playlist, const char* sel, int sel_attr) |
327 | { | 327 | { |
328 | int fd; | 328 | int fd; |
329 | int result = -1; | 329 | int result = -1; |
@@ -419,7 +419,7 @@ bool catalog_view_playlists(void) | |||
419 | return true; | 419 | return true; |
420 | } | 420 | } |
421 | 421 | ||
422 | bool catalog_add_to_a_playlist(char* sel, int sel_attr, | 422 | bool catalog_add_to_a_playlist(const char* sel, int sel_attr, |
423 | bool new_playlist, char *m3u8name) | 423 | bool new_playlist, char *m3u8name) |
424 | { | 424 | { |
425 | char playlist[MAX_PATH]; | 425 | char playlist[MAX_PATH]; |
diff --git a/apps/playlist_catalog.h b/apps/playlist_catalog.h index 92cfa15ed9..adf757c398 100644 --- a/apps/playlist_catalog.h +++ b/apps/playlist_catalog.h | |||
@@ -35,7 +35,7 @@ bool catalog_view_playlists(void); | |||
35 | * m3u8name : filename to save the playlist to, NULL to show the keyboard | 35 | * m3u8name : filename to save the playlist to, NULL to show the keyboard |
36 | * ret : true if the file was successfully added | 36 | * ret : true if the file was successfully added |
37 | */ | 37 | */ |
38 | bool catalog_add_to_a_playlist(char* sel, int sel_attr, | 38 | bool catalog_add_to_a_playlist(const char* sel, int sel_attr, |
39 | bool new_playlist, char* m3u8name); | 39 | bool new_playlist, char* m3u8name); |
40 | 40 | ||
41 | #endif | 41 | #endif |
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 8ad3d263de..b910ca449b 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c | |||
@@ -116,7 +116,7 @@ static struct playlist_entry * playlist_buffer_get_track(struct playlist_buffer | |||
116 | int index); | 116 | int index); |
117 | 117 | ||
118 | static bool playlist_viewer_init(struct playlist_viewer * viewer, | 118 | static bool playlist_viewer_init(struct playlist_viewer * viewer, |
119 | char* filename, bool reload); | 119 | const char* filename, bool reload); |
120 | 120 | ||
121 | static void format_name(char* dest, const char* src); | 121 | static void format_name(char* dest, const char* src); |
122 | static void format_line(const struct playlist_entry* track, char* str, | 122 | static void format_line(const struct playlist_entry* track, char* str, |
@@ -271,7 +271,7 @@ static struct playlist_entry * playlist_buffer_get_track(struct playlist_buffer | |||
271 | 271 | ||
272 | /* Initialize the playlist viewer. */ | 272 | /* Initialize the playlist viewer. */ |
273 | static bool playlist_viewer_init(struct playlist_viewer * viewer, | 273 | static bool playlist_viewer_init(struct playlist_viewer * viewer, |
274 | char* filename, bool reload) | 274 | const char* filename, bool reload) |
275 | { | 275 | { |
276 | char* buffer; | 276 | char* buffer; |
277 | size_t buffer_size; | 277 | size_t buffer_size; |
@@ -304,7 +304,8 @@ static bool playlist_viewer_init(struct playlist_viewer * viewer, | |||
304 | else | 304 | else |
305 | { | 305 | { |
306 | /* Viewing playlist on disk */ | 306 | /* Viewing playlist on disk */ |
307 | char *dir, *file, *temp_ptr; | 307 | const char *dir, *file; |
308 | char *temp_ptr; | ||
308 | char *index_buffer = NULL; | 309 | char *index_buffer = NULL; |
309 | ssize_t index_buffer_size = 0; | 310 | ssize_t index_buffer_size = 0; |
310 | 311 | ||
@@ -591,7 +592,7 @@ static int playlist_callback_icons(int selected_item, void *data) | |||
591 | 592 | ||
592 | /* Main viewer function. Filename identifies playlist to be viewed. If NULL, | 593 | /* Main viewer function. Filename identifies playlist to be viewed. If NULL, |
593 | view current playlist. */ | 594 | view current playlist. */ |
594 | bool playlist_viewer_ex(char* filename) | 595 | bool playlist_viewer_ex(const char* filename) |
595 | { | 596 | { |
596 | bool ret = false; /* return value */ | 597 | bool ret = false; /* return value */ |
597 | bool exit=false; /* exit viewer */ | 598 | bool exit=false; /* exit viewer */ |
diff --git a/apps/playlist_viewer.h b/apps/playlist_viewer.h index 27f2e354c5..0caa23b6db 100644 --- a/apps/playlist_viewer.h +++ b/apps/playlist_viewer.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #define _PLAYLIST_VIEWER_H_ | 22 | #define _PLAYLIST_VIEWER_H_ |
23 | 23 | ||
24 | bool playlist_viewer(void); | 24 | bool playlist_viewer(void); |
25 | bool playlist_viewer_ex(char* filename); | 25 | bool playlist_viewer_ex(const char* filename); |
26 | bool search_playlist(void); | 26 | bool search_playlist(void); |
27 | 27 | ||
28 | #endif | 28 | #endif |