[Scummvm-cvs-logs] SF.net SVN: scummvm:[42866] scummvm/trunk/engines/sci
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Wed Jul 29 00:28:40 CEST 2009
Revision: 42866
http://scummvm.svn.sourceforge.net/scummvm/?rev=42866&view=rev
Author: fingolfin
Date: 2009-07-28 22:28:40 +0000 (Tue, 28 Jul 2009)
Log Message:
-----------
SCI: Avoid using perror (it's not portable)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/seg_manager.cpp
scummvm/trunk/engines/sci/engine/seg_manager.h
scummvm/trunk/engines/sci/resource.cpp
Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp 2009-07-28 21:32:55 UTC (rev 42865)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp 2009-07-28 22:28:40 UTC (rev 42866)
@@ -169,7 +169,9 @@
setScriptSize(scr, s, script_nr);
scr.buf = (byte *)malloc(scr.buf_size);
- dbgPrint("scr.buf ", scr.buf);
+#ifdef DEBUG_SEG_MANAGER
+ printf("scr.buf = %p ", scr.buf);
+#endif
if (!scr.buf) {
scr.freeScript();
warning("SegManager: Not enough memory space for script size");
@@ -864,14 +866,5 @@
return 0; // OK
}
-void SegManager::dbgPrint(const char* msg, void *i) {
-#ifdef DEBUG_SEG_MANAGER
- char buf[1000];
- sprintf(buf, "%s = [0x%x], dec:[%d]", msg, i, i);
- perror(buf);
-#endif
-}
-
-
} // End of namespace Sci
Modified: scummvm/trunk/engines/sci/engine/seg_manager.h
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.h 2009-07-28 21:32:55 UTC (rev 42865)
+++ scummvm/trunk/engines/sci/engine/seg_manager.h 2009-07-28 22:28:40 UTC (rev 42866)
@@ -362,13 +362,6 @@
* 'seg' is a valid segment
*/
bool check(SegmentId seg);
-
- void dbgPrint(const char* msg, void *i); // for debug only
-
- // Perform garbage collection
- // Parameters: (EngineState *) s: The state to operate on
- // Effects : Unreachable objects in 's' are deallocated
- //void sm_gc(EngineState *s);
};
} // End of namespace Sci
Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp 2009-07-28 21:32:55 UTC (rev 42865)
+++ scummvm/trunk/engines/sci/resource.cpp 2009-07-28 22:28:40 UTC (rev 42866)
@@ -882,7 +882,7 @@
if (resnumber == -1)
return;
if (!file.open(source->location_name)) {
- perror("""__FILE__"": (""__LINE__""): failed to open");
+ warning("ResourceManager::processPatch(): failed to open %s", source->location_name.c_str());
return;
}
fsize = file.size();
@@ -1007,8 +1007,7 @@
offset = file.readUint32LE();
if (file.ioFailed()) {
- warning("Error while reading %s: ", map->location_name.c_str());
- perror("");
+ warning("Error while reading %s", map->location_name.c_str());
return SCI_ERROR_RESMAP_NOT_FOUND;
}
if (offset == 0xFFFFFFFF)
@@ -1079,8 +1078,7 @@
}
}
if (file.ioFailed()) {
- warning("Error while reading %s: ", map->location_name.c_str());
- perror("");
+ warning("Error while reading %s", map->location_name.c_str());
return SCI_ERROR_RESMAP_NOT_FOUND;
}
resId = ResourceId((ResourceType)type, number);
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