aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/include
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-02-21 14:11:41 +0000
committerWillem Jan Palenstijn2009-02-21 14:11:41 +0000
commit34f90ac043230f049c58aaaf843ac347e0fc5c21 (patch)
tree36bc91c0e2ff560438f1c8e2f3e7565f82883e79 /engines/sci/include
parent7ce7993c30225f3c28ce2a8d68935ef03a6e7175 (diff)
downloadscummvm-rg350-34f90ac043230f049c58aaaf843ac347e0fc5c21.tar.gz
scummvm-rg350-34f90ac043230f049c58aaaf843ac347e0fc5c21.tar.bz2
scummvm-rg350-34f90ac043230f049c58aaaf843ac347e0fc5c21.zip
revert large parts of r38621. error() is for fatal errors and does not return. warning() is not for debugging status messages.
svn-id: r38696
Diffstat (limited to 'engines/sci/include')
-rw-r--r--engines/sci/include/heapmgr.h4
-rw-r--r--engines/sci/include/kdebug.h13
-rw-r--r--engines/sci/include/resource.h2
3 files changed, 15 insertions, 4 deletions
diff --git a/engines/sci/include/heapmgr.h b/engines/sci/include/heapmgr.h
index d8d787e95d..db72e41c95 100644
--- a/engines/sci/include/heapmgr.h
+++ b/engines/sci/include/heapmgr.h
@@ -80,8 +80,8 @@ free_##ENTRY##_entry(ENTRY##_table_t *table, int index) \
ENTRY##_entry_t *e = table->table + index; \
\
if (index < 0 || index >= table->max_entry) { \
- error("heapmgr: Attempt to release" \
- " invalid table index %d", index); \
+ fprintf(stderr, "heapmgr: Attempt to release" \
+ " invalid table index %d!\n", index); \
BREAKPOINT(); \
} \
CLEANUP_FN(&(e->entry)); \
diff --git a/engines/sci/include/kdebug.h b/engines/sci/include/kdebug.h
index e830965b7b..c652c1952d 100644
--- a/engines/sci/include/kdebug.h
+++ b/engines/sci/include/kdebug.h
@@ -41,6 +41,7 @@ namespace Sci {
#define SCIkPARSER_NR 10
#define SCIkAVOIDPATH_NR 17
+#define SCIkERROR s, __FILE__, __LINE__, SCIkERROR_NR
#define SCIkNODES s, __FILE__, __LINE__, 1
#define SCIkGRAPHICS s, __FILE__, __LINE__, 2
#define SCIkSTRINGS s, __FILE__, __LINE__, 3
@@ -77,8 +78,18 @@ namespace Sci {
#endif /* !SCI_KERNEL_DEBUG */
+#ifdef __GNUC__XXX
+
+#define SCIkwarn(arguments...) _SCIGNUkdebug(__PRETTY_FUNCTION__, ## arguments)
+
+#else /* !__GNUC__ */
+
+#define SCIkwarn _SCIkwarn
+
+#endif /* !__GNUC__ */
-/* Internal functions */
+ /* Internal functions */
+void _SCIkwarn(EngineState *s, const char *file, int line, int area, const char *format, ...);
void _SCIkdebug(EngineState *s, const char *file, int line, int area, const char *format, ...);
void _SCIGNUkdebug(const char *funcname, EngineState *s, const char *file, int line, int area, const char *format, ...);
diff --git a/engines/sci/include/resource.h b/engines/sci/include/resource.h
index 070e662e1c..9865e2aa07 100644
--- a/engines/sci/include/resource.h
+++ b/engines/sci/include/resource.h
@@ -292,7 +292,7 @@ void sci_sched_yield(void);
# endif /* !__i386__ && !__alpha__ */
#endif
#ifndef BREAKPOINT
-# define BREAKPOINT() { error("Missed breakpoint in %s, line %d\n", __FILE__, __LINE__); *((int *) NULL) = 42; }
+# define BREAKPOINT() { fprintf(stderr, "Missed breakpoint in %s, line %d\n", __FILE__, __LINE__); *((int *) NULL) = 42; }
#endif /* !BREAKPOINT() */
} // End of namespace Sci