From 9daed50e0165f387f597fec4d06b57805e1f717c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 15 Feb 2009 14:46:42 +0000 Subject: 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 --- engines/sci/include/gfx_resource.h | 4 ++-- engines/sci/include/kdebug.h | 4 ++-- engines/sci/include/kernel.h | 1 + engines/sci/include/sci_memory.h | 10 +++++----- 4 files changed, 10 insertions(+), 9 deletions(-) (limited to 'engines/sci/include') 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 */\ -- cgit v1.2.3