- 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
This commit is contained in:
parent
5afb4a97c2
commit
eab70ca28c
5 changed files with 6 additions and 31 deletions
|
@ -41,6 +41,7 @@ common/errno.c
|
||||||
#endif /* !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__) */
|
#endif /* !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__) */
|
||||||
common/memcmp.c
|
common/memcmp.c
|
||||||
common/memchr.c
|
common/memchr.c
|
||||||
|
common/misc.c
|
||||||
common/qsort.c
|
common/qsort.c
|
||||||
common/random.c
|
common/random.c
|
||||||
common/sprintf.c
|
common/sprintf.c
|
||||||
|
|
|
@ -35,36 +35,6 @@
|
||||||
|
|
||||||
static DIR_UNCACHED opendirs[MAX_OPEN_DIRS];
|
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
|
#ifdef HAVE_HOTSWAP
|
||||||
// release all dir handles on a given volume "by force", to avoid leaks
|
// release all dir handles on a given volume "by force", to avoid leaks
|
||||||
int release_dirs(int volume)
|
int release_dirs(int volume)
|
||||||
|
|
|
@ -182,6 +182,9 @@ static bool check_event_queue(void)
|
||||||
static int dircache_scan(IF_MV2(int volume,) struct travel_data *td)
|
static int dircache_scan(IF_MV2(int volume,) struct travel_data *td)
|
||||||
{
|
{
|
||||||
#ifdef SIMULATOR
|
#ifdef SIMULATOR
|
||||||
|
#ifdef HAVE_MULTIVOLUME
|
||||||
|
(void)volume;
|
||||||
|
#endif
|
||||||
while ( ( td->entry = readdir_uncached(td->dir) ) )
|
while ( ( td->entry = readdir_uncached(td->dir) ) )
|
||||||
#else
|
#else
|
||||||
while ( (fat_getnext(td->dir, &td->entry) >= 0) && (td->entry.name[0]))
|
while ( (fat_getnext(td->dir, &td->entry) >= 0) && (td->entry.name[0]))
|
||||||
|
|
|
@ -795,4 +795,3 @@ int release_files(int volume)
|
||||||
return closed; /* return how many we did */
|
return closed; /* return how many we did */
|
||||||
}
|
}
|
||||||
#endif /* #ifdef HAVE_HOTSWAP */
|
#endif /* #ifdef HAVE_HOTSWAP */
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,9 @@
|
||||||
#include "usb.h"
|
#include "usb.h"
|
||||||
|
|
||||||
static long last_disk_activity = -1;
|
static long last_disk_activity = -1;
|
||||||
|
#ifdef CONFIG_STORAGE_MULTI
|
||||||
static int sd_drive_nr = 0;
|
static int sd_drive_nr = 0;
|
||||||
|
#endif
|
||||||
static tCardInfo card;
|
static tCardInfo card;
|
||||||
|
|
||||||
static long sd_stack[(DEFAULT_STACK_SIZE*2 + 0x1c0)/sizeof(long)];
|
static long sd_stack[(DEFAULT_STACK_SIZE*2 + 0x1c0)/sizeof(long)];
|
||||||
|
|
Loading…
Reference in a new issue