summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2005-01-17 12:56:00 +0000
committerBjörn Stenberg <bjorn@haxx.se>2005-01-17 12:56:00 +0000
commita50cc0bd343e393705174cb9fb1662b599da1a4c (patch)
treeca3fe0e2c14d7c3188cde77cbdfae2f26582df11 /apps
parentb2d84b1607e38aaec4be56490b5194f64f1007ab (diff)
downloadrockbox-a50cc0bd343e393705174cb9fb1662b599da1a4c.tar.gz
rockbox-a50cc0bd343e393705174cb9fb1662b599da1a4c.tar.bz2
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.c3
-rw-r--r--apps/playlist.c2
-rw-r--r--apps/tree.c12
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 @@
#include "screens.h"
#include "plugin.h"
#include "rolo.h"
+#include "sprintf.h"
static int boot_size = 0;
static int boot_cluster;
@@ -187,11 +188,11 @@ int ft_load(struct tree_context* c, bool *buffer_full)
{
extern char lastdir[]; /* from tree.c */
int i;
+ int name_buffer_used = 0;
DIR *dir = opendir(c->currdir);
if(!dir)
return -1; /* not a directory */
- int name_buffer_used = 0;
c->dirsindir = 0;
if (buffer_full)
*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,
int i;
int dirfilter = global_settings.dirfilter;
struct entry *files;
+ struct tree_context* tc = tree_get_context();
/* use the tree browser dircache to load files */
global_settings.dirfilter = SHOW_ALL;
- struct tree_context* tc = tree_get_context();
strncpy(tc->currdir, dirname, sizeof(tc->currdir));
num_files = ft_load(tc, NULL);
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)
int i;
int tree_max_on_screen;
bool dir_buffer_full = false;
+ int start = tc.dirstart;
+ bool id3db = global_settings.dirfilter == SHOW_ID3DB;
#ifdef HAVE_LCD_BITMAP
const char* icon;
@@ -259,8 +261,6 @@ static int showdir(void)
int icon;
tree_max_on_screen = TREE_MAX_ON_SCREEN;
#endif
- int start = tc.dirstart;
- bool id3db = global_settings.dirfilter == SHOW_ID3DB;
/* new file dir? load it */
if (id3db) {
@@ -1332,16 +1332,16 @@ bool rockbox_browse(const char *root, int dirfilter)
void tree_init(void)
{
+ /* We copy the settings value in case it is changed by the user. We can't
+ use it until the next reboot. */
+ int max_files = global_settings.max_files_in_dir;
+
/* initialize tree context struct */
memset(&tc, 0, sizeof(tc));
tc.dirfilter = &global_settings.dirfilter;
db_init();
- /* We copy the settings value in case it is changed by the user. We can't
- use it until the next reboot. */
- int max_files = global_settings.max_files_in_dir;
-
tc.name_buffer_size = AVERAGE_FILENAME_LENGTH * max_files;
tc.name_buffer = buffer_alloc(tc.name_buffer_size);