aboutsummaryrefslogtreecommitdiff
path: root/backends/fs
diff options
context:
space:
mode:
Diffstat (limited to 'backends/fs')
-rw-r--r--backends/fs/ds/ds-fs.cpp8
-rw-r--r--backends/fs/posix/posix-fs.cpp16
-rw-r--r--backends/fs/posix/posix-fs.h4
-rw-r--r--backends/fs/ps2/ps2-fs-factory.h8
-rw-r--r--backends/fs/ps2/ps2-fs.cpp24
-rw-r--r--backends/fs/symbian/symbian-fs.cpp6
-rw-r--r--backends/fs/symbian/symbianstream.cpp42
-rw-r--r--backends/fs/wii/wii-fs.cpp2
8 files changed, 55 insertions, 55 deletions
diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp
index c0692c0713..97a034a998 100644
--- a/backends/fs/ds/ds-fs.cpp
+++ b/backends/fs/ds/ds-fs.cpp
@@ -249,7 +249,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path) {
_isValid = false; // Old code returned false here, but I'm not sure why
} else if ((strlen(pathStr) > 4) && (!strncmp(pathStr, "mp:/", 4))) {
// Files which start with mp:/
-
+
// Clear the filename to 128 bytes, because a libfat bug occationally tries to read in this area.
memset(check, 0, 128);
strcpy(check, pathStr + 3);
@@ -279,7 +279,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path) {
_isValid = fileOrDir == FT_FILE;
}
-
+
// consolePrintf("Path: %s \n", check);
@@ -567,7 +567,7 @@ size_t std_fread(const void* ptr, size_t size, size_t numItems, FILE* handle) {
return numItems;
} else {
// consolePrintf("Read past end of file: %d read out of %d\n", bytes / size, numItems);
- if ((size_t)bytes != size * numItems) readPastEndOfFile = true;
+ if ((size_t)bytes != size * numItems) readPastEndOfFile = true;
return bytes / size;
}
return numItems;
@@ -694,7 +694,7 @@ int std_fseek(FILE* handle, long int offset, int whence) {
int std_ferror(FILE* handle) {
//FIXME: not implemented?
// consolePrintf("ferror ");
-
+
return readPastEndOfFile;
}
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index 463d647042..446ded779d 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -61,7 +61,7 @@ POSIXFilesystemNode::POSIXFilesystemNode(const Common::String &p) {
} else {
_path = p;
}
-
+
#ifdef __OS2__
// On OS/2, 'X:/' is a root of drive X, so we should not remove that last
// slash.
@@ -95,7 +95,7 @@ POSIXFilesystemNode::POSIXFilesystemNode(const Common::String &p) {
AbstractFSNode *POSIXFilesystemNode::getChild(const Common::String &n) const {
assert(!_path.empty());
assert(_isDirectory);
-
+
// Make sure the string contains no slashes
assert(!n.contains('/'));
@@ -117,14 +117,14 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
// Special case for the root dir: List all DOS drives
ULONG ulDrvNum;
ULONG ulDrvMap;
-
+
DosQueryCurrentDisk(&ulDrvNum, &ulDrvMap);
-
+
for (int i = 0; i < 26; i++) {
if (ulDrvMap & 1) {
char drive_root[] = "A:/";
drive_root[0] += i;
-
+
POSIXFilesystemNode *entry = new POSIXFilesystemNode();
entry->_isDirectory = true;
entry->_isValid = true;
@@ -132,10 +132,10 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
entry->_displayName = "[" + Common::String(drive_root, 2) + "]";
myList.push_back(entry);
}
-
+
ulDrvMap >>= 1;
}
-
+
return true;
}
#endif
@@ -220,7 +220,7 @@ AbstractFSNode *POSIXFilesystemNode::getParent() const {
const char *start = _path.c_str();
const char *end = start + _path.size();
-
+
// Strip of the last component. We make use of the fact that at this
// point, _path is guaranteed to be normalized
while (end > start && *(end-1) != '/')
diff --git a/backends/fs/posix/posix-fs.h b/backends/fs/posix/posix-fs.h
index 7bd21c94b1..8050f52b41 100644
--- a/backends/fs/posix/posix-fs.h
+++ b/backends/fs/posix/posix-fs.h
@@ -43,11 +43,11 @@ protected:
Common::String _path;
bool _isDirectory;
bool _isValid;
-
+
virtual AbstractFSNode *makeNode(const Common::String &path) const {
return new POSIXFilesystemNode(path);
}
-
+
/**
* Plain constructor, for internal use only (hence protected).
*/
diff --git a/backends/fs/ps2/ps2-fs-factory.h b/backends/fs/ps2/ps2-fs-factory.h
index dd6b5dc013..3a1dec252d 100644
--- a/backends/fs/ps2/ps2-fs-factory.h
+++ b/backends/fs/ps2/ps2-fs-factory.h
@@ -30,18 +30,18 @@
/**
* Creates PS2FilesystemNode objects.
- *
+ *
* Parts of this class are documented in the base interface class, AbstractFilesystemFactory.
*/
-class Ps2FilesystemFactory : public FilesystemFactory, public Common::Singleton<Ps2FilesystemFactory> {
+class Ps2FilesystemFactory : public FilesystemFactory, public Common::Singleton<Ps2FilesystemFactory> {
public:
virtual AbstractFSNode *makeRootFileNode() const;
virtual AbstractFSNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const;
-
+
protected:
Ps2FilesystemFactory() {};
-
+
private:
friend class Common::Singleton<SingletonBaseType>;
};
diff --git a/backends/fs/ps2/ps2-fs.cpp b/backends/fs/ps2/ps2-fs.cpp
index fd20562a24..5246a9bd38 100644
--- a/backends/fs/ps2/ps2-fs.cpp
+++ b/backends/fs/ps2/ps2-fs.cpp
@@ -40,7 +40,7 @@ extern OSystem_PS2 *g_systemPs2;
/**
* Implementation of the ScummVM file system API based on the Ps2SDK.
- *
+ *
* Parts of this class are documented in the base interface class, AbstractFSNode.
*/
class Ps2FilesystemNode : public AbstractFSNode {
@@ -62,15 +62,15 @@ public:
* Creates a PS2FilesystemNode with the root node as path.
*/
Ps2FilesystemNode();
-
+
/**
* Creates a PS2FilesystemNode for a given path.
- *
+ *
* @param path Common::String with the path the new node should point to.
*/
Ps2FilesystemNode(const Common::String &path);
Ps2FilesystemNode(const Common::String &path, bool verify);
-
+
/**
* Copy constructor.
*/
@@ -165,7 +165,7 @@ Ps2FilesystemNode::Ps2FilesystemNode(const Ps2FilesystemNode *node) {
}
bool Ps2FilesystemNode::exists(void) const {
-
+
dbg_printf("Ps2FilesystemNode::exists: path \"%s\": ", _path.c_str());
if (_path[4] != ':') { // don't bother for relative path... they always fail on PS2!
@@ -217,10 +217,10 @@ AbstractFSNode *Ps2FilesystemNode::getChild(const Common::String &n) const {
char listDir[256];
sprintf(listDir, "%s/", _path.c_str());
int fd = fio.dopen(listDir);
-
+
if (fd >= 0) {
iox_dirent_t dirent;
-
+
while (fio.dread(fd, &dirent) > 0) {
if (strcmp(n.c_str(), dirent.name) == 0) {
Ps2FilesystemNode *dirEntry = new Ps2FilesystemNode();
@@ -240,13 +240,13 @@ AbstractFSNode *Ps2FilesystemNode::getChild(const Common::String &n) const {
}
fio.dclose(fd);
}
-
+
return NULL;
}
bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hidden) const {
//TODO: honor the hidden flag
-
+
if (!_isDirectory)
return false;
@@ -273,14 +273,14 @@ bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
} else {
char listDir[256];
int fd;
-
+
if (_path.lastChar() == '/' /* || _path.lastChar() == ':'*/)
fd = fio.dopen(_path.c_str());
else {
sprintf(listDir, "%s/", _path.c_str());
fd = fio.dopen(listDir);
}
-
+
if (fd >= 0) {
iox_dirent_t dirent;
Ps2FilesystemNode dirEntry;
@@ -338,7 +338,7 @@ char *Ps2FilesystemNode::getDeviceDescription(const char *path) const {
else if (strncmp(path, "mass", 4) == 0)
return "USB Mass Storage";
else
- return "Harddisk";
+ return "Harddisk";
}
Common::SeekableReadStream *Ps2FilesystemNode::openForReading() {
diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp
index 74b7c28873..3b57ac0356 100644
--- a/backends/fs/symbian/symbian-fs.cpp
+++ b/backends/fs/symbian/symbian-fs.cpp
@@ -140,7 +140,7 @@ AbstractFSNode *SymbianFilesystemNode::getChild(const Common::String &n) const {
if (_path.lastChar() != '\\')
newPath += '\\';
- newPath += n;
+ newPath += n;
return new SymbianFilesystemNode(newPath);
}
@@ -196,7 +196,7 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
if (_path.lastChar() != '\\')
fname.Append('\\');
-
+
if (static_cast<OSystem_SDL_Symbian*>(g_system)->FsSession().GetDir(fname, KEntryAttNormal|KEntryAttDir, 0, dirPtr) == KErrNone) {
CleanupStack::PushL(dirPtr);
TInt cnt=dirPtr->Count();
@@ -219,7 +219,7 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
if ((mode == Common::FSNode::kListFilesOnly && entry._isDirectory) ||
(mode == Common::FSNode::kListDirectoriesOnly && !entry._isDirectory))
continue;
-
+
myList.push_back(new SymbianFilesystemNode(entry));
}
CleanupStack::PopAndDestroy(dirPtr);
diff --git a/backends/fs/symbian/symbianstream.cpp b/backends/fs/symbian/symbianstream.cpp
index 5944cab892..650bbd0dcd 100644
--- a/backends/fs/symbian/symbianstream.cpp
+++ b/backends/fs/symbian/symbianstream.cpp
@@ -13,7 +13,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -21,7 +21,7 @@
* $URL$
* $Id$
*
- */
+ */
#include "common/scummsys.h"
#include "backends/fs/symbian/symbianstream.h"
@@ -48,7 +48,7 @@ TSymbianFileEntry* CreateSymbianFileEntry(const char* name, const char* mode) {
fileEntry->_inputPos = KErrNotFound;
fileEntry->_lastError = 0;
fileEntry->_eofReached = EFalse;
-
+
if (fileEntry != NULL) {
TInt modeLen = strlen(mode);
@@ -102,9 +102,9 @@ size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry
TSymbianFileEntry* entry = ((TSymbianFileEntry*)(handle));
TUint32 totsize = size*numItems;
TPtr8 pointer ( (unsigned char*) ptr, totsize);
-
+
// Nothing cached and we want to load at least KInputBufferLength bytes
- if (totsize >= KInputBufferLength) {
+ if (totsize >= KInputBufferLength) {
TUint32 totLength = 0;
if (entry->_inputPos != KErrNotFound) {
TPtr8 cacheBuffer( (unsigned char*) entry->_inputBuffer+entry->_inputPos, entry->_inputBufferLen - entry->_inputPos, KInputBufferLength);
@@ -113,19 +113,19 @@ size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry
totLength+=pointer.Length();
pointer.Set(totLength+(unsigned char*) ptr, 0, totsize-totLength);
}
-
+
entry->_lastError = entry->_fileHandle.Read(pointer);
-
+
totLength+=pointer.Length();
-
+
pointer.Set((unsigned char*) ptr, totLength, totsize);
-
+
} else {
- // Nothing in buffer
+ // Nothing in buffer
if (entry->_inputPos == KErrNotFound) {
TPtr8 cacheBuffer( (unsigned char*) entry->_inputBuffer, KInputBufferLength);
- entry->_lastError = entry->_fileHandle.Read(cacheBuffer);
-
+ entry->_lastError = entry->_fileHandle.Read(cacheBuffer);
+
if (cacheBuffer.Length() >= totsize) {
pointer.Copy(cacheBuffer.Left(totsize));
entry->_inputPos = totsize;
@@ -134,19 +134,19 @@ size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry
pointer.Copy(cacheBuffer);
entry->_inputPos = KErrNotFound;
}
-
+
} else {
TPtr8 cacheBuffer( (unsigned char*) entry->_inputBuffer, entry->_inputBufferLen, KInputBufferLength);
-
+
if (entry->_inputPos+totsize < entry->_inputBufferLen) {
pointer.Copy(cacheBuffer.Mid(entry->_inputPos, totsize));
entry->_inputPos+=totsize;
} else {
-
+
pointer.Copy(cacheBuffer.Mid(entry->_inputPos, entry->_inputBufferLen-entry->_inputPos));
cacheBuffer.SetLength(0);
entry->_lastError = entry->_fileHandle.Read(cacheBuffer);
-
+
if (cacheBuffer.Length() >= totsize-pointer.Length()) {
TUint32 restSize = totsize-pointer.Length();
pointer.Append(cacheBuffer.Left(restSize));
@@ -158,8 +158,8 @@ size_t ReadData(const void* ptr, size_t size, size_t numItems, TSymbianFileEntry
}
}
}
- }
-
+ }
+
if((numItems * size) != pointer.Length() && entry->_lastError == KErrNone) {
entry->_eofReached = ETrue;
}
@@ -234,11 +234,11 @@ bool SymbianStdioStream::seek(int32 offs, int whence) {
break;
}
-
+
entry->_inputPos = KErrNotFound;
entry->_eofReached = EFalse;
entry->_fileHandle.Seek(seekMode, pos);
-
+
return true; // FIXME: Probably should return a value based on what _fileHandle.Seek returns
}
@@ -256,7 +256,7 @@ uint32 SymbianStdioStream::write(const void *ptr, uint32 len) {
if (((TSymbianFileEntry*)(_handle))->_lastError == KErrNone) {
return len;
}
-
+
return 0;
}
diff --git a/backends/fs/wii/wii-fs.cpp b/backends/fs/wii/wii-fs.cpp
index f3c457af5e..cbecce2d05 100644
--- a/backends/fs/wii/wii-fs.cpp
+++ b/backends/fs/wii/wii-fs.cpp
@@ -91,7 +91,7 @@ bool WiiFilesystemNode::getDevopChildren(AbstractFSList &list, ListMode mode, bo
if (!dt || !dt->name || !dt->open_r || !dt->diropen_r)
continue;
-
+
list.push_back(new WiiFilesystemNode(Common::String(dt->name) + ":/", true));
}