From eab70ca28cbbed89a6f6064377e7189ecc595ac2 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Thu, 26 Nov 2009 17:39:30 +0000 Subject: - Split off strip_volume() to a separate file - fix some yellows git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23762 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/dir_uncached.c | 30 ------------------------------ firmware/common/dircache.c | 3 +++ firmware/common/file.c | 1 - 3 files changed, 3 insertions(+), 31 deletions(-) (limited to 'firmware/common') diff --git a/firmware/common/dir_uncached.c b/firmware/common/dir_uncached.c index dd157f0ade..ef9ce6f0af 100644 --- a/firmware/common/dir_uncached.c +++ b/firmware/common/dir_uncached.c @@ -35,36 +35,6 @@ static DIR_UNCACHED opendirs[MAX_OPEN_DIRS]; -#ifdef HAVE_MULTIVOLUME - -/* returns on which volume this is, and copies the reduced name - (sortof a preprocessor for volume-decorated pathnames) */ -int strip_volume(const char* name, char* namecopy) -{ - int volume = 0; - const char *temp = name; - - while (*temp == '/') /* skip all leading slashes */ - ++temp; - - if (*temp && !strncmp(temp, VOL_NAMES, VOL_ENUM_POS)) - { - temp += VOL_ENUM_POS; /* behind special name */ - volume = atoi(temp); /* number is following */ - temp = strchr(temp, '/'); /* search for slash behind */ - if (temp != NULL) - name = temp; /* use the part behind the volume */ - else - name = "/"; /* else this must be the root dir */ - } - - strlcpy(namecopy, name, MAX_PATH); - - return volume; -} -#endif /* #ifdef HAVE_MULTIVOLUME */ - - #ifdef HAVE_HOTSWAP // release all dir handles on a given volume "by force", to avoid leaks int release_dirs(int volume) diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c index e846d55452..f844e548f6 100644 --- a/firmware/common/dircache.c +++ b/firmware/common/dircache.c @@ -182,6 +182,9 @@ static bool check_event_queue(void) static int dircache_scan(IF_MV2(int volume,) struct travel_data *td) { #ifdef SIMULATOR +#ifdef HAVE_MULTIVOLUME + (void)volume; +#endif while ( ( td->entry = readdir_uncached(td->dir) ) ) #else while ( (fat_getnext(td->dir, &td->entry) >= 0) && (td->entry.name[0])) diff --git a/firmware/common/file.c b/firmware/common/file.c index 770930d80a..b7bcbaba46 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c @@ -795,4 +795,3 @@ int release_files(int volume) return closed; /* return how many we did */ } #endif /* #ifdef HAVE_HOTSWAP */ - -- cgit v1.2.3