aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/include
diff options
context:
space:
mode:
authorMax Horn2009-02-15 14:46:42 +0000
committerMax Horn2009-02-15 14:46:42 +0000
commit9daed50e0165f387f597fec4d06b57805e1f717c (patch)
treeeca2f45cf9f2b90ef83be380e42d32e99ecb1862 /engines/sci/include
parent0082a84b8d956bf25c6aaef153d401d641f0923d (diff)
downloadscummvm-rg350-9daed50e0165f387f597fec4d06b57805e1f717c.tar.gz
scummvm-rg350-9daed50e0165f387f597fec4d06b57805e1f717c.tar.bz2
scummvm-rg350-9daed50e0165f387f597fec4d06b57805e1f717c.zip
Fixed lots of warnings and errors (on my system) by backporting a patch I had sent the FreeSCI folks some time ago (but apparently it never made it, or only made it to a branch not imported?)
svn-id: r38245
Diffstat (limited to 'engines/sci/include')
-rw-r--r--engines/sci/include/gfx_resource.h4
-rw-r--r--engines/sci/include/kdebug.h4
-rw-r--r--engines/sci/include/kernel.h1
-rw-r--r--engines/sci/include/sci_memory.h10
4 files changed, 10 insertions, 9 deletions
diff --git a/engines/sci/include/gfx_resource.h b/engines/sci/include/gfx_resource.h
index 8632710556..b6c9385035 100644
--- a/engines/sci/include/gfx_resource.h
+++ b/engines/sci/include/gfx_resource.h
@@ -424,13 +424,13 @@ gfxr_endianness_adjust(gfx_pixmap_t *pixmap, gfx_mode_t *mode);
static inline int
-get_uint_16(byte *offset)
+get_uint_16(const byte *offset)
{
return ((unsigned int) offset[0] | (((unsigned int) offset[1]) << 8));
}
static inline int
-get_int_16(byte *offset)
+get_int_16(const byte *offset)
{
return ((int) offset[0] | (((int) offset[1]) << 8));
}
diff --git a/engines/sci/include/kdebug.h b/engines/sci/include/kdebug.h
index 9c69126e41..74db2365eb 100644
--- a/engines/sci/include/kdebug.h
+++ b/engines/sci/include/kdebug.h
@@ -67,7 +67,7 @@ struct _state;
#ifdef SCI_KERNEL_DEBUG
-#ifdef __GNUC__
+#ifdef __GNUC__XXX
#define SCIkdebug(arguments...) _SCIGNUkdebug(__PRETTY_FUNCTION__, ## arguments)
@@ -85,7 +85,7 @@ struct _state;
-#ifdef __GNUC__
+#ifdef __GNUC__XXX
#define SCIkwarn(arguments...) _SCIGNUkdebug(__PRETTY_FUNCTION__, ## arguments)
diff --git a/engines/sci/include/kernel.h b/engines/sci/include/kernel.h
index d34a884cd5..a58f0bfc9d 100644
--- a/engines/sci/include/kernel.h
+++ b/engines/sci/include/kernel.h
@@ -32,6 +32,7 @@
#include "sci/include/kdebug.h"
#include "sci/include/uinput.h"
#include "sci/include/event.h"
+#include "sci/include/vm.h"
#include "sci/include/console.h" /* sciprintf() */
#ifdef HAVE_FNMATCH_H
diff --git a/engines/sci/include/sci_memory.h b/engines/sci/include/sci_memory.h
index 4b02454e1d..ce66a75aa1 100644
--- a/engines/sci/include/sci_memory.h
+++ b/engines/sci/include/sci_memory.h
@@ -134,14 +134,14 @@ do {\
#define ALLOC_MEM(alloc_statement, size, filename, linenum, funcname)\
do {\
- if (size < 0)\
+ if (size == 0)\
{\
- PANIC_MEMORY(size, filename, linenum, funcname, "Cannot allocate negative bytes of memory!")\
- BREAKPOINT()\
+ PANIC_MEMORY(size, filename, linenum, funcname, "WARNING: allocating zero bytes of memory.")\
}\
- else if (size == 0)\
+ else if (!(size > 0))\
{\
- PANIC_MEMORY(size, filename, linenum, funcname, "WARNING: allocating zero bytes of memory.")\
+ PANIC_MEMORY(size, filename, linenum, funcname, "Cannot allocate negative bytes of memory!")\
+ BREAKPOINT()\
}\
\
alloc_statement; /* attempt to allocate the memory */\