Index: trunk/i386/libsaio/hfs.c =================================================================== --- trunk/i386/libsaio/hfs.c (revision 150) +++ trunk/i386/libsaio/hfs.c (revision 151) @@ -80,16 +80,16 @@ static long GetCatalogEntryInfo(void *entry, long *flags, long *time, FinderInfo *finderInfo, long *infoValid); static long ResolvePathToCatalogEntry(char *filePath, long *flags, - void *entry, long dirID, long *dirIndex); + void *entry, long dirID, long long *dirIndex); -static long GetCatalogEntry(long *dirIndex, char **name, +static long GetCatalogEntry(long long *dirIndex, char **name, long *flags, long *time, FinderInfo *finderInfo, long *infoValid); static long ReadCatalogEntry(char *fileName, long dirID, void *entry, - long *dirIndex); + long long *dirIndex); static long ReadExtentsEntry(long fileID, long startBlock, void *entry); -static long ReadBTreeEntry(long btree, void *key, char *entry, long *dirIndex); +static long ReadBTreeEntry(long btree, void *key, char *entry, long long *dirIndex); static void GetBTreeRecord(long index, char *nodeBuffer, long nodeSize, char **key, char **data); @@ -304,7 +304,7 @@ return length; } -long HFSGetDirEntry(CICell ih, char * dirPath, long * dirIndex, char ** name, +long HFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, char ** name, long * flags, long * time, FinderInfo * finderInfo, long * infoValid) { @@ -346,7 +346,7 @@ UInt16 nodeSize; UInt32 firstLeafNode; - long dirIndex; + long long dirIndex; char *name; long flags, time; @@ -360,7 +360,7 @@ nodeSize = SWAP_BE16(gBTHeaders[kBTreeCatalog]->nodeSize); firstLeafNode = SWAP_BE32(gBTHeaders[kBTreeCatalog]->firstLeafNode); - dirIndex = firstLeafNode * nodeSize; + dirIndex = (long long) firstLeafNode * nodeSize; GetCatalogEntry(&dirIndex, &name, &flags, &time, 0, 0); @@ -526,10 +526,11 @@ } static long ResolvePathToCatalogEntry(char * filePath, long * flags, - void * entry, long dirID, long * dirIndex) + void * entry, long dirID, long long * dirIndex) { char *restPath; - long result, cnt, subFolderID = 0, tmpDirIndex; + long result, cnt, subFolderID = 0; + long long tmpDirIndex; HFSPlusCatalogFile *hfsPlusFile; // Copy the file name to gTempStr @@ -576,7 +577,7 @@ return result; } -static long GetCatalogEntry(long * dirIndex, char ** name, +static long GetCatalogEntry(long long * dirIndex, char ** name, long * flags, long * time, FinderInfo * finderInfo, long * infoValid) { @@ -597,12 +598,12 @@ nodeBuf = (char *)malloc(nodeSize); node = (BTNodeDescriptor *)nodeBuf; - index = *dirIndex % nodeSize; - curNode = *dirIndex / nodeSize; + index = (long) (*dirIndex % nodeSize); + curNode = (long) (*dirIndex / nodeSize); // Read the BTree node and get the record for index. ReadExtent(extent, extentSize, kHFSCatalogFileID, - (long long)curNode * nodeSize, nodeSize, nodeBuf, 1); + (long long) curNode * nodeSize, nodeSize, nodeBuf, 1); GetBTreeRecord(index, nodeBuf, nodeSize, &testKey, &entry); GetCatalogEntryInfo(entry, flags, time, finderInfo, infoValid); @@ -626,7 +627,7 @@ index = 0; curNode = SWAP_BE32(node->fLink); } - *dirIndex = curNode * nodeSize + index; + *dirIndex = (long long) curNode * nodeSize + index; free(nodeBuf); @@ -634,7 +635,7 @@ } static long ReadCatalogEntry(char * fileName, long dirID, - void * entry, long * dirIndex) + void * entry, long long * dirIndex) { long length; char key[sizeof(HFSPlusCatalogKey)]; @@ -680,7 +681,7 @@ return ReadBTreeEntry(kBTreeExtents, &key, entry, 0); } -static long ReadBTreeEntry(long btree, void * key, char * entry, long * dirIndex) +static long ReadBTreeEntry(long btree, void * key, char * entry, long long * dirIndex) { long extentSize; void *extent; @@ -732,7 +733,7 @@ while (1) { // Read the current node. ReadExtent(extent, extentSize, extentFile, - (long long)curNode * nodeSize, nodeSize, nodeBuf, 1); + (long long) curNode * nodeSize, nodeSize, nodeBuf, 1); // Find the matching key. lowerBound = 0; @@ -800,7 +801,7 @@ index = 0; curNode = SWAP_BE32(node->fLink); } - *dirIndex = curNode * nodeSize + index; + *dirIndex = (long long) curNode * nodeSize + index; } free(nodeBuf); Index: trunk/i386/libsaio/hfs.h =================================================================== --- trunk/i386/libsaio/hfs.h (revision 150) +++ trunk/i386/libsaio/hfs.h (revision 151) @@ -23,7 +23,7 @@ extern long HFSInitPartition(CICell ih); extern long HFSLoadFile(CICell ih, char * filePath); extern long HFSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length); -extern long HFSGetDirEntry(CICell ih, char * dirPath, long * dirIndex, +extern long HFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, char ** name, long * flags, long * time, FinderInfo * finderInfo, long * infoValid); extern void HFSGetDescription(CICell ih, char *str, long strMaxLen); Index: trunk/i386/libsaio/ufs.c =================================================================== --- trunk/i386/libsaio/ufs.c (revision 150) +++ trunk/i386/libsaio/ufs.c (revision 151) @@ -46,7 +46,7 @@ static long ResolvePathToInode(char *filePath, long *flags, InodePtr fileInode, InodePtr dirInode); static long ReadDirEntry(InodePtr dirInode, long *fileInodeNum, - long *dirIndex, char **name); + long long *dirIndex, char **name); static long FindFileInDir(char *fileName, long *flags, InodePtr fileInode, InodePtr dirInode); static char *ReadFileBlock(InodePtr fileInode, long fragNum, long blockOffset, @@ -223,7 +223,7 @@ #ifndef BOOT1 -long UFSGetDirEntry( CICell ih, char * dirPath, long * dirIndex, +long UFSGetDirEntry( CICell ih, char * dirPath, long long * dirIndex, char ** name, long * flags, long * time, FinderInfo * finderInfo, long * infoValid) { @@ -383,18 +383,18 @@ } static long ReadDirEntry( InodePtr dirInode, long * fileInodeNum, - long * dirIndex, char ** name ) + long long * dirIndex, char ** name ) { struct direct *dir; char *buffer; - long index; + long long index; long dirBlockNum, dirBlockOffset; while (1) { index = *dirIndex; - dirBlockOffset = index % DIRBLKSIZ; - dirBlockNum = index / DIRBLKSIZ; + dirBlockOffset = (long) (index % DIRBLKSIZ); + dirBlockNum = (long) (index / DIRBLKSIZ); buffer = ReadFileBlock(dirInode, dirBlockNum, 0, DIRBLKSIZ, 0, 1); if (buffer == 0) return -1; @@ -418,7 +418,8 @@ static long FindFileInDir( char * fileName, long * flags, InodePtr fileInode, InodePtr dirInode ) { - long ret, inodeNum, index = 0; + long ret, inodeNum; + long long index = 0; char *name; while (1) { Index: trunk/i386/libsaio/ufs.h =================================================================== --- trunk/i386/libsaio/ufs.h (revision 150) +++ trunk/i386/libsaio/ufs.h (revision 151) @@ -23,7 +23,7 @@ extern long UFSInitPartition(CICell ih); extern long UFSLoadFile(CICell ih, char * filePath); extern long UFSReadFile( CICell ih, char * filePath, void * base, uint64_t offset, uint64_t length ); -extern long UFSGetDirEntry(CICell ih, char * dirPath, long * dirIndex, +extern long UFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, char ** name, long * flags, long * time, FinderInfo * finderInfo, long * infoValid); extern void UFSGetDescription(CICell ih, char *str, long strMaxLen); Index: trunk/i386/libsaio/sys.c =================================================================== --- trunk/i386/libsaio/sys.c (revision 150) +++ trunk/i386/libsaio/sys.c (revision 151) @@ -294,7 +294,7 @@ // GetDirEntry - LOW-LEVEL FILESYSTEM FUNCTION. // Fetch the next directory entry for the given directory. -long GetDirEntry(const char * dirSpec, long * dirIndex, const char ** name, +long GetDirEntry(const char * dirSpec, long long * dirIndex, const char ** name, long * flags, long * time) { const char * dirPath; @@ -322,7 +322,7 @@ long GetFileInfo(const char * dirSpec, const char * name, long * flags, long * time) { - long index = 0; + long long index = 0; const char * entryName; if (gMakeDirSpec == 0) Index: trunk/i386/libsaio/nbp.c =================================================================== --- trunk/i386/libsaio/nbp.c (revision 150) +++ trunk/i386/libsaio/nbp.c (revision 151) @@ -96,7 +96,7 @@ /*========================================================================== * GetDirEntry is not supported. */ -static long NBPGetDirEntry(CICell ih, char * dirPath, long * dirIndex, +static long NBPGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, char ** name, long * flags, long * time, FinderInfo * finderInfo, long * infoValid) { Index: trunk/i386/libsaio/saio_types.h =================================================================== --- trunk/i386/libsaio/saio_types.h (revision 150) +++ trunk/i386/libsaio/saio_types.h (revision 151) @@ -132,7 +132,7 @@ typedef long (*FSLoadFile)(CICell ih, char * filePath); typedef long (*FSReadFile)(CICell ih, char *filePath, void *base, uint64_t offset, uint64_t length); typedef long (*FSGetFileBlock)(CICell ih, char *filePath, unsigned long long *firstBlock); -typedef long (*FSGetDirEntry)(CICell ih, char * dirPath, long * dirIndex, +typedef long (*FSGetDirEntry)(CICell ih, char * dirPath, long long * dirIndex, char ** name, long * flags, long * time, FinderInfo * finderInfo, long * infoValid); typedef long (* FSGetUUID)(CICell ih, char *uuidStr); @@ -157,7 +157,7 @@ struct dirstuff { char * dir_path; /* directory path */ - long dir_index; /* directory entry index */ + long long dir_index; /* directory entry index */ BVRef dir_bvr; /* volume reference */ }; Index: trunk/i386/libsaio/msdos.c =================================================================== --- trunk/i386/libsaio/msdos.c (revision 150) +++ trunk/i386/libsaio/msdos.c (revision 151) @@ -615,7 +615,7 @@ return 0; } -long MSDOSGetDirEntry(CICell ih, char * dirPath, long * dirIndex, +long MSDOSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, char ** name, long * flags, long * time, FinderInfo * finderInfo, long * infoValid) { @@ -626,7 +626,7 @@ return -1; if (dirPath[0] == '/') dirPath++; - st = (struct msdosdirstate *)*dirIndex; + st = (struct msdosdirstate *)(long) *dirIndex; if (!st) { st=malloc (sizeof (*st)); @@ -651,7 +651,7 @@ } else initRoot (st); - *dirIndex = (long)st; + *dirIndex = (long long) (long) st; } while((dirp = getnextdirent (ih, vfatname, st))&& (dirp->deAttributes & ATTR_VOLUME)); if (!dirp) Index: trunk/i386/libsaio/msdos.h =================================================================== --- trunk/i386/libsaio/msdos.h (revision 150) +++ trunk/i386/libsaio/msdos.h (revision 151) @@ -24,10 +24,10 @@ extern long MSDOSInitPartition(CICell ih); extern long MSDOSLoadFile(CICell ih, char * filePath); extern long MSDOSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length); -extern long MSDOSGetDirEntry(CICell ih, char * dirPath, long * dirIndex, +extern long MSDOSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, char ** name, long * flags, long * time, FinderInfo * finderInfo, long * infoValid); extern long MSDOSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock); extern long MSDOSGetUUID(CICell ih, char *uuidStr); extern void MSDOSFree(CICell ih); -extern int MSDOSProbe (const void *buf); \ No newline at end of file +extern int MSDOSProbe (const void *buf); Index: trunk/i386/libsaio/saio_internal.h =================================================================== --- trunk/i386/libsaio/saio_internal.h (revision 150) +++ trunk/i386/libsaio/saio_internal.h (revision 151) @@ -170,7 +170,7 @@ extern long LoadFile(const char *fileSpec); extern long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length); extern long LoadThinFatFile(const char *fileSpec, void **binary); -extern long GetDirEntry(const char *dirSpec, long *dirIndex, const char **name, +extern long GetDirEntry(const char *dirSpec, long long *dirIndex, const char **name, long *flags, long *time); extern long GetFileInfo(const char *dirSpec, const char *name, long *flags, long *time); Index: trunk/i386/boot2/drivers.c =================================================================== --- trunk/i386/boot2/drivers.c (revision 150) +++ trunk/i386/boot2/drivers.c (revision 151) @@ -257,7 +257,8 @@ static long FileLoadDrivers( char * dirSpec, long plugin ) { - long ret, length, index, flags, time, bundleType; + long ret, length, flags, time, bundleType; + long long index; long result = -1; const char * name;