[Scummvm-cvs-logs] SF.net SVN: scummvm:[42912] scummvm/trunk/engines
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Jul 29 23:39:34 CEST 2009
Revision: 42912
http://scummvm.svn.sourceforge.net/scummvm/?rev=42912&view=rev
Author: fingolfin
Date: 2009-07-29 21:39:34 +0000 (Wed, 29 Jul 2009)
Log Message:
-----------
SWORD1 & SWORD2: Replaced ioFailed by err+eos
Modified Paths:
--------------
scummvm/trunk/engines/sword1/control.cpp
scummvm/trunk/engines/sword1/resman.cpp
scummvm/trunk/engines/sword2/resman.cpp
scummvm/trunk/engines/sword2/startup.cpp
Modified: scummvm/trunk/engines/sword1/control.cpp
===================================================================
--- scummvm/trunk/engines/sword1/control.cpp 2009-07-29 21:39:16 UTC (rev 42911)
+++ scummvm/trunk/engines/sword1/control.cpp 2009-07-29 21:39:34 UTC (rev 42912)
@@ -1207,7 +1207,7 @@
for (uint32 cnt2 = 0; cnt2 < playerSize; cnt2++)
playerBuf[cnt2] = inf->readUint32LE();
- if (inf->ioFailed()) {
+ if (inf->err() || inf->eos()) {
displayMessage(0, "Can't read from file '%s'. (%s)", fName, _saveFileMan->popErrorDesc().c_str());
delete inf;
free(_restoreBuf);
Modified: scummvm/trunk/engines/sword1/resman.cpp
===================================================================
--- scummvm/trunk/engines/sword1/resman.cpp 2009-07-29 21:39:16 UTC (rev 42911)
+++ scummvm/trunk/engines/sword1/resman.cpp 2009-07-29 21:39:34 UTC (rev 42912)
@@ -263,9 +263,9 @@
_memMan->alloc(memHandle, size);
Common::File *clusFile = resFile(id);
assert(clusFile);
- clusFile->seek( resOffset(id) );
- clusFile->read( memHandle->data, size);
- if (clusFile->ioFailed()) {
+ clusFile->seek(resOffset(id));
+ clusFile->read(memHandle->data, size);
+ if (clusFile->err() || clusFile->eos()) {
error("Can't read %d bytes from offset %d from cluster file %s\nResource ID: %d (%08X)", size, resOffset(id), _prj.clu[(id >> 24) - 1].label, id, id);
}
} else
Modified: scummvm/trunk/engines/sword2/resman.cpp
===================================================================
--- scummvm/trunk/engines/sword2/resman.cpp 2009-07-29 21:39:16 UTC (rev 42911)
+++ scummvm/trunk/engines/sword2/resman.cpp 2009-07-29 21:39:34 UTC (rev 42912)
@@ -151,7 +151,7 @@
for (i = 0; i < size / 2; i++)
_resConvTable[i] = file.readUint16LE();
- if (file.ioFailed()) {
+ if (file.eos() || file.err()) {
file.close();
GUIErrorMessage("Broken Sword 2: Cannot read resource.tab");
return false;
@@ -178,7 +178,7 @@
cdInf[i].cd = file.readByte();
- if (file.ioFailed()) {
+ if (file.eos() || file.err()) {
delete cdInf;
file.close();
GUIErrorMessage("Broken Sword 2: Cannot read cd.inf");
@@ -477,7 +477,7 @@
_resFiles[fileNum].entryTab = (uint32*)malloc(tableSize);
_resFiles[fileNum].numEntries = tableSize / 8;
file->read(_resFiles[fileNum].entryTab, tableSize);
- if (file->ioFailed())
+ if (file->eos() || file->err())
error("unable to read index table from file %s", _resFiles[fileNum].fileName);
#ifdef SCUMM_BIG_ENDIAN
Modified: scummvm/trunk/engines/sword2/startup.cpp
===================================================================
--- scummvm/trunk/engines/sword2/startup.cpp 2009-07-29 21:39:16 UTC (rev 42911)
+++ scummvm/trunk/engines/sword2/startup.cpp 2009-07-29 21:39:34 UTC (rev 42912)
@@ -66,7 +66,7 @@
int start_ids[MAX_starts];
int lineno = 0;
- while (!fp.eos() && !fp.ioFailed()) {
+ while (!fp.eos() && !fp.err()) {
Common::String line = fp.readLine();
// Skip empty lines or, more likely, the end of the stream.
@@ -103,7 +103,7 @@
}
// An I/O error before EOS? That's bad, but this is not a vital file.
- if (fp.ioFailed() && !fp.eos())
+ if (fp.err() && !fp.eos())
warning("I/O error while reading startup.inf");
fp.close();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list