From 34f90ac043230f049c58aaaf843ac347e0fc5c21 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 21 Feb 2009 14:11:41 +0000 Subject: revert large parts of r38621. error() is for fatal errors and does not return. warning() is not for debugging status messages. svn-id: r38696 --- engines/sci/include/heapmgr.h | 4 ++-- engines/sci/include/kdebug.h | 13 ++++++++++++- engines/sci/include/resource.h | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'engines/sci/include') 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 -- cgit v1.2.3