aboutsummaryrefslogtreecommitdiff
path: root/backends/fs
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-25 01:39:44 +0000
committerJohannes Schickel2010-01-25 01:39:44 +0000
commitaed02365ec81e77b3c8aa4f4ecd9a9d3893326f2 (patch)
tree95f119e687a666f65aad5041910c43bdfd4f2929 /backends/fs
parentec14cd6e6add76ce4f719edd7ce508d67ebd9f14 (diff)
downloadscummvm-rg350-aed02365ec81e77b3c8aa4f4ecd9a9d3893326f2.tar.gz
scummvm-rg350-aed02365ec81e77b3c8aa4f4ecd9a9d3893326f2.tar.bz2
scummvm-rg350-aed02365ec81e77b3c8aa4f4ecd9a9d3893326f2.zip
Strip trailing spaces/tabs.
svn-id: r47541
Diffstat (limited to 'backends/fs')
-rw-r--r--backends/fs/psp/psp-fs.cpp6
-rw-r--r--backends/fs/psp/psp-stream.cpp40
-rw-r--r--backends/fs/psp/psp-stream.h8
3 files changed, 27 insertions, 27 deletions
diff --git a/backends/fs/psp/psp-fs.cpp b/backends/fs/psp/psp-fs.cpp
index 75a91e5802..0b3e26763e 100644
--- a/backends/fs/psp/psp-fs.cpp
+++ b/backends/fs/psp/psp-fs.cpp
@@ -112,7 +112,7 @@ bool PSPFilesystemNode::exists() const {
ret = access(_path.c_str(), F_OK);
PowerMan.endCriticalSection();
-
+
return ret == 0;
}
@@ -124,7 +124,7 @@ bool PSPFilesystemNode::isReadable() const {
ret = access(_path.c_str(), R_OK);
PowerMan.endCriticalSection();
-
+
return ret == 0;
}
@@ -136,7 +136,7 @@ bool PSPFilesystemNode::isWritable() const {
ret = access(_path.c_str(), W_OK);
PowerMan.endCriticalSection();
-
+
return ret == 0;
}
diff --git a/backends/fs/psp/psp-stream.cpp b/backends/fs/psp/psp-stream.cpp
index d72bafd0ad..c66a558fc3 100644
--- a/backends/fs/psp/psp-stream.cpp
+++ b/backends/fs/psp/psp-stream.cpp
@@ -39,11 +39,11 @@ PSPIoStream::PSPIoStream(const Common::String &path, bool writeMode)
assert(!path.empty());
_handle = (void *)0; // Need to do this since base class asserts not 0.
- _ferror = false;
+ _ferror = false;
_feof = false;
_pos = 0;
-#ifdef __PSP_DEBUG_SUSPEND__
+#ifdef __PSP_DEBUG_SUSPEND__
_errorSuspend = 0;
_errorSource = 0;
_errorPos = 0;
@@ -71,7 +71,7 @@ void *PSPIoStream::open() {
if (PowerMan.beginCriticalSection() == PowerManager::Blocked) {
// No need to open. Just return the _handle resume() already opened.
PSPDebugSuspend("Suspended in PSPIoStream::open\n");
- }
+ }
_handle = fopen(_path.c_str(), _writeMode ? "wb" : "rb"); // open
@@ -84,15 +84,15 @@ void *PSPIoStream::open() {
bool PSPIoStream::err() const {
if (_ferror)
- PSPDebugSuspend("In PSPIoStream::err - mem_ferror=%d, source=%d, suspend error=%d, pos=%d, _errorPos=%d, _errorHandle=%p, suspendCount=%d _handle\n",
+ PSPDebugSuspend("In PSPIoStream::err - mem_ferror=%d, source=%d, suspend error=%d, pos=%d, _errorPos=%d, _errorHandle=%p, suspendCount=%d _handle\n",
_ferror, _errorSource, _errorSuspend, _pos, _errorPos, _errorHandle, _suspendCount);
-
+
return _ferror;
}
void PSPIoStream::clearErr() {
_ferror = false; // Remove regular error bit
-
+
}
bool PSPIoStream::eos() const {
@@ -111,14 +111,14 @@ int32 PSPIoStream::size() const {
fseek((FILE *)_handle, 0, SEEK_END);
int32 length = ftell((FILE *)_handle);
fseek((FILE *)_handle, _pos, SEEK_SET);
-
+
if (_pos < 0 || length < 0) { // Check for errors
PSPDebugSuspend("In PSPIoStream::size(). encountered an error!\n");
_ferror = true;
length = -1; // If our oldPos is bad, we want length to be bad too to signal
clearerr((FILE *)_handle);
-#ifdef __PSP_DEBUG_SUSPEND__
+#ifdef __PSP_DEBUG_SUSPEND__
_errorSource = 2;
#endif
}
@@ -134,21 +134,21 @@ bool PSPIoStream::seek(int32 offs, int whence) {
PSPDebugSuspend("Suspended in PSPIoStream::seek()\n");
int ret = fseek((FILE *)_handle, offs, whence);
-
+
if (ret != 0) {
_ferror = true;
PSPDebugSuspend("In PSPIoStream::seek(). encountered an error!\n");
clearerr((FILE *)_handle);
_feof = feof((FILE *)_handle);
-#ifdef __PSP_DEBUG_SUSPEND__
+#ifdef __PSP_DEBUG_SUSPEND__
_errorSource = 3;
#endif
}
else { // everything ok
_feof = false; // Reset eof flag since we know it was ok
}
-
+
_pos = ftell((FILE *)_handle); // update pos
PowerMan.endCriticalSection();
@@ -161,10 +161,10 @@ uint32 PSPIoStream::read(void *ptr, uint32 len) {
if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
PSPDebugSuspend("Suspended in PSPIoStream::read()\n");
- size_t ret = fread((byte *)ptr, 1, len, (FILE *)_handle);
+ size_t ret = fread((byte *)ptr, 1, len, (FILE *)_handle);
_pos += ret; // Update pos
-
+
if (ret != len) { // Check for eof
_feof = feof((FILE *)_handle);
if (!_feof) { // It wasn't an eof. Must be an error
@@ -173,14 +173,14 @@ uint32 PSPIoStream::read(void *ptr, uint32 len) {
_pos = ftell((FILE *)_handle); // Update our position
PSPDebugSuspend("In PSPIoStream::read(). encountered an error!\n");
-#ifdef __PSP_DEBUG_SUSPEND__
+#ifdef __PSP_DEBUG_SUSPEND__
_errorSource = 4;
#endif
}
}
-
+
PowerMan.endCriticalSection();
-
+
return ret;
}
@@ -199,7 +199,7 @@ uint32 PSPIoStream::write(const void *ptr, uint32 len) {
_pos = ftell((FILE *)_handle); // Update pos
PSPDebugTrace("In PSPIoStream::write(). encountered an error!\n");
-#ifdef __PSP_DEBUG_SUSPEND__
+#ifdef __PSP_DEBUG_SUSPEND__
_errorSource = 5;
#endif
}
@@ -221,7 +221,7 @@ bool PSPIoStream::flush() {
clearerr((FILE *)_handle);
PSPDebugSuspend("In PSPIoStream::flush(). encountered an error!\n");
-#ifdef __PSP_DEBUG_SUSPEND__
+#ifdef __PSP_DEBUG_SUSPEND__
_errorSource = 6;
#endif
}
@@ -256,7 +256,7 @@ int PSPIoStream::suspend() {
_errorSuspend = SuspendError;
_errorPos = _pos;
_errorHandle = _handle;
- }
+ }
#endif /* __PSP_DEBUG_SUSPEND__ */
if (_handle > 0) {
@@ -275,7 +275,7 @@ int PSPIoStream::resume() {
#ifdef __PSP_DEBUG_SUSPEND__
_suspendCount--;
#endif
-
+
// We reopen our file descriptor
_handle = fopen(_path.c_str(), _writeMode ? "wb" : "rb");
if (_handle <= 0) {
diff --git a/backends/fs/psp/psp-stream.h b/backends/fs/psp/psp-stream.h
index 112d36ccdb..679fe8dacd 100644
--- a/backends/fs/psp/psp-stream.h
+++ b/backends/fs/psp/psp-stream.h
@@ -48,12 +48,12 @@ protected:
int _errorSuspend;
mutable int _errorSource;
-
-#ifdef __PSP_DEBUG_SUSPEND__
+
+#ifdef __PSP_DEBUG_SUSPEND__
int _errorPos;
- void * _errorHandle;
+ void * _errorHandle;
int _suspendCount;
-#endif /* __PSP_DEBUG_SUSPEND__ */
+#endif /* __PSP_DEBUG_SUSPEND__ */
public:
/**