remove compiling warning in dfs_efsl

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@38 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong 2009-09-06 11:06:26 +00:00
parent b9290bcef4
commit 5931c6d00f
6 changed files with 48 additions and 56 deletions

View File

@ -12,11 +12,14 @@
* 2008-08-16 Yi.Qiu The first version.
*/
#include <string.h>
#include "efs.h"
#include "dfs_cache.h"
#include "ls.h"
#include "ui.h"
#include "fat.h"
#include <string.h>
#define EFS_MAX 2

View File

@ -217,13 +217,8 @@ euint32 dir_findinBuf(euint8 *buf, eint8 *fatname, FileLocation *loc, euint8 mo
switch(mode){
case DIRFIND_FILE:
return(dir_findFileinBuf(buf,fatname,loc));
break;
case DIRFIND_FREE:
return(dir_findFreeEntryinBuf(buf,loc));
break;
default:
return(0);
break;
}
return(0);
}
@ -275,9 +270,8 @@ euint32 dir_findinDir(FileSystem *fs, eint8* fatname,euint32 firstcluster, FileL
}
while(!fat_LogicToDiscCluster(fs,&Cache,c++)){
if((cluster=dir_findinCluster(fs,Cache.DiscCluster,fatname,loc,mode))){
return(cluster);
}
cluster=dir_findinCluster(fs,Cache.DiscCluster,fatname,loc,mode);
if(cluster) return(cluster);
}
return(0);
}
@ -297,7 +291,8 @@ euint32 dir_findinRootArea(FileSystem *fs,eint8* fatname, FileLocation *loc, eui
for(c=fs->FirstSectorRootDir;c<(fs->FirstSectorRootDir+fs->volumeId.RootEntryCount/32);c++){
buf = part_getSect(fs->part,c,IOM_MODE_READONLY);
if((fclus=dir_findinBuf(buf,fatname,loc,mode))){
fclus=dir_findinBuf(buf,fatname,loc,mode);
if(fclus){
if(loc)loc->Sector=c;
part_relSect(fs->part,buf);
return(fclus);
@ -323,9 +318,12 @@ esint8 dir_getFatFileName(eint8* filename, eint8* fatfilename)
if(*filename=='/')next++;
while((next=file_normalToFatName(next,ffnamec))){
next=file_normalToFatName(next,ffnamec);
while(next){
memCpy(ffnamec,fatfilename,11);
nn++;
next=file_normalToFatName(next,ffnamec);
}
if(nn)return(1);
return(0);

View File

@ -51,26 +51,21 @@ euint32 fat_getSectorAddressFatEntry(FileSystem *fs,euint32 cluster_addr)
res=(cluster_addr*3/1024);
if(res>=fs->FatSectorCount){
return(0);
}else{
return(base+res);
}
break;
return(base+res);
case FAT16:
res=cluster_addr/256;
if(res>=fs->FatSectorCount){
return(0);
}else{
return(base+res);
}
break;
return(base+res);
case FAT32:
res=cluster_addr/128;
if(res>=fs->FatSectorCount){
return(0);
}else{
return(base+res);
}
break;
return(base+res);
}
return(0);
}
@ -241,13 +236,10 @@ euint32 fat_giveEocMarker(FileSystem *fs)
{
case FAT12:
return(0xFFF);
break;
case FAT16:
return(0xFFFF);
break;
case FAT32:
return(0x0FFFFFFF);
break;
}
return(0);
}

View File

@ -30,6 +30,7 @@
#endif
/* Device error codes */
#define DFS_STATUS_OK 0 /* no error */
#define DFS_STATUS_ENOENT 2 /* No such file or directory */
#define DFS_STATUS_EIO 5 /* I/O error */
#define DFS_STATUS_ENXIO 6 /* No such device or address */

View File

@ -513,7 +513,7 @@ int chdir(const char *path)
{
char* fullpath, full_path[DFS_PATH_MAX + 1];
if(path == RT_NULL || strlen(path) > DFS_PATH_MAX)
if(path == RT_NULL || rt_strlen(path) > DFS_PATH_MAX)
return -1;
fullpath = (char*)path;

View File

@ -262,8 +262,6 @@ char *strrchr(const char *t, int c)
if ((*t == ch)) l=t;
if ((!*t)) return (char*)l; ++t;
}
return (char*)l;
}
#endif