aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-07-28 22:28:40 +0000
committerMax Horn2009-07-28 22:28:40 +0000
commit50cd2750ccc094a18ab8cad51c35b04004829d6d (patch)
tree82df254a6dc81b0cc3e40ee914c152611def9975 /engines
parent972cbb4b579bb3767b118e666c761422e20b14b0 (diff)
downloadscummvm-rg350-50cd2750ccc094a18ab8cad51c35b04004829d6d.tar.gz
scummvm-rg350-50cd2750ccc094a18ab8cad51c35b04004829d6d.tar.bz2
scummvm-rg350-50cd2750ccc094a18ab8cad51c35b04004829d6d.zip
SCI: Avoid using perror (it's not portable)
svn-id: r42866
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/seg_manager.cpp13
-rw-r--r--engines/sci/engine/seg_manager.h7
-rw-r--r--engines/sci/resource.cpp8
3 files changed, 6 insertions, 22 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 6752ba3e56..905cba9d94 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -169,7 +169,9 @@ int SegManager::initialiseScript(Script &scr, EngineState *s, int script_nr) {
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 @@ int SegManager::freeDynmem(reg_t addr) {
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
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index a41d820014..9d406f559f 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -362,13 +362,6 @@ private:
* '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
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index d99f9f0771..943361332f 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -882,7 +882,7 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType restype,
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 @@ int ResourceManager::readResourceMapSCI0(ResourceSource *map) {
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 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map) {
}
}
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);