diff options
author | Björn Stenberg <bjorn@haxx.se> | 2005-01-17 12:56:00 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2005-01-17 12:56:00 +0000 |
commit | a50cc0bd343e393705174cb9fb1662b599da1a4c (patch) | |
tree | ca3fe0e2c14d7c3188cde77cbdfae2f26582df11 /apps | |
parent | b2d84b1607e38aaec4be56490b5194f64f1007ab (diff) | |
download | rockbox-a50cc0bd343e393705174cb9fb1662b599da1a4c.tar.gz rockbox-a50cc0bd343e393705174cb9fb1662b599da1a4c.zip |
Minor tweaks to compile on win32.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5578 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/filetree.c | 3 | ||||
-rw-r--r-- | apps/playlist.c | 2 | ||||
-rw-r--r-- | apps/tree.c | 12 |
3 files changed, 9 insertions, 8 deletions
diff --git a/apps/filetree.c b/apps/filetree.c index aaf99dce92..a321a3fc81 100644 --- a/apps/filetree.c +++ b/apps/filetree.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "screens.h" | 36 | #include "screens.h" |
37 | #include "plugin.h" | 37 | #include "plugin.h" |
38 | #include "rolo.h" | 38 | #include "rolo.h" |
39 | #include "sprintf.h" | ||
39 | 40 | ||
40 | static int boot_size = 0; | 41 | static int boot_size = 0; |
41 | static int boot_cluster; | 42 | static int boot_cluster; |
@@ -187,11 +188,11 @@ int ft_load(struct tree_context* c, bool *buffer_full) | |||
187 | { | 188 | { |
188 | extern char lastdir[]; /* from tree.c */ | 189 | extern char lastdir[]; /* from tree.c */ |
189 | int i; | 190 | int i; |
191 | int name_buffer_used = 0; | ||
190 | DIR *dir = opendir(c->currdir); | 192 | DIR *dir = opendir(c->currdir); |
191 | if(!dir) | 193 | if(!dir) |
192 | return -1; /* not a directory */ | 194 | return -1; /* not a directory */ |
193 | 195 | ||
194 | int name_buffer_used = 0; | ||
195 | c->dirsindir = 0; | 196 | c->dirsindir = 0; |
196 | if (buffer_full) | 197 | if (buffer_full) |
197 | *buffer_full = false; | 198 | *buffer_full = false; |
diff --git a/apps/playlist.c b/apps/playlist.c index 1a68a052ba..aa8415a86f 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -540,10 +540,10 @@ static int add_directory_to_playlist(struct playlist_info* playlist, | |||
540 | int i; | 540 | int i; |
541 | int dirfilter = global_settings.dirfilter; | 541 | int dirfilter = global_settings.dirfilter; |
542 | struct entry *files; | 542 | struct entry *files; |
543 | struct tree_context* tc = tree_get_context(); | ||
543 | 544 | ||
544 | /* use the tree browser dircache to load files */ | 545 | /* use the tree browser dircache to load files */ |
545 | global_settings.dirfilter = SHOW_ALL; | 546 | global_settings.dirfilter = SHOW_ALL; |
546 | struct tree_context* tc = tree_get_context(); | ||
547 | strncpy(tc->currdir, dirname, sizeof(tc->currdir)); | 547 | strncpy(tc->currdir, dirname, sizeof(tc->currdir)); |
548 | num_files = ft_load(tc, NULL); | 548 | num_files = ft_load(tc, NULL); |
549 | files = (struct entry*) tc->dircache; | 549 | files = (struct entry*) tc->dircache; |
diff --git a/apps/tree.c b/apps/tree.c index eb1f7c3b74..b844060322 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -246,6 +246,8 @@ static int showdir(void) | |||
246 | int i; | 246 | int i; |
247 | int tree_max_on_screen; | 247 | int tree_max_on_screen; |
248 | bool dir_buffer_full = false; | 248 | bool dir_buffer_full = false; |
249 | int start = tc.dirstart; | ||
250 | bool id3db = global_settings.dirfilter == SHOW_ID3DB; | ||
249 | 251 | ||
250 | #ifdef HAVE_LCD_BITMAP | 252 | #ifdef HAVE_LCD_BITMAP |
251 | const char* icon; | 253 | const char* icon; |
@@ -259,8 +261,6 @@ static int showdir(void) | |||
259 | int icon; | 261 | int icon; |
260 | tree_max_on_screen = TREE_MAX_ON_SCREEN; | 262 | tree_max_on_screen = TREE_MAX_ON_SCREEN; |
261 | #endif | 263 | #endif |
262 | int start = tc.dirstart; | ||
263 | bool id3db = global_settings.dirfilter == SHOW_ID3DB; | ||
264 | 264 | ||
265 | /* new file dir? load it */ | 265 | /* new file dir? load it */ |
266 | if (id3db) { | 266 | if (id3db) { |
@@ -1332,16 +1332,16 @@ bool rockbox_browse(const char *root, int dirfilter) | |||
1332 | 1332 | ||
1333 | void tree_init(void) | 1333 | void tree_init(void) |
1334 | { | 1334 | { |
1335 | /* We copy the settings value in case it is changed by the user. We can't | ||
1336 | use it until the next reboot. */ | ||
1337 | int max_files = global_settings.max_files_in_dir; | ||
1338 | |||
1335 | /* initialize tree context struct */ | 1339 | /* initialize tree context struct */ |
1336 | memset(&tc, 0, sizeof(tc)); | 1340 | memset(&tc, 0, sizeof(tc)); |
1337 | tc.dirfilter = &global_settings.dirfilter; | 1341 | tc.dirfilter = &global_settings.dirfilter; |
1338 | 1342 | ||
1339 | db_init(); | 1343 | db_init(); |
1340 | 1344 | ||
1341 | /* We copy the settings value in case it is changed by the user. We can't | ||
1342 | use it until the next reboot. */ | ||
1343 | int max_files = global_settings.max_files_in_dir; | ||
1344 | |||
1345 | tc.name_buffer_size = AVERAGE_FILENAME_LENGTH * max_files; | 1345 | tc.name_buffer_size = AVERAGE_FILENAME_LENGTH * max_files; |
1346 | tc.name_buffer = buffer_alloc(tc.name_buffer_size); | 1346 | tc.name_buffer = buffer_alloc(tc.name_buffer_size); |
1347 | 1347 | ||