aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2008-09-16 11:42:21 +0000
committerMax Horn2008-09-16 11:42:21 +0000
commit706fb37061d96fdf5c8d1a202d6dcc9a799c8d2b (patch)
tree2951410fcbcd06b5e33f7f997ee8a739ef974505 /common
parent3bffca569f6d4677ca5502dbe3a7f8ef33f369be (diff)
downloadscummvm-rg350-706fb37061d96fdf5c8d1a202d6dcc9a799c8d2b.tar.gz
scummvm-rg350-706fb37061d96fdf5c8d1a202d6dcc9a799c8d2b.tar.bz2
scummvm-rg350-706fb37061d96fdf5c8d1a202d6dcc9a799c8d2b.zip
Modified uncompress in common/zlib.h to return a bool, so that we don't have to #include the real zlib.h; fixed PSP backend to not run uncompress inside an assert (which would cause it to not be invoked when turning off asserts)
svn-id: r34576
Diffstat (limited to 'common')
-rw-r--r--common/zlib.cpp4
-rw-r--r--common/zlib.h25
2 files changed, 13 insertions, 16 deletions
diff --git a/common/zlib.cpp b/common/zlib.cpp
index 7e14a9e3ab..4f7c17f413 100644
--- a/common/zlib.cpp
+++ b/common/zlib.cpp
@@ -34,8 +34,8 @@
namespace Common {
-int uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen) {
- return ::uncompress(dst, dstLen, src, srcLen);
+bool uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen) {
+ return Z_OK == ::uncompress(dst, dstLen, src, srcLen);
}
} // end of namespace Common
diff --git a/common/zlib.h b/common/zlib.h
index 62e9f98c01..1354134816 100644
--- a/common/zlib.h
+++ b/common/zlib.h
@@ -22,26 +22,23 @@
* $Id$
*/
-#include "common/scummsys.h"
-
-#if defined(USE_ZLIB)
-
#ifndef COMMON_ZLIB_H
#define COMMON_ZLIB_H
-#ifdef __SYMBIAN32__
-#include <zlib\zlib.h>
-#else
-#include <zlib.h>
-#endif
+#include "common/scummsys.h"
-namespace Common {
+#if defined(USE_ZLIB)
-enum {
- ZLIB_OK = Z_OK
-};
+namespace Common {
-int uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen);
+/**
+ * Thin wrapper around zlib's uncompress() function. This wrapper makes
+ * it possible to uncompress data in engines without being forced to link
+ * them against zlib, thus simplifying the build system.
+ *
+ * @return true on success (i.e. Z_OK), false otherwise
+ */
+bool uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen);
} // end of namespace Common