[Scummvm-cvs-logs] SF.net SVN: scummvm:[38621] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Feb 20 21:39:02 CET 2009


Revision: 38621
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38621&view=rev
Author:   thebluegr
Date:     2009-02-20 20:39:02 +0000 (Fri, 20 Feb 2009)

Log Message:
-----------
Changed more messages to warnings/errors

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/engine/gc.cpp
    scummvm/trunk/engines/sci/engine/heap.cpp
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kfile.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/klists.cpp
    scummvm/trunk/engines/sci/engine/kmovement.cpp
    scummvm/trunk/engines/sci/engine/kscripts.cpp
    scummvm/trunk/engines/sci/engine/ksound.cpp
    scummvm/trunk/engines/sci/engine/kstring.cpp
    scummvm/trunk/engines/sci/engine/said.cpp
    scummvm/trunk/engines/sci/engine/scriptconsole.cpp
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp
    scummvm/trunk/engines/sci/engine/seg_manager.cpp
    scummvm/trunk/engines/sci/engine/sys_strings.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/gfx/font.cpp
    scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
    scummvm/trunk/engines/sci/gfx/gfx_res_options.cpp
    scummvm/trunk/engines/sci/gfx/gfx_resource.cpp
    scummvm/trunk/engines/sci/gfx/gfx_support.cpp
    scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/gfx/resmgr.cpp
    scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp
    scummvm/trunk/engines/sci/gfx/resource/sci_view_1.cpp
    scummvm/trunk/engines/sci/gfx/sbtree.cpp
    scummvm/trunk/engines/sci/gfx/sci_widgets.cpp
    scummvm/trunk/engines/sci/gfx/widgets.cpp
    scummvm/trunk/engines/sci/include/heapmgr.h
    scummvm/trunk/engines/sci/include/kdebug.h
    scummvm/trunk/engines/sci/include/resource.h
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/scicore/console.cpp
    scummvm/trunk/engines/sci/scicore/decompress0.cpp
    scummvm/trunk/engines/sci/scicore/decompress01.cpp
    scummvm/trunk/engines/sci/scicore/decompress1.cpp
    scummvm/trunk/engines/sci/scicore/decompress11.cpp
    scummvm/trunk/engines/sci/scicore/resource.cpp
    scummvm/trunk/engines/sci/scicore/resource_map.cpp
    scummvm/trunk/engines/sci/scicore/sci_memory.cpp
    scummvm/trunk/engines/sci/scicore/script.cpp
    scummvm/trunk/engines/sci/scicore/tools.cpp
    scummvm/trunk/engines/sci/scicore/vocab.cpp
    scummvm/trunk/engines/sci/scicore/vocab_debug.cpp
    scummvm/trunk/engines/sci/sfx/core.cpp
    scummvm/trunk/engines/sci/sfx/device/devices.cpp
    scummvm/trunk/engines/sci/sfx/iterator.cpp
    scummvm/trunk/engines/sci/sfx/mixer/soft.cpp
    scummvm/trunk/engines/sci/sfx/player/polled.cpp
    scummvm/trunk/engines/sci/sfx/player/realtime.cpp
    scummvm/trunk/engines/sci/sfx/softseq/SN76496.cpp
    scummvm/trunk/engines/sci/sfx/softseq/opl2.cpp
    scummvm/trunk/engines/sci/sfx/softseq/pcspeaker.cpp
    scummvm/trunk/engines/sci/sfx/time.cpp

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -53,7 +53,7 @@
 	s->opcodes = vocabulary_get_opcodes(s->resmgr);
 
 	if (!(s->selector_names = vocabulary_get_snames(s->resmgr, NULL, s->version))) {
-		sciprintf("_init_vocabulary(): Could not retrieve selector names (vocab.997)!\n");
+		sciprintf("_init_vocabulary(): Could not retrieve selector names (vocab.997)");
 		return 1;
 	}
 
@@ -150,7 +150,7 @@
 				_sci1_alloc_system_colors(s);
 				scir_unlock_resource(s->resmgr, resource, sci_palette, 999);
 			} else {
-				sciprintf("Couldn't find the default palette!\n");
+				sciprintf("Couldn't find the default palette");
 			}
 		}
 	}
@@ -328,7 +328,7 @@
 					classnr = getUInt16((byte*)seeker_ptr + 10);
 					if (classnr >= s->classtable_size) {
 						if (classnr >= SCRIPT_MAX_CLASSTABLE_SIZE) {
-							fprintf(stderr, "Invalid class number 0x%x in script.%d(0x%x), offset %04x\n",
+							error("Invalid class number 0x%x in script.%d(0x%x), offset %04x\n",
 							        classnr, scriptnr, scriptnr, seeker_offset);
 							return 1;
 						}
@@ -402,7 +402,7 @@
 					if (classnr >= s->classtable_size) {
 
 						if (classnr >= SCRIPT_MAX_CLASSTABLE_SIZE) {
-							fprintf(stderr, "Invalid class number 0x%x in script.%d(0x%x), offset %04x\n",
+							error("Invalid class number 0x%x in script.%d(0x%x), offset %04x\n",
 							        classnr, scriptnr, scriptnr, seeker);
 							return 1;
 						}

Modified: scummvm/trunk/engines/sci/engine/gc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/gc.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/gc.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -77,7 +77,7 @@
 	reg_t retval;
 
 	if (!wl || !wl->used) {
-		fprintf(stderr, "Attempt to pop from empty worklist");
+		error("Attempt to pop from empty worklist");
 		exit(1);
 	}
 

Modified: scummvm/trunk/engines/sci/engine/heap.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/heap.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/heap.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -116,7 +116,7 @@
 	unsigned int current = previous;
 
 	if (!size) {
-		fprintf(stderr, "Warning: heap_alloc'd zero bytes!\n");
+		error("Warning: heap_alloc'd zero bytes");
 		size += 2;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -353,7 +353,7 @@
 
 int kernel_oops(state_t *s, const char *file, int line, const char *reason) {
 	sciprintf("Kernel Oops in file %s, line %d: %s\n", file, line, reason);
-	fprintf(stderr, "Kernel Oops in file %s, line %d: %s\n", file, line, reason);
+	error("Kernel Oops in file %s, line %d: %s\n", file, line, reason);
 	script_debug_flag = script_error_flag = 1;
 	return 0;
 }
@@ -386,7 +386,7 @@
 	hunk_table_t *ht = &(mobj->data.hunks);
 
 	if (!mobj || !ENTRY_IS_VALID(ht, handle.offset)) {
-		SCIkwarn(SCIkERROR, "Error: kmem() with invalid handle\n");
+		error("Error: kmem() with invalid handle\n");
 		return NULL;
 	}
 
@@ -504,7 +504,7 @@
 
 #ifdef WIN32
 	if (TIMERR_NOERROR != timeBeginPeriod(1)) {
-		fprintf(stderr, "timeBeginPeriod(1) failed in kGetTime!\n");
+		error("timeBeginPeriod(1) failed in kGetTime");
 	}
 #endif // WIN32
 
@@ -513,7 +513,7 @@
 
 #ifdef WIN32
 	if (TIMERR_NOERROR != timeEndPeriod(1)) {
-		fprintf(stderr, "timeEndPeriod(1) failed in kGetTime!\n");
+		error("timeEndPeriod(1) failed in kGetTime");
 	}
 #endif // WIN32
 
@@ -577,7 +577,7 @@
 	switch (UKPV(0)) {
 	case K_MEMORY_ALLOCATE_CRITICAL :
 		if (!sm_alloc_dynmem(&s->seg_manager, UKPV(1), "kMemory() critical", &s->r_acc)) {
-			SCIkwarn(SCIkERROR, "Critical heap allocation failed\n");
+			error("Critical heap allocation failed\n");
 			script_error_flag = script_debug_flag = 1;
 		}
 		return s->r_acc;
@@ -587,7 +587,7 @@
 		break;
 	case K_MEMORY_FREE :
 		if (sm_free_dynmem(&s->seg_manager, argv[1])) {
-			SCIkwarn(SCIkERROR, "Attempt to kMemory::free() non-dynmem pointer "PREG"!\n", PRINT_REG(argv[1]));
+			error("Attempt to kMemory::free() non-dynmem pointer "PREG"", PRINT_REG(argv[1]));
 		}
 		break;
 	case K_MEMORY_MEMCPY : {
@@ -612,7 +612,7 @@
 		byte *ref = kernel_dereference_bulk_pointer(s, argv[1], 2);
 
 		if (!ref) {
-			SCIkdebug(SCIkERROR, "Attempt to poke invalid memory at "PREG"!\n", PRINT_REG(argv[1]));
+			error("Attempt to poke invalid memory at "PREG"", PRINT_REG(argv[1]));
 			return s->r_acc;
 		}
 		if (s->seg_manager.heap[argv[1].segment]->type == MEM_OBJ_LOCALS)
@@ -625,7 +625,7 @@
 		byte *ref = kernel_dereference_bulk_pointer(s, argv[1], 2);
 
 		if (!ref) {
-			SCIkdebug(SCIkERROR, "Attempt to poke invalid memory at "PREG"!\n", PRINT_REG(argv[1]));
+			error("Attempt to poke invalid memory at "PREG"", PRINT_REG(argv[1]));
 			return s->r_acc;
 		}
 
@@ -633,7 +633,7 @@
 			*((reg_t *) ref) = argv[2];
 		else {
 			if (argv[2].segment) {
-				SCIkdebug(SCIkERROR, "Attempt to poke memory reference "PREG" to "PREG"!\n", PRINT_REG(argv[2]), PRINT_REG(argv[1]));
+				error("Attempt to poke memory reference "PREG" to "PREG"", PRINT_REG(argv[2]), PRINT_REG(argv[1]));
 				return s->r_acc;
 				putInt16(ref, argv[2].offset); // ???
 			}
@@ -951,12 +951,12 @@
 	void *retval = sm_dereference(&s->seg_manager, pointer, &maxsize);
 
 	if (pointer.offset & (align - 1)) {
-		SCIkdebug(SCIkERROR, "Unaligned pointer read: "PREG" expected with %d alignment!\n", PRINT_REG(pointer), align);
+		error("Unaligned pointer read: "PREG" expected with %d alignment", PRINT_REG(pointer), align);
 		return NULL;
 	}
 
 	if (entries > maxsize) {
-		SCIkdebug(SCIkERROR, "Trying to dereference pointer "PREG" beyond end of segment!\n", PRINT_REG(pointer));
+		error("Trying to dereference pointer "PREG" beyond end of segment", PRINT_REG(pointer));
 		return NULL;
 	}
 	return retval;

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -144,7 +144,7 @@
 			SCIkdebug(SCIkFILE, "Failed. Attempting to copy from resource dir...\n");
 			file = f_open_mirrored(s, filename);
 			if (file)
-				SCIkdebug(SCIkFILE, "Success!\n");
+				SCIkdebug(SCIkFILE, "Success");
 			else
 				SCIkdebug(SCIkFILE, "Not found.\n");
 		}
@@ -181,12 +181,12 @@
 
 static FILE *getFileFromHandle(state_t *s, int handle) {
 	if (handle == 0) {
-		SCIkwarn(SCIkERROR, "Attempt to use file handle 0\n");
+		error("Attempt to use file handle 0\n");
 		return 0;
 	}
 
 	if ((handle >= s->file_handles_nr) || (s->file_handles[handle] == NULL)) {
-		SCIkwarn(SCIkERROR, "Attempt to use invalid/unused file handle %d\n", handle);
+		error("Attempt to use invalid/unused file handle %d\n", handle);
 		return 0;
 	}
 	
@@ -421,7 +421,7 @@
 	}
 	break;
 	default: {
-		SCIkwarn(SCIkERROR, "Unknown DeviceInfo() sub-command: %d\n", mode);
+		error("Unknown DeviceInfo() sub-command: %d\n", mode);
 	}
 	}
 	return s->r_acc;
@@ -483,7 +483,7 @@
 	}
 	break;
 	default: {
-		SCIkwarn(SCIkERROR, "Unknown DeviceInfo() sub-command: %d\n", mode);
+		error("Unknown DeviceInfo() sub-command: %d\n", mode);
 	}
 	}
 
@@ -780,13 +780,13 @@
 			} else ++i;
 		}
 		if (savedir_id >= MAX_SAVEGAME_NR) {
-			sciprintf("Internal error: Free savegame ID is %d, shouldn't happen!\n", savedir_id);
+			sciprintf("Internal error: Free savegame ID is %d, shouldn't happen", savedir_id);
 			return NULL_REG;
 		}
 
 		// This loop terminates when savedir_id is not in [x | ex. n. _savegame_indices[n].id = x]
 	} else {
-		sciprintf("Savegame ID %d is not allowed!\n", savedir_nr);
+		sciprintf("Savegame ID %d is not allowed", savedir_nr);
 		return NULL_REG;
 	}
 
@@ -853,7 +853,7 @@
 		}
 	} else {
 		s->r_acc = make_reg(0, 1);
-		sciprintf("Savegame #%d not found!\n", savedir_nr);
+		sciprintf("Savegame #%d not found", savedir_nr);
 	}
 
 	_chdir_restoredir(workdir);
@@ -904,7 +904,7 @@
 
 void first_file(state_t *s, const char *dir, char *mask, reg_t buffer) {
 	if (!buffer.segment) {
-		sciprintf("Warning: first_file(state,\"%s\",\"%s\", 0) invoked!\n", dir, mask);
+		sciprintf("Warning: first_file(state,\"%s\",\"%s\", 0) invoked", dir, mask);
 		s->r_acc = NULL_REG;
 		return;
 	}
@@ -1014,7 +1014,7 @@
 		break;
 	}
 	default :
-		SCIkwarn(SCIkERROR, "Unknown FileIO() sub-command: %d\n", func_nr);
+		error("Unknown FileIO() sub-command: %d\n", func_nr);
 	}
 
 	return s->r_acc;

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -90,7 +90,7 @@
 		if (val == GFX_ERROR) \
 			warning("GFX subsystem returned error on \"" #x "\""); \
 		else {\
-			SCIkwarn(SCIkERROR, "GFX subsystem fatal error condition on \"" #x "\"!\n"); \
+			error("GFX subsystem fatal error condition on \"" #x "\""); \
 			vm_handle_fatal_error(s, __LINE__, __FILE__); \
 		} \
 	}\
@@ -99,7 +99,7 @@
 #define ASSERT(x) { \
 	int val = !!(x); \
 	if (!val) { \
-		SCIkwarn(SCIkERROR, "Fatal error condition on \"" #x "\"!\n"); \
+		error("Fatal error condition on \"" #x "\""); \
 		BREAKPOINT(); \
 		vm_handle_fatal_error(s, __LINE__, __FILE__); \
 	} \
@@ -218,7 +218,7 @@
 	while (port_nr > 2 && !(s->port->flags & GFXW_FLAG_IMMUNE_TO_SNAPSHOTS) && (gfxw_widget_matches_snapshot(*ptr, GFXW(s->port)))) {
 		// This shouldn't ever happen, actually, since windows (ports w/ ID > 2) should all be immune
 		gfxw_port_t *newport = gfxw_find_port(s->visual, port_nr);
-		SCIkwarn(SCIkERROR, "Port %d is not immune against snapshots!\n", s->port->ID);
+		error("Port %d is not immune against snapshots", s->port->ID);
 		port_nr--;
 		if (newport)
 			s->port = newport;
@@ -232,7 +232,7 @@
 		} while (parent && (gfxw_widget_matches_snapshot(*ptr, GFXW(parent))));
 
 		if (!parent) {
-			SCIkwarn(SCIkERROR, "Attempted widget mass destruction by a snapshot\n");
+			error("Attempted widget mass destruction by a snapshot\n");
 			BREAKPOINT();
 		}
 
@@ -241,7 +241,7 @@
 
 
 	if (!ptr) {
-		SCIkwarn(SCIkERROR, "Attempt to restore invalid snaphot with handle %04x!\n", handle);
+		error("Attempt to restore invalid snaphot with handle %04x", handle);
 		return;
 	}
 
@@ -271,7 +271,7 @@
 	else if (color < KERNEL_COLORS_NR)
 		return &(KERNEL_COLOR_PALETTE[color]);
 	else {
-		SCIkwarn(SCIkERROR, "Color index %d out of bounds for pic %d (%d max)", color, s->gfx_state->pic_nr, KERNEL_COLORS_NR);
+		error("Color index %d out of bounds for pic %d (%d max)", color, s->gfx_state->pic_nr, KERNEL_COLORS_NR);
 		BREAKPOINT();
 		return NULL;
 	}
@@ -332,7 +332,7 @@
 		break;
 	}
 	default :
-		SCIkwarn(SCIkERROR, "kSetCursor: Unhandled case: %d arguments given!\n", argc);
+		error("kSetCursor: Unhandled case: %d arguments given", argc);
 		break;
 	}
 	return s->r_acc;
@@ -435,7 +435,7 @@
 }
 
 void _k_redraw_box(state_t *s, int x1, int y1, int x2, int y2) {
-	sciprintf("_k_redraw_box(): Unimplemented!\n");
+	sciprintf("_k_redraw_box(): Unimplemented");
 #if 0
 	int i;
 	view_object_t *list = s->dyn_views;
@@ -710,7 +710,7 @@
 	maxloops = gfxop_lookup_view_get_loops(s->gfx_state, view);
 
 	if (maxloops == GFX_ERROR) {
-		SCIkwarn(SCIkERROR, "Invalid view.%03d\n", view);
+		error("Invalid view.%03d\n", view);
 		return;
 	} else if ((loop > 1) && (maxloops < 4))
 		return;
@@ -901,7 +901,7 @@
 	}
 
 	if (gfxop_get_cel_parameters(s->gfx_state, view, loop, cel, &width, &height, &offset)) {
-		SCIkwarn(SCIkERROR, "Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid\n", loop, cel, view, view);
+		error("Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid\n", loop, cel, view, view);
 		return NULL_REG;
 	} else
 		return make_reg(0, height);
@@ -919,7 +919,7 @@
 	}
 
 	if (gfxop_get_cel_parameters(s->gfx_state, view, loop, cel, &width, &height, &offset)) {
-		SCIkwarn(SCIkERROR, "Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid\n", loop, cel, view, view);
+		error("Invalid loop (%d) or cel (%d) in view.%d (0x%x), or view invalid\n", loop, cel, view, view);
 		return NULL_REG;
 	} else
 		return make_reg(0, width);
@@ -931,7 +931,7 @@
 	int loops_nr = gfxop_lookup_view_get_loops(s->gfx_state, view);
 
 	if (loops_nr < 0) {
-		SCIkwarn(SCIkERROR, "view.%d (0x%x) not found\n", view, view);
+		error("view.%d (0x%x) not found\n", view, view);
 		return NULL_REG;
 	}
 
@@ -950,7 +950,7 @@
 	if (gfxop_check_cel(s->gfx_state, view, &loop, &cel)) { 
 		// OK, this is a hack and there's a
 		// real function to calculate cel numbers...
-		SCIkwarn(SCIkERROR, "view.%d (0x%x) not found\n", view, view);
+		error("view.%d (0x%x) not found\n", view, view);
 		return NULL_REG;
 	}
 
@@ -1054,10 +1054,10 @@
 	if (sci01_priority_table_flags & 0x2) {
 		if (s->pic_priority_table) {
 			int i;
-			fprintf(stderr, "---------------------------\nPriority table:\n");
+			error("---------------------------\nPriority table:\n");
 			for (i = 0; i < 16; i++)
-				fprintf(stderr, "\t%d:\t%d\n", i, s->pic_priority_table[i]);
-			fprintf(stderr, "---------------------------\n");
+				error("\t%d:\t%d\n", i, s->pic_priority_table[i]);
+			error("---------------------------\n");
 		}
 	}
 	if (sci01_priority_table_flags & 0x1)
@@ -1115,7 +1115,7 @@
 		if (loop != oldloop) {
 			loop = 0;
 			PUT_SEL32V(object, loop, 0);
-			SCIkdebug(SCIkGRAPHICS, "Resetting loop for "PREG"!\n", PRINT_REG(object));
+			SCIkdebug(SCIkGRAPHICS, "Resetting loop for "PREG"", PRINT_REG(object));
 		}
 
 		if (cel != oldcel) {
@@ -1719,19 +1719,19 @@
 				temp = GET_SEL32V(obj, nsBottom);
 				PUT_SEL32V(obj, lsBottom, temp);
 #ifdef DEBUG_LSRECT
-				fprintf(stderr, "lsRected "PREG"\n", PRINT_REG(obj));
+				error("lsRected "PREG"\n", PRINT_REG(obj));
 #endif
 			}
 #ifdef DEBUG_LSRECT
 			else 
-				fprintf(stderr, "Not lsRecting "PREG" because %d\n", PRINT_REG(obj), lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL));
+				error("Not lsRecting "PREG" because %d\n", PRINT_REG(obj), lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL));
 #endif
 
 			if (widget->signal & _K_VIEW_SIG_FLAG_HIDDEN)
 				widget->signal |= _K_VIEW_SIG_FLAG_REMOVE;
 		}
 #ifdef DEBUG_LSRECT
-		fprintf(stderr, "obj "PREG" has pflags %x\n", PRINT_REG(obj), (widget->signal & (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)));
+		error("obj "PREG" has pflags %x\n", PRINT_REG(obj), (widget->signal & (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)));
 #endif
 
 		if (widget->signalp) {
@@ -1783,7 +1783,7 @@
 				reg_t under_bits = NULL_REG;
 
 				if (!is_object(s, obj)) {
-					SCIkwarn(SCIkERROR, "Non-object "PREG" present in view list during delete time\n", PRINT_REG(obj));
+					error("Non-object "PREG" present in view list during delete time\n", PRINT_REG(obj));
 					obj = NULL_REG;
 				} else
 					if (widget->under_bitsp) { // Is there a bg picture left to clean?
@@ -1820,7 +1820,7 @@
 					if (!(signal & _K_VIEW_SIG_FLAG_HIDDEN)) {
 						SCIkdebug(SCIkGRAPHICS, "Adding view at "PREG" to background\n", PRINT_REG(obj));
 						if (!(gfxw_remove_id(widget->parent, widget->ID, widget->subID) == GFXW(widget))) {
-							SCIkwarn(SCIkERROR, "Attempt to remove view with ID %x:%x from list failed!\n", widget->ID, widget->subID);
+							error("Attempt to remove view with ID %x:%x from list failed", widget->ID, widget->subID);
 							BREAKPOINT();
 						}
 
@@ -1938,7 +1938,7 @@
 	gfxw_dyn_view_t *widget;
 
 	if (!*widget_list) {
-		SCIkwarn(SCIkERROR, "make_view_list with widget_list == ()\n");
+		error("make_view_list with widget_list == ()\n");
 		BREAKPOINT();
 	};
 
@@ -1947,7 +1947,7 @@
 	// Yes, this _does_ happen!
 
 	if (!list) { // list sanity check
-		SCIkwarn(SCIkERROR, "Attempt to make list from non-list!\n");
+		error("Attempt to make list from non-list");
 		BREAKPOINT();
 	}
 
@@ -2066,7 +2066,7 @@
 		// Never happens
 /*		if (view->signal & 0) {
 			view->signal &= ~_K_VIEW_SIG_FLAG_FREESCI_STOPUPD;
-			fprintf(stderr, "Unsetting magic StopUpd for view "PREG"\n", PRINT_REG(obj));
+			error("Unsetting magic StopUpd for view "PREG"\n", PRINT_REG(obj));
 		} */
 
 		view = (gfxw_dyn_view_t *) view->next;
@@ -2265,7 +2265,7 @@
 		                                priority, -1 /* No priority */ , ALIGN_CENTER, ALIGN_BOTTOM, 0));
 
 		if (!widget) {
-			SCIkwarn(SCIkERROR, "Attempt to single-add invalid picview (%d/%d/%d)\n", view, loop, cel);
+			error("Attempt to single-add invalid picview (%d/%d/%d)\n", view, loop, cel);
 		} else {
 			widget->ID = -1;
 			if (control >= 0) {
@@ -2329,7 +2329,7 @@
 		new_port = gfxw_find_port(s->visual, port_nr);
 
 		if (!new_port) {
-			SCIkwarn(SCIkERROR, "Invalid port %04x requested\n", port_nr);
+			error("Invalid port %04x requested\n", port_nr);
 			return NULL_REG;
 		}
 
@@ -2357,7 +2357,7 @@
 		break;
 	}
 	default :
-		SCIkwarn(SCIkERROR, "SetPort was called with %d parameters\n", argc);
+		error("SetPort was called with %d parameters\n", argc);
 		break;
 	}
 
@@ -2386,13 +2386,13 @@
 
 /*
 	if (!view) {
-		SCIkwarn(SCIkERROR, "Attempt to draw non-existing view.%03d\n", view);
+		error("Attempt to draw non-existing view.%03d\n", view);
 		return;
 	}
 */
 
 	if (gfxop_check_cel(s->gfx_state, view, &loop, &cel)) {
-		SCIkwarn(SCIkERROR, "Attempt to draw non-existing view.%03d\n", view);
+		error("Attempt to draw non-existing view.%03d\n", view);
 		return s->r_acc;
 	}
 
@@ -2420,7 +2420,7 @@
 	gfxw_widget_kill_chrono(s->visual, goner_nr);
 	goner = gfxw_find_port(s->visual, goner_nr);
 	if ((goner_nr < 3) || (goner == NULL)) {
-		SCIkwarn(SCIkERROR, "Removal of invalid window %04x requested\n", goner_nr);
+		error("Removal of invalid window %04x requested\n", goner_nr);
 		return s->r_acc;
 	}
 
@@ -2569,7 +2569,7 @@
 	gfxop_set_clip_zone(s->gfx_state, gfx_rect_fullscreen);
 
 	if (!newscreen) {
-		SCIkwarn(SCIkERROR, "Failed to allocate 'newscreen'!\n");
+		error("Failed to allocate 'newscreen'");
 		return;
 	}
 
@@ -3121,7 +3121,7 @@
 	}
 
 	if (!text) {
-		SCIkdebug(SCIkERROR, "Display with invalid reference "PREG"!\n", PRINT_REG(textp));
+		error("Display with invalid reference "PREG"", PRINT_REG(textp));
 		return NULL_REG;
 	}
 
@@ -3247,7 +3247,7 @@
 	text_handle = gfxw_new_text(s->gfx_state, area, font_nr, text, halign, ALIGN_TOP, color0, *color1, bg_color, 0);
 
 	if (!text_handle) {
-		SCIkwarn(SCIkERROR, "Display: Failed to create text widget!\n");
+		error("Display: Failed to create text widget");
 		return NULL_REG;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/klists.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/klists.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/klists.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -172,12 +172,12 @@
 	list_t *l = LOOKUP_LIST(argv[0]);
 
 	if (!l) {
-		SCIkwarn(SCIkERROR, "Attempt to dispose non-list at "PREG"!\n", PRINT_REG(argv[0]));
+		error("Attempt to dispose non-list at "PREG"", PRINT_REG(argv[0]));
 		return NULL_REG;
 	}
 
 	if (!sane_listp(s, argv[0]))
-		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
+		error("List at "PREG" is not sane anymore", PRINT_REG(argv[0]));
 
 /*	if (!IS_NULL_REG(l->first)) {
 		reg_t n_addr = l->first;
@@ -222,7 +222,7 @@
 	list_t *l = LOOKUP_NULL_LIST(argv[0]);
 
 	if (l && !sane_listp(s, argv[0]))
-		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
+		error("List at "PREG" is not sane anymore", PRINT_REG(argv[0]));
 
 	if (l)
 		return l->first;
@@ -234,7 +234,7 @@
 	list_t *l = LOOKUP_LIST(argv[0]);
 
 	if (l && !sane_listp(s, argv[0]))
-		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
+		error("List at "PREG" is not sane anymore", PRINT_REG(argv[0]));
 
 	if (l)
 		return l->last;
@@ -246,7 +246,7 @@
 	list_t *l = LOOKUP_LIST(argv[0]);
 
 	if (!l || !sane_listp(s, argv[0]))
-		SCIkwarn(SCIkERROR, "List at "PREG" is invalid or not sane anymore!\n", PRINT_REG(argv[0]));
+		error("List at "PREG" is invalid or not sane anymore", PRINT_REG(argv[0]));
 
 	return make_reg(0, ((l) ? IS_NULL_REG(l->first) : 0));
 }
@@ -258,9 +258,9 @@
 	SCIkdebug(SCIkNODES, "Adding node "PREG" to end of list "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
 
 	if (!new_n)
-		SCIkwarn(SCIkERROR, "Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
+		error("Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
 	if (!l || !sane_listp(s, listbase))
-		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(listbase));
+		error("List at "PREG" is not sane anymore", PRINT_REG(listbase));
 
 	new_n->succ = l->first;
 	new_n->pred = NULL_REG;
@@ -281,9 +281,9 @@
 	SCIkdebug(SCIkNODES, "Adding node "PREG" to end of list "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
 
 	if (!new_n)
-		SCIkwarn(SCIkERROR, "Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
+		error("Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
 	if (!l || !sane_listp(s, listbase))
-		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(listbase));
+		error("List at "PREG" is not sane anymore", PRINT_REG(listbase));
 
 	new_n->succ = NULL_REG;
 	new_n->pred = l->last;
@@ -300,7 +300,7 @@
 reg_t kNextNode(state_t *s, int funct_nr, int argc, reg_t *argv) {
 	node_t *n = LOOKUP_NODE(argv[0]);
 	if (!sane_nodep(s, argv[0])) {
-		SCIkwarn(SCIkERROR, "List node at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
+		error("List node at "PREG" is not sane anymore", PRINT_REG(argv[0]));
 		script_error_flag = script_debug_flag = 0;
 		return NULL_REG;
 	}
@@ -311,7 +311,7 @@
 reg_t kPrevNode(state_t *s, int funct_nr, int argc, reg_t *argv) {
 	node_t *n = LOOKUP_NODE(argv[0]);
 	if (!sane_nodep(s, argv[0]))
-		SCIkwarn(SCIkERROR, "List node at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
+		error("List node at "PREG" is not sane anymore", PRINT_REG(argv[0]));
 
 	return n->pred;
 }
@@ -319,7 +319,7 @@
 reg_t kNodeValue(state_t *s, int funct_nr, int argc, reg_t *argv) {
 	node_t *n = LOOKUP_NODE(argv[0]);
 	if (!sane_nodep(s, argv[0])) {
-		SCIkwarn(SCIkERROR, "List node at "PREG" is not sane!\n", PRINT_REG(argv[0]));
+		error("List node at "PREG" is not sane", PRINT_REG(argv[0]));
 		script_debug_flag = script_error_flag = 0;
 		return NULL_REG;
 	}
@@ -338,10 +338,10 @@
 	node_t *newnode = LOOKUP_NODE(argv[2]);
 
 	if (!l || !sane_listp(s, argv[0]))
-		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
+		error("List at "PREG" is not sane anymore", PRINT_REG(argv[0]));
 
 	if (!newnode) {
-		SCIkwarn(SCIkERROR, "New 'node' "PREG" is not a node!\n", argv[1], argv[2]);
+		error("New 'node' "PREG" is not a node", argv[1], argv[2]);
 		return NULL_REG;
 	}
 
@@ -384,7 +384,7 @@
 	SCIkdebug(SCIkNODES, "Looking for key "PREG" in list "PREG"\n", PRINT_REG(key), PRINT_REG(list_pos));
 
 	if (!sane_listp(s, list_pos))
-		SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(list_pos));
+		error("List at "PREG" is not sane anymore", PRINT_REG(list_pos));
 
 	node_pos = LOOKUP_LIST(list_pos)->first;
 

Modified: scummvm/trunk/engines/sci/engine/kmovement.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -423,7 +423,7 @@
 	SCIkdebug(SCIkBRESEN, "Doing avoider %04x (dest=%d,%d)\n", avoider, destx, desty);
 
 	if (invoke_selector(INV_SEL(mover, doit, 1) , 0)) {
-		SCIkwarn(SCIkERROR, "Mover "PREG" of avoider "PREG" doesn't have a doit() funcselector\n", PRINT_REG(mover), PRINT_REG(avoider));
+		error("Mover "PREG" of avoider "PREG" doesn't have a doit() funcselector\n", PRINT_REG(mover), PRINT_REG(avoider));
 		return NULL_REG;
 	}
 
@@ -432,7 +432,7 @@
 		return s->r_acc; // Return gracefully.
 
 	if (invoke_selector(INV_SEL(client, isBlocked, 1) , 0)) {
-		SCIkwarn(SCIkERROR, "Client "PREG" of avoider "PREG" doesn't"
+		error("Client "PREG" of avoider "PREG" doesn't"
 		         " have an isBlocked() funcselector\n", PRINT_REG(client), PRINT_REG(avoider));
 		return NULL_REG;
 	}
@@ -463,7 +463,7 @@
 			SCIkdebug(SCIkBRESEN, "Pos (%d,%d): Trying angle %d; delta=(%d,%d)\n", oldx, oldy, angle, move_x, move_y);
 
 			if (invoke_selector(INV_SEL(client, canBeHere, 1) , 0)) {
-				SCIkwarn(SCIkERROR, "Client "PREG" of avoider "PREG" doesn't"
+				error("Client "PREG" of avoider "PREG" doesn't"
 				         " have a canBeHere() funcselector\n", PRINT_REG(client), PRINT_REG(avoider));
 				return NULL_REG;
 			}
@@ -497,7 +497,7 @@
 
 		if (looper.segment) {
 			if (invoke_selector(INV_SEL(looper, doit, 1), 2, angle, client)) {
-				SCIkwarn(SCIkERROR, "Looper "PREG" of avoider "PREG" doesn't"
+				error("Looper "PREG" of avoider "PREG" doesn't"
 				         " have a doit() funcselector\n", PRINT_REG(looper), PRINT_REG(avoider));
 			} else
 				return s->r_acc;

Modified: scummvm/trunk/engines/sci/engine/kscripts.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -69,7 +69,7 @@
 	slc_type = lookup_selector(s, object, selector_id, NULL, &address);
 
 	if (slc_type == SELECTOR_NONE) {
-		SCIkwarn(SCIkERROR, "Selector '%s' of object at "PREG" could not be invoked (%s L%d)\n",
+		error("Selector '%s' of object at "PREG" could not be invoked (%s L%d)\n",
 		         s->selector_names[selector_id], PRINT_REG(object), fname, line);
 		if (noinvalid == 0)
 			KERNEL_OOPS("Not recoverable: VM was halted\n");
@@ -158,7 +158,7 @@
 	int varblock_size;
 
 	if (!parent_obj) {
-		SCIkwarn(SCIkERROR, "Attempt to clone non-object/class at "PREG" failed", PRINT_REG(parent_addr));
+		error("Attempt to clone non-object/class at "PREG" failed", PRINT_REG(parent_addr));
 		return NULL_REG;
 	}
 
@@ -167,7 +167,7 @@
 	clone_obj = sm_alloc_clone(&s->seg_manager, &clone_addr);
 
 	if (!clone_obj) {
-		SCIkwarn(SCIkERROR, "Cloning "PREG" failed-- internal error!\n", PRINT_REG(parent_addr));
+		error("Cloning "PREG" failed-- internal error", PRINT_REG(parent_addr));
 		return NULL_REG;
 	}
 
@@ -196,7 +196,7 @@
 	word underBits;
 
 	if (!victim_obj) {
-		SCIkwarn(SCIkERROR, "Attempt to dispose non-class/object at "PREG"\n",
+		error("Attempt to dispose non-class/object at "PREG"\n",
 		         PRINT_REG(victim_addr));
 		return s->r_acc;
 	}
@@ -244,12 +244,12 @@
 	scr = &(s->seg_manager.heap[scriptid]->data.script);
 
 	if (!scr->exports_nr) {
-		SCIkdebug(SCIkERROR, "Script 0x%x does not have a dispatch table\n", script);
+		error("Script 0x%x does not have a dispatch table\n", script);
 		return NULL_REG;
 	}
 
 	if (index > scr->exports_nr) {
-		SCIkwarn(SCIkERROR, "Dispatch index too big: %d > %d\n", index, scr->exports_nr);
+		error("Dispatch index too big: %d > %d\n", index, scr->exports_nr);
 		return NULL_REG;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/ksound.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/ksound.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/ksound.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -938,14 +938,14 @@
 
 		case SI_ABSOLUTE_CUE:
 			signal = cue;
-			fprintf(stderr, "[CUE] "PREG" Absolute Cue: %d\n",
+			error("[CUE] "PREG" Absolute Cue: %d\n",
 			        PRINT_REG(obj), signal);
 
 			PUT_SEL32V(obj, signal, signal);
 			break;
 
 		case SI_RELATIVE_CUE:
-			fprintf(stderr, "[CUE] "PREG" Relative Cue: %d\n",
+			error("[CUE] "PREG" Relative Cue: %d\n",
 			        PRINT_REG(obj), cue);
 
 			PUT_SEL32V(obj, dataInc, cue);

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -31,7 +31,7 @@
 
 #define CHECK_OVERFLOW1(pt, size, rv) \
 	if (((pt) - (str_base)) + (size) > maxsize) { \
-		SCIkwarn(SCIkERROR, "String expansion exceeded heap boundaries\n"); \
+		error("String expansion exceeded heap boundaries\n"); \
 		return rv;\
 	}
 
@@ -50,7 +50,7 @@
 		textres = scir_find_resource(s->resmgr, sci_text, address.offset, 0);
 
 		if (!textres) {
-			SCIkwarn(SCIkERROR, "text.%03d not found\n", address);
+			error("text.%03d not found\n", address);
 			return NULL; /* Will probably segfault */
 		}
 
@@ -63,7 +63,7 @@
 		if (textlen)
 			return seeker;
 		else {
-			SCIkwarn(SCIkERROR, "Index %d out of bounds in text.%03d\n", _index, address);
+			error("Index %d out of bounds in text.%03d\n", _index, address);
 			return 0;
 		}
 
@@ -224,7 +224,7 @@
 				          synonyms_nr, script);
 
 				if (synonyms_nr > 16384) {
-					SCIkwarn(SCIkERROR, "Segtable corruption: script.%03d has %d synonyms!\n",
+					error("Segtable corruption: script.%03d has %d synonyms",
 					         script, synonyms_nr);
 					/* We used to reset the corrupted value here. I really don't think it's appropriate.
 					 * Lars */
@@ -708,7 +708,7 @@
 
 
 	if (!textres) {
-		SCIkwarn(SCIkERROR, "text.%d does not exist\n", UKPV(0));
+		error("text.%d does not exist\n", UKPV(0));
 		return NULL_REG;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/said.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/said.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/said.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -832,10 +832,10 @@
 yytype_int16 *top;
 #endif
 {
-	YYFPRINTF(stderr, "Stack now");
+	YYerror("Stack now");
 	for (; bottom <= top; ++bottom)
-		YYFPRINTF(stderr, " %d", *bottom);
-	YYFPRINTF(stderr, "\n");
+		YYerror(" %d", *bottom);
+	YYerror("\n");
 }
 
 # define YY_STACK_PRINT(Bottom, Top)				\
@@ -863,15 +863,15 @@
 	int yynrhs = yyr2[yyrule];
 	int yyi;
 	unsigned long int yylno = yyrline[yyrule];
-	YYFPRINTF(stderr, "Reducing stack by rule %d (line %lu):\n",
+	YYerror("Reducing stack by rule %d (line %lu):\n",
 	          yyrule - 1, yylno);
 	/* The symbols being reduced.  */
 	for (yyi = 0; yyi < yynrhs; yyi++) {
-		fprintf(stderr, "   $%d = ", yyi + 1);
+		error("   $%d = ", yyi + 1);
 		yy_symbol_print(stderr, yyrhs[yyprhs[yyrule] + yyi],
 		                &(yyvsp[(yyi + 1) - (yynrhs)])
 		               );
-		fprintf(stderr, "\n");
+		error("\n");
 	}
 }
 
@@ -1890,7 +1890,7 @@
 				said_branch_node(SAID_NEXT_NODE, said_leaf_node(SAID_NEXT_NODE, n2), t1)), t2);
 
 #ifdef SAID_DEBUG
-	fprintf(stderr, "AUG(0x%x, 0x%x, [%04x], [%04x]) = [%04x]\n", n1, n2, t1, t2, retval);
+	error("AUG(0x%x, 0x%x, [%04x], [%04x]) = [%04x]\n", n1, n2, t1, t2, retval);
 #endif
 
 	return retval;
@@ -1898,7 +1898,7 @@
 
 static tree_t said_attach_branch(tree_t base, tree_t attacheant) {
 #ifdef SAID_DEBUG
-	fprintf(stderr, "ATT2([%04x], [%04x]) = [%04x]\n", base, attacheant, base);
+	error("ATT2([%04x], [%04x]) = [%04x]\n", base, attacheant, base);
 #endif
 
 	if (!attacheant)
@@ -1916,7 +1916,7 @@
 
 static said_spec_t said_top_branch(tree_t first) {
 #ifdef SAID_DEBUG
-	fprintf(stderr, "TOP([%04x])\n", first);
+	error("TOP([%04x])\n", first);
 #endif
 	said_branch_node(0, 1, 2);
 	said_leaf_node(1, 0x141); // Magic number #1

Modified: scummvm/trunk/engines/sci/engine/scriptconsole.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptconsole.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/scriptconsole.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -579,7 +579,7 @@
 							break;
 
 						default:
-							fprintf(stderr, "Internal error: Heap corruption or prior assertion failed:\n"
+							error("Internal error: Heap corruption or prior assertion failed:\n"
 							        "Unknown parameter type '%c' for funtion\n", paramtype);
 
 						}
@@ -587,7 +587,7 @@
 
 					if (do_execute) {
 						command_todo->command(s);
-					} else fprintf(stderr, "Skipping command...\n");
+					} else error("Skipping command...\n");
 				}
 			}
 		}
@@ -907,7 +907,7 @@
 				                        + i * cmd_mm[mm_found].size_per_entry), 0);
 		else {
 			if (!s) {
-				sciprintf("You need a state to do that!\n");
+				sciprintf("You need a state to do that");
 				return 1;
 			}
 
@@ -1047,14 +1047,14 @@
 	char *dot = strchr(cmd_params[0].str, '.');
 
 	if (NULL == s) {
-		fprintf(stderr, "console.c: c_hexgrep(): NULL passed for s\r\n");
+		error("console.c: c_hexgrep(): NULL passed for s\r\n");
 		return(-1);
 	}
 
 	seekstr = (unsigned char*)sci_malloc(seeklen = (cmd_paramlength - 1));
 
 	if (NULL == seekstr) {
-		fprintf(stderr, "console.c: c_hexgrep(): malloc failed for seekstr\r\n");
+		error("console.c: c_hexgrep(): malloc failed for seekstr\r\n");
 		return(-1);
 	}
 
@@ -1126,7 +1126,7 @@
 	snames = vocabulary_get_snames(s->resmgr, &namectr, s ? s->version : 0);
 
 	if (!snames) {
-		sciprintf("No selector name table found!\n");
+		sciprintf("No selector name table found");
 		return 1;
 	}
 
@@ -1151,7 +1151,7 @@
 	}
 
 	if (!knames) {
-		sciprintf("No kernel name table found!\n");
+		sciprintf("No kernel name table found");
 		return 1;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -38,10 +38,10 @@
 			Sleep(0); \
 		} else { \
 			if (timeBeginPeriod(1) != TIMERR_NOERROR) \
-				fprintf(stderr, "timeBeginPeriod(1) failed\n"); \
+				error("timeBeginPeriod(1) failed\n"); \
 			Sleep(x); \
 			if (timeEndPeriod(1) != TIMERR_NOERROR) \
-				fprintf(stderr, "timeEndPeriod(1) failed\n"); \
+				error("timeEndPeriod(1) failed\n"); \
 		} \
 	} while (0);
 #endif
@@ -158,24 +158,24 @@
 		int blanks = 0;
 
 		offset += offset_mod;
-		fprintf(stderr, "  [%04x] %d\t",
+		error("  [%04x] %d\t",
 		        old_offset + notational_offset, time);
 
 		cmd = data[offset];
 		if (!(cmd & 0x80)) {
 			cmd = prev;
 			if (prev < 0x80) {
-				fprintf(stderr, "Track broken at %x after"
+				error("Track broken at %x after"
 				        " offset mod of %d\n",
 				        offset + notational_offset, offset_mod);
 				sci_hexdump(data, size, notational_offset);
 				return;
 			}
-			fprintf(stderr, "(rs %02x) ", cmd);
+			error("(rs %02x) ", cmd);
 			blanks += 8;
 		} else {
 			++offset;
-			fprintf(stderr, "%02x ", cmd);
+			error("%02x ", cmd);
 			blanks += 3;
 		}
 		prev = cmd;
@@ -188,37 +188,37 @@
 		for (i = 0; i < pleft; i++) {
 			if (i == 0)
 				firstarg = data[offset];
-			fprintf(stderr, "%02x ", data[offset++]);
+			error("%02x ", data[offset++]);
 			blanks += 3;
 		}
 
 		while (blanks < 16) {
 			blanks += 4;
-			fprintf(stderr, "    ");
+			error("    ");
 		}
 
 		while (blanks < 20) {
 			++blanks;
-			fprintf(stderr, " ");
+			error(" ");
 		}
 
 		if (cmd == SCI_MIDI_EOT)
-			fprintf(stderr, ";; EOT");
+			error(";; EOT");
 		else if (cmd == SCI_MIDI_SET_SIGNAL) {
 			if (firstarg == SCI_MIDI_SET_SIGNAL_LOOP)
-				fprintf(stderr, ";; LOOP point");
+				error(";; LOOP point");
 			else
-				fprintf(stderr, ";; CUE (%d)", firstarg);
+				error(";; CUE (%d)", firstarg);
 		} else if (SCI_MIDI_CONTROLLER(cmd)) {
 			if (firstarg == SCI_MIDI_CUMULATIVE_CUE)
-				fprintf(stderr, ";; CUE (cumulative)");
+				error(";; CUE (cumulative)");
 			else if (firstarg == SCI_MIDI_RESET_ON_SUSPEND)
-				fprintf(stderr, ";; RESET-ON-SUSPEND flag");
+				error(";; RESET-ON-SUSPEND flag");
 		}
-		fprintf(stderr, "\n");
+		error("\n");
 
 		if (old_offset >= offset) {
-			fprintf(stderr, "-- Not moving forward anymore,"
+			error("-- Not moving forward anymore,"
 			        " aborting (%x/%x)\n", offset, old_offset);
 			return;
 		}
@@ -406,7 +406,7 @@
 		mem_obj_t *mobj = GET_SEGMENT(s->seg_manager, pos.segment, MEM_OBJ_NODES);
 
 		if (!mobj || !ENTRY_IS_VALID(&(mobj->data.nodes), pos.offset)) {
-			sciprintf("   WARNING: "PREG": Doesn't contain list node!\n",
+			sciprintf("   WARNING: "PREG": Doesn't contain list node",
 			          PRINT_REG(pos));
 			return;
 		}
@@ -417,7 +417,7 @@
 		          PRINT_REG(pos), PRINT_REG(node->key), PRINT_REG(node->value));
 
 		if (!REG_EQ(my_prev, node->pred))
-			sciprintf("   WARNING: current node gives "PREG" as predecessor!\n",
+			sciprintf("   WARNING: current node gives "PREG" as predecessor",
 			          PRINT_REG(node->pred));
 
 		my_prev = pos;
@@ -425,7 +425,7 @@
 	}
 
 	if (!REG_EQ(my_prev, l->last))
-		sciprintf("   WARNING: Last node was expected to be "PREG", was "PREG"!\n",
+		sciprintf("   WARNING: Last node was expected to be "PREG", was "PREG"",
 		          PRINT_REG(l->last), PRINT_REG(my_prev));
 	sciprintf("\t>\n");
 }
@@ -2006,7 +2006,7 @@
 	int cel = cmd_params[2].val;
 	int palette = cmd_params[3].val;
 	if (!s) {
-		sciprintf("Not in debug state!\n");
+		sciprintf("Not in debug state");
 		return 1;
 	}
 
@@ -2023,7 +2023,7 @@
 	int col = cmd_params[0].val;
 
 	if (!s) {
-		sciprintf("Not in debug state!\n");
+		sciprintf("Not in debug state");
 		return 1;
 	}
 
@@ -2042,7 +2042,7 @@
 	int col = cmd_params[4].val;
 
 	if (!s) {
-		sciprintf("Not in debug state!\n");
+		sciprintf("Not in debug state");
 		return 1;
 	}
 
@@ -2062,7 +2062,7 @@
 	rect_t rect;
 
 	if (!s) {
-		sciprintf("Not in debug state!\n");
+		sciprintf("Not in debug state");
 		return 1;
 	}
 
@@ -2107,7 +2107,7 @@
 	int brLeft, brRight, brBottom, brTop;
 
 	if (!s) {
-		sciprintf("Not in debug state!\n");
+		sciprintf("Not in debug state");
 		return 1;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -215,7 +215,7 @@
 			sciprintf("Script and heap sizes combined exceed 64K.\n"
 			          "This means a fundamental design bug was made in FreeSCI\n"
 			          "regarding SCI1.1 games.\nPlease report this so it can be"
-			          "fixed in the next major version!\n");
+			          "fixed in the next major version");
 			return;
 		}
 	}
@@ -323,7 +323,7 @@
 		free(mobj->data.reserved);
 		break;
 	default:
-		fprintf(stderr, "Deallocating segment type %d not supported!\n",
+		error("Deallocating segment type %d not supported",
 		        mobj->type);
 		BREAKPOINT();
 	}
@@ -1442,7 +1442,7 @@
 	if (!pointer.segment
 	        || (pointer.segment >= self->heap_size)
 	        || !self->heap[pointer.segment]) {
-		sciprintf("Error: Attempt to dereference invalid pointer "PREG"!\n",
+		sciprintf("Error: Attempt to dereference invalid pointer "PREG"",
 		          PRINT_REG(pointer));
 		return NULL; /* Invalid */
 	}
@@ -1486,20 +1486,20 @@
 		        && mobj->data.sys_strings.strings[pointer.offset].name)
 			return (byte *)(mobj->data.sys_strings.strings[pointer.offset].value);
 		else {
-			sciprintf("Error: Attempt to dereference invalid pointer "PREG"!\n",
+			sciprintf("Error: Attempt to dereference invalid pointer "PREG"",
 			          PRINT_REG(pointer));
 			return NULL;
 		}
 
 	case MEM_OBJ_RESERVED:
-		sciprintf("Error: Trying to dereference pointer "PREG" to reserved segment `%s'!\n",
+		sciprintf("Error: Trying to dereference pointer "PREG" to reserved segment `%s'",
 		          mobj->data.reserved);
 		return NULL;
 		break;
 
 	default:
 		sciprintf("Error: Trying to dereference pointer "PREG" to inappropriate"
-		          " segment!\n",
+		          " segment",
 		          PRINT_REG(pointer));
 		return NULL;
 	}
@@ -1640,10 +1640,10 @@
 			for (i = 0; i < obj->variables_nr; i++)
 				(*note)(param, obj->variables[i]);
 		} else {
-			fprintf(stderr, "Request for outgoing script-object reference at "PREG" yielded invalid index %d\n", PRINT_REG(addr), idx);
+			error("Request for outgoing script-object reference at "PREG" yielded invalid index %d\n", PRINT_REG(addr), idx);
 		}
 	} else {
-		/*		fprintf(stderr, "Unexpected request for outgoing script-object references at "PREG"\n", PRINT_REG(addr));*/
+		/*		error("Unexpected request for outgoing script-object references at "PREG"\n", PRINT_REG(addr));*/
 		/* Happens e.g. when we're looking into strings */
 	}
 }
@@ -1687,7 +1687,7 @@
 	assert(addr.segment == self->seg_id);
 
 	if (!(ENTRY_IS_VALID(clone_table, addr.offset))) {
-		fprintf(stderr, "Unexpected request for outgoing references from clone at "PREG"\n", PRINT_REG(addr));
+		error("Unexpected request for outgoing references from clone at "PREG"\n", PRINT_REG(addr));
 //		BREAKPOINT();
 		return;
 	}
@@ -1786,10 +1786,10 @@
 static void
 list_all_outgoing_references_stack(seg_interface_t *self, state_t *s, reg_t addr, void *param, void (*note)(void*param, reg_t addr)) {
 	int i;
-	fprintf(stderr, "Emitting %d stack entries\n", self->mobj->data.stack.nr);
+	error("Emitting %d stack entries\n", self->mobj->data.stack.nr);
 	for (i = 0; i < self->mobj->data.stack.nr; i++)
 		(*note)(param, self->mobj->data.stack.entries[i]);
-	fprintf(stderr, "DONE");
+	error("DONE");
 }
 
 /*-------------------- stack --------------------*/
@@ -1831,7 +1831,7 @@
 	list_t *list = &(table->table[addr.offset].entry);
 
 	if (!ENTRY_IS_VALID(table, addr.offset)) {
-		fprintf(stderr, "Invalid list referenced for outgoing references: "PREG"\n", PRINT_REG(addr));
+		error("Invalid list referenced for outgoing references: "PREG"\n", PRINT_REG(addr));
 		return;
 	}
 
@@ -1871,7 +1871,7 @@
 	node_t *node = &(table->table[addr.offset].entry);
 
 	if (!ENTRY_IS_VALID(table, addr.offset)) {
-		fprintf(stderr, "Invalid node referenced for outgoing references: "PREG"\n", PRINT_REG(addr));
+		error("Invalid node referenced for outgoing references: "PREG"\n", PRINT_REG(addr));
 		return;
 	}
 
@@ -1979,7 +1979,7 @@
 	memcpy(retval, seg_interfaces[mobj->type - 1], sizeof(seg_interface_t));
 
 	if (mobj->type != retval->type_id) {
-		fprintf(stderr, "Improper segment interface for %d", mobj->type);
+		error("Improper segment interface for %d", mobj->type);
 		exit(1);
 	}
 

Modified: scummvm/trunk/engines/sci/engine/sys_strings.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/sys_strings.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/sys_strings.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -23,6 +23,7 @@
  *
  */
 
+#include "common/util.h"
 #include "sci/include/sys_strings.h"
 #include "sci/include/sci_memory.h"
 
@@ -31,7 +32,7 @@
 	sys_string_t *str = strings->strings + index;
 
 	if (index < 0 || index >= SYS_STRINGS_MAX) {
-		fprintf(stderr, "[SYSSTR] Error: Attempt to acquire string #%d\n",
+		error("[SYSSTR] Error: Attempt to acquire string #%d\n",
 		        index);
 		BREAKPOINT();
 	}
@@ -39,7 +40,7 @@
 	if (str->name
 	        && (strcmp(name, str->name)
 	            || (str->max_size != max_len))) {
-		fprintf(stderr, "[SYSSTR] Error: Attempt to re-acquire existing string #%d;"
+		error("[SYSSTR] Error: Attempt to re-acquire existing string #%d;"
 		        "was '%s', tried to claim as '%s'\n",
 		        index, str->name, name);
 		BREAKPOINT();
@@ -56,7 +57,7 @@
 	sys_string_t *str = strings->strings + index;
 
 	if (index < 0 || index >= SYS_STRINGS_MAX || !str->name) {
-		fprintf(stderr, "[SYSSTR] Error: Attempt to write to invalid/unused string #%d\n",
+		error("[SYSSTR] Error: Attempt to write to invalid/unused string #%d\n",
 		        index);
 		BREAKPOINT();
 		return 1;

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -74,14 +74,14 @@
 validate_property(object_t *obj, int index) {
 	if (!obj) {
 		if (sci_debug_flags & 4)
-			sciprintf("[VM] Sending to disposed object!\n");
+			sciprintf("[VM] Sending to disposed object");
 		_dummy_register = NULL_REG;
 		return &_dummy_register;
 	}
 
 	if (index < 0 || index >= obj->variables_nr) {
 		if (sci_debug_flags & 4)
-			sciprintf("[VM] Invalid property #%d (out of [0..%d]) requested!\n", index,
+			sciprintf("[VM] Invalid property #%d (out of [0..%d]) requested", index,
 			          obj->variables_nr);
 
 		_dummy_register = NULL_REG;
@@ -595,12 +595,12 @@
 
 void
 vm_handle_fatal_error(state_t *s, int line, const char *file) {
-	fprintf(stderr, "Fatal VM error in %s, L%d; aborting...\n", file, line);
+	error("Fatal VM error in %s, L%d; aborting...\n", file, line);
 #ifdef HAVE_SETJMP_H
 	if (jump_initialized)
 		longjmp(vm_error_address, 0);
 #endif
-	fprintf(stderr, "Could not recover, exitting...\n");
+	error("Could not recover, exitting...\n");
 	exit(1);
 }
 
@@ -740,7 +740,7 @@
 			scr = script_locate_by_segment(s, xs->addr.pc.segment);
 			if (!scr) {
 				/* No script? Implicit return via fake instruction buffer */
-				warning("Running on non-existant script in segment %x!\n", xs->addr.pc.segment);
+				warning("Running on non-existant script in segment %x", xs->addr.pc.segment);
 				code_buf = _fake_return_buffer;
 #ifndef DISABLE_VALIDATIONS
 				code_buf_size = 2;
@@ -887,7 +887,7 @@
 				/* Pointer arithmetics! */
 				if (s->r_acc.segment) {
 					if (r_temp.segment) {
-						sciprintf("Error: Attempt to add two pointers, stack="PREG" and acc="PREG"!\n",
+						sciprintf("Error: Attempt to add two pointers, stack="PREG" and acc="PREG"",
 						          PRINT_REG(r_temp), PRINT_REG(s->r_acc));
 						script_debug_flag = script_error_flag = 1;
 						offset = 0;
@@ -914,7 +914,7 @@
 				/* Pointer arithmetics! */
 				if (s->r_acc.segment) {
 					if (r_temp.segment) {
-						sciprintf("Error: Attempt to subtract two pointers, stack="PREG" and acc="PREG"!\n",
+						sciprintf("Error: Attempt to subtract two pointers, stack="PREG" and acc="PREG"",
 						          PRINT_REG(r_temp), PRINT_REG(s->r_acc));
 						script_debug_flag = script_error_flag = 1;
 						offset = 0;

Modified: scummvm/trunk/engines/sci/gfx/font.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/font.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/font.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -127,7 +127,7 @@
 
 gfx_bitmap_font_t *
 gfxr_scale_font(gfx_bitmap_font_t *orig_font, gfx_mode_t *mode, gfxr_font_scale_filter_t filter) {
-	GFXWARN("This function hasn't been tested yet!\n");
+	GFXWARN("This function hasn't been tested yet");
 
 	switch (filter) {
 
@@ -135,7 +135,7 @@
 		return gfxr_scale_font_unfiltered(orig_font, mode);
 
 	default:
-		GFXERROR("Invalid font filter mode %d!\n", filter);
+		GFXERROR("Invalid font filter mode %d", filter);
 		return NULL;
 	}
 }
@@ -318,7 +318,7 @@
 		int ch = (int) text[i];
 
 		if (ch >= font->chars_nr) {
-			GFXERROR("Invalid character 0x%02x encountered!\n", text[i]);
+			GFXERROR("Invalid character 0x%02x encountered", text[i]);
 			return NULL;
 		}
 
@@ -329,7 +329,7 @@
 
 	pxm->colors_nr = !!fg0 + !!fg1 + !!bg;
 	if (pxm->colors_nr == 0) {
-		GFXWARN("Pixmap would have zero colors, resetting!\n");
+		GFXWARN("Pixmap would have zero colors, resetting");
 		pxm->colors_nr = 3;
 		hack = 1;
 		fg0 = fg1 = bg = &dummy;

Modified: scummvm/trunk/engines/sci/gfx/gfx_driver.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/gfx_driver.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -252,7 +252,7 @@
 		break;
 
 	case GFX_MASK_PRIORITY:
-		printf("FIXME: priority map grab not implemented yet!\n");
+		printf("FIXME: priority map grab not implemented yet");
 		break;
 
 	default:
@@ -306,7 +306,7 @@
 		S->update_screen = true;
 		break;
 	default:
-		GFXERROR("Invalid buffer %d in update!\n", buffer);
+		GFXERROR("Invalid buffer %d in update", buffer);
 		return GFX_ERROR;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_res_options.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_res_options.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/gfx_res_options.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -45,7 +45,7 @@
 #ifdef DEBUG
 static void
 print_pattern(gfx_res_pattern_t *pat) {
-	fprintf(stderr, "[%d..%d]",
+	error("[%d..%d]",
 	        pat->min, pat->max);
 }
 #endif
@@ -56,24 +56,24 @@
 	int loc;
 #ifdef DEBUG
 	int i;
-	fprintf(stderr, "[DEBUG:gfx-res] Trying to match against %d/%d/%d choices\n",
+	error("[DEBUG:gfx-res] Trying to match against %d/%d/%d choices\n",
 	        conf->patterns_nr, conf->loops_nr, conf->cels_nr);
 	for (i = 0; i < conf->patterns_nr; i++) {
-		fprintf(stderr, "[DEBUG:gfx-res] Pat #%d: ", i);
+		error("[DEBUG:gfx-res] Pat #%d: ", i);
 		print_pattern(conf->patterns + i);
-		fprintf(stderr, "\n");
+		error("\n");
 	}
 	loc = conf->patterns_nr;
 	for (i = 0; i < conf->loops_nr; i++) {
-		fprintf(stderr, "[DEBUG:gfx-res] Loop #%d: ", i);
+		error("[DEBUG:gfx-res] Loop #%d: ", i);
 		print_pattern(conf->patterns + i + loc);
-		fprintf(stderr, "\n");
+		error("\n");
 	}
 	loc += conf->loops_nr;
 	for (i = 0; i < conf->cels_nr; i++) {
-		fprintf(stderr, "[DEBUG:gfx-res] Cel #%d: ", i);
+		error("[DEBUG:gfx-res] Cel #%d: ", i);
 		print_pattern(conf->patterns + i + loc);
-		fprintf(stderr, "\n");
+		error("\n");
 	}
 #endif
 	if (conf->patterns_nr &&
@@ -114,7 +114,7 @@
 		if (resource_matches_patternlists(conflist,
 		                                  type, nr, loop, cel)) {
 #ifdef DEBUG
-			fprintf(stderr, "[DEBUG:gfx-res] Found match!\n");
+			error("[DEBUG:gfx-res] Found match");
 #endif
 			return conflist;
 		}
@@ -187,7 +187,7 @@
 	gfx_res_conf_t *conf;
 
 #ifdef DEBUG
-	fprintf(stderr, "[DEBUG:gfx-res] Trying to conf %d/%d/%d/%d (ID=%d)\n",
+	error("[DEBUG:gfx-res] Trying to conf %d/%d/%d/%d (ID=%d)\n",
 	        restype, nr, loop, cel, pxm->ID);
 #endif
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resource.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/gfx_resource.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -203,7 +203,7 @@
 		break;
 
 	default:
-		fprintf(stderr, "gfxr_endianness_adjust(): Cannot adjust endianness for %d bytespp!\n", bytespp);
+		error("gfxr_endianness_adjust(): Cannot adjust endianness for %d bytespp", bytespp);
 		return NULL;
 	}
 
@@ -369,7 +369,7 @@
 
 		for (i = 0; i < pxm->colors_nr; i++) {
 			if (gfx_alloc_color(mode->palette, pxm->colors + i) < 0) {
-				GFXWARN("Failed to allocate color %d/%d in pixmap (color %02x/%02x/%02x)!\n",
+				GFXWARN("Failed to allocate color %d/%d in pixmap (color %02x/%02x/%02x)",
 				        i, pxm->colors_nr, pxm->colors[i].r, pxm->colors[i].g, pxm->colors[i].b);
 				pxm->colors[i].global_index = 0;
 			}

Modified: scummvm/trunk/engines/sci/gfx/gfx_support.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_support.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/gfx_support.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -77,7 +77,7 @@
 		return;
 
 	default:
-		GFXERROR("pixelwidth=%d not supported!\n", pixelwidth);
+		GFXERROR("pixelwidth=%d not supported", pixelwidth);
 		return;
 
 	}
@@ -363,7 +363,7 @@
 
 		alpha_mask = mode->alpha_mask;
 		if (!alpha_mask && pxm->alpha_map) {
-			GFXERROR("Invalid alpha mode: both pxm->alpha_map and alpha_mask are white!\n");
+			GFXERROR("Invalid alpha mode: both pxm->alpha_map and alpha_mask are white");
 			return GFX_ERROR;
 		}
 

Modified: scummvm/trunk/engines/sci/gfx/gfx_tools.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/gfx_tools.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -213,7 +213,7 @@
 	int size;
 
 	if (pixmap->index_data) {
-		GFXWARN("Attempt to allocate pixmap index data twice!\n");
+		GFXWARN("Attempt to allocate pixmap index data twice");
 		return pixmap;
 	}
 
@@ -232,7 +232,7 @@
 gfx_pixmap_t *
 gfx_pixmap_free_index_data(gfx_pixmap_t *pixmap) {
 	if (!pixmap->index_data) {
-		GFXWARN("Attempt to free pixmap index data twice!\n");
+		GFXWARN("Attempt to free pixmap index data twice");
 		return pixmap;
 	}
 
@@ -247,7 +247,7 @@
 	int size;
 
 	if (pixmap->data) {
-		GFXWARN("Attempt to allocate pixmap data twice!\n");
+		GFXWARN("Attempt to allocate pixmap data twice");
 		return pixmap;
 	}
 
@@ -271,7 +271,7 @@
 gfx_pixmap_t *
 gfx_pixmap_free_data(gfx_pixmap_t *pixmap) {
 	if (!pixmap->data) {
-		GFXWARN("Attempt to free pixmap data twice!\n");
+		GFXWARN("Attempt to free pixmap data twice");
 		return pixmap;
 	}
 
@@ -293,14 +293,14 @@
 		return GFX_OK;
 
 	if (pal->max_colors_nr <= 0) {
-		GFXERROR("Palette has zero or less color entries!\n");
+		GFXERROR("Palette has zero or less color entries");
 		return GFX_ERROR;
 	}
 
 
 	if (color->global_index != GFX_COLOR_INDEX_UNMAPPED) {
 #if 0
-		GFXDEBUG("Attempt to allocate color twice: index 0x%d (%02x/%02x/%02x)!\n",
+		GFXDEBUG("Attempt to allocate color twice: index 0x%d (%02x/%02x/%02x)",
 		         color->global_index, color->r, color->g, color->b);
 #endif
 		return GFX_OK;
@@ -343,7 +343,7 @@
 
 	color->global_index = bestcolor;
 
-//	GFXWARN("Out of palette colors- doing approximated mapping!\n");
+//	GFXWARN("Out of palette colors- doing approximated mapping");
 	return GFX_OK;
 }
 
@@ -356,19 +356,19 @@
 		return GFX_OK;
 
 	if (color->global_index == GFX_COLOR_INDEX_UNMAPPED) {
-		GFXWARN("Attempt to free unmapped color %02x/%02x/%02x!\n", color->r, color->g, color->b);
+		GFXWARN("Attempt to free unmapped color %02x/%02x/%02x", color->r, color->g, color->b);
 		BREAKPOINT();
 		return GFX_ERROR;
 	}
 
 	if (color->global_index >= pal->max_colors_nr) {
-		GFXERROR("Attempt to free invalid color index %d (%02x/%02x/%02x)!\n",
+		GFXERROR("Attempt to free invalid color index %d (%02x/%02x/%02x)",
 		         color->global_index, color->r, color->g, color->b);
 		return GFX_ERROR;
 	}
 
 	if (!palette_color->lockers) {
-		GFXERROR("Attempt to free unused color index %d (%02x/%02x/%02x)!\n",
+		GFXERROR("Attempt to free unused color index %d (%02x/%02x/%02x)",
 		         color->global_index, color->r, color->g, color->b);
 		return GFX_ERROR;
 	}
@@ -403,7 +403,7 @@
 	old_data = pixmap->index_data;
 
 	if (!old_data) {
-		GFXERROR("Attempt to scale index data without index data!\n");
+		GFXERROR("Attempt to scale index data without index data");
 		return pixmap;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -36,7 +36,7 @@
 ** in widget management  */
 
 #ifdef GFXW_DEBUG_DIRTY
-#  define DDIRTY fprintf(stderr, "%s:%5d| ", __FILE__, __LINE__); fprintf
+#  define DDIRTY error("%s:%5d| ", __FILE__, __LINE__); fprintf
 #else
 #  define DDIRTY if (0) fprintf
 #endif
@@ -59,19 +59,19 @@
 /* Performs basic checks that apply to most functions */
 #define BASIC_CHECKS(error_retval) \
 if (!state) { \
-	GFXERROR("Null state!\n"); \
+	GFXERROR("Null state"); \
 	return error_retval; \
 } \
 if (!state->driver) { \
-	GFXERROR("GFX driver invalid!\n"); \
+	GFXERROR("GFX driver invalid"); \
 	return error_retval; \
 }
 
 /* How to determine whether colors have to be allocated */
 #define PALETTE_MODE state->driver->mode->palette
 
-#define DRAW_POINTER { int __x = _gfxop_draw_pointer(state); if (__x) { GFXERROR("Drawing the mouse pointer failed!\n"); return __x;} }
-#define REMOVE_POINTER { int __x = _gfxop_remove_pointer(state); if (__x) { GFXERROR("Removing the mouse pointer failed!\n"); return __x;} }
+#define DRAW_POINTER { int __x = _gfxop_draw_pointer(state); if (__x) { GFXERROR("Drawing the mouse pointer failed"); return __x;} }
+#define REMOVE_POINTER { int __x = _gfxop_remove_pointer(state); if (__x) { GFXERROR("Removing the mouse pointer failed"); return __x;} }
 
 /* #define GFXOP_DEBUG_DIRTY */
 
@@ -199,7 +199,7 @@
 	int x,y;											\
 													\
 	if (!pxm->index_data) {										\
-		GFXERROR("Attempt to draw control color %d on pixmap %d/%d/%d without index data!\n",	\
+		GFXERROR("Attempt to draw control color %d on pixmap %d/%d/%d without index data",	\
 			 color, pxm->ID, pxm->loop, pxm->cel);						\
 		return;											\
 	}												\
@@ -250,7 +250,7 @@
 			                                 pxm->colors[i].g,
 			                                 pxm->colors[i].b))) {
 
-				GFXWARN("driver->set_palette(%d, %02x/%02x/%02x) failed!\n",
+				GFXWARN("driver->set_palette(%d, %02x/%02x/%02x) failed",
 				        pxm->colors[i].global_index,
 				        pxm->colors[i].r,
 				        pxm->colors[i].g,
@@ -308,7 +308,7 @@
 	                            static_buf ? GFX_BUFFER_STATIC : GFX_BUFFER_BACK);
 
 	if (error) {
-		GFXERROR("driver->draw_pixmap() returned error!\n");
+		GFXERROR("driver->draw_pixmap() returned error");
 		return error;
 	}
 	return GFX_OK;
@@ -479,7 +479,7 @@
 		box.yl = - box.yl;
 	}
 #ifdef GFXOP_DEBUG_DIRTY
-	fprintf(stderr, "Adding new dirty (%d %d %d %d)\n",
+	error("Adding new dirty (%d %d %d %d)\n",
 	        GFX_PRINT_RECT(box));
 #endif
 	if (_gfxop_clip(&box, gfx_rect(0, 0, 320, 200)))
@@ -552,7 +552,7 @@
 		return GFX_OK;
 
 #ifdef GFXOP_DEBUG_DIRTY
-	fprintf(stderr, "\tClearing dirty (%d %d %d %d)\n",
+	error("\tClearing dirty (%d %d %d %d)\n",
 	        GFX_PRINT_RECT(rect->rect));
 #endif
 	if (!state->fullscreen_override)
@@ -585,7 +585,7 @@
 	                         state->options,
 	                         state->driver,
 	                         misc_payload)))) {
-		GFXERROR("Failed to initialize resource manager!\n");
+		GFXERROR("Failed to initialize resource manager");
 		return GFX_FATAL;
 	}
 
@@ -1276,7 +1276,7 @@
 		return drv->draw_filled_rect(drv, new_box, color1, color1, GFX_SHADE_FLAT);
 	else {
 		if (PALETTE_MODE) {
-			GFXWARN("Attempting to draw shaded box in palette mode!\n");
+			GFXWARN("Attempting to draw shaded box in palette mode");
 			return GFX_ERROR;
 		}
 
@@ -1376,7 +1376,7 @@
 		break;
 
 	default:
-		fprintf(stderr, "Invalid display map %d selected!\n", visible_map);
+		error("Invalid display map %d selected", visible_map);
 		return GFX_ERROR;
 	}
 
@@ -1404,7 +1404,7 @@
 	}
 
 	if (retval) {
-		GFXERROR("Clearing the dirty rectangles failed!\n");
+		GFXERROR("Clearing the dirty rectangles failed");
 	}
 
 	if (state->tag_mode) {
@@ -1457,7 +1457,7 @@
 /* Sure, this may seem silly, but it's too easy to miss a zero...) */
 
 
-#define GFXOP_FULL_POINTER_REFRESH if (_gfxop_full_pointer_refresh(state)) { GFXERROR("Failed to do full pointer refresh!\n"); return GFX_ERROR; }
+#define GFXOP_FULL_POINTER_REFRESH if (_gfxop_full_pointer_refresh(state)) { GFXERROR("Failed to do full pointer refresh"); return GFX_ERROR; }
 
 static int
 _gfxop_full_pointer_refresh(gfx_state_t *state) {
@@ -1774,7 +1774,7 @@
 
 	BASIC_CHECKS(error_event);
 	if (_gfxop_remove_pointer(state)) {
-		GFXERROR("Failed to remove pointer before processing event!\n");
+		GFXERROR("Failed to remove pointer before processing event");
 	}
 
 	while (*seekerp && !((*seekerp)->event.type & mask))
@@ -1807,7 +1807,7 @@
 	}
 
 	if (_gfxop_full_pointer_refresh(state)) {
-		GFXERROR("Failed to update the mouse pointer!\n");
+		GFXERROR("Failed to update the mouse pointer");
 		return error_event;
 	}
 
@@ -2043,13 +2043,13 @@
 		state->pic_unscaled = gfxr_get_pic(state->resstate, nr, GFX_MASK_VISUAL, flags, default_palette, 0);
 
 	if (!state->pic || !state->pic_unscaled) {
-		GFXERROR("Could not retrieve background pic %d!\n", nr);
+		GFXERROR("Could not retrieve background pic %d", nr);
 		if (state->pic) {
-			GFXERROR("  -- Inconsistency: scaled pic _was_ retrieved!\n");
+			GFXERROR("  -- Inconsistency: scaled pic _was_ retrieved");
 		}
 
 		if (state->pic_unscaled) {
-			GFXERROR("  -- Inconsistency: unscaled pic _was_ retrieved!\n");
+			GFXERROR("  -- Inconsistency: unscaled pic _was_ retrieved");
 		}
 
 		state->pic = state->pic_unscaled = NULL;
@@ -2067,13 +2067,13 @@
 	BASIC_CHECKS(GFX_FATAL);
 
 	if (!state->pic) {
-		GFXERROR("Attempt to add to pic with no pic active!\n");
+		GFXERROR("Attempt to add to pic with no pic active");
 		return GFX_ERROR;
 	}
 
 	if (!(state->pic = gfxr_add_to_pic(state->resstate, state->pic_nr, nr,
 	                                   GFX_MASK_VISUAL, flags, state->palette_nr, default_palette, 1))) {
-		GFXERROR("Could not add pic #%d to pic #%d!\n", state->pic_nr, nr);
+		GFXERROR("Could not add pic #%d to pic #%d", state->pic_nr, nr);
 		return GFX_ERROR;
 	}
 	state->pic_unscaled = gfxr_add_to_pic(state->resstate, state->pic_nr, nr,
@@ -2264,7 +2264,7 @@
 	REMOVE_POINTER;
 
 	if (!handle) {
-		GFXERROR("Attempt to draw text with NULL handle!\n");
+		GFXERROR("Attempt to draw text with NULL handle");
 		return GFX_ERROR;
 	}
 
@@ -2293,7 +2293,7 @@
 		break;
 
 	default:
-		GFXERROR("Invalid vertical alignment %d!\n", handle->valign);
+		GFXERROR("Invalid vertical alignment %d", handle->valign);
 		return GFX_FATAL; /* Internal error... */
 	}
 
@@ -2326,7 +2326,7 @@
 			break;
 
 		default:
-			GFXERROR("Invalid vertical alignment %d!\n", handle->valign);
+			GFXERROR("Invalid vertical alignment %d", handle->valign);
 			return GFX_FATAL; /* Internal error... */
 		}
 
@@ -2352,7 +2352,7 @@
 	rect_t resultzone; /* Ignored for this application */
 	BASIC_CHECKS(NULL);
 	if (_gfxop_remove_pointer(state)) {
-		GFXERROR("Could not remove pointer!\n");
+		GFXERROR("Could not remove pointer");
 		return NULL;
 	}
 
@@ -2371,7 +2371,7 @@
 	BASIC_CHECKS(GFX_ERROR);
 
 	if (!pxm) {
-		GFXERROR("Attempt to draw NULL pixmap!\n");
+		GFXERROR("Attempt to draw NULL pixmap");
 		return GFX_ERROR;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resmgr.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/resmgr.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -70,7 +70,7 @@
 		else {
 			tree = sbtree_new(entries_nr, resources);
 			if (!tree) {
-				GFXWARN("Failed to allocate tree for %d entries of resource type %d!\n", entries_nr, i);
+				GFXWARN("Failed to allocate tree for %d entries of resource type %d", entries_nr, i);
 			}
 			state->resource_trees[i] = tree;
 			free(resources);
@@ -302,7 +302,7 @@
 			                                       state->misc_payload);
 
 		if (!pic) {
-			GFXERROR("Failed to allocate scaled pic!\n");
+			GFXERROR("Failed to allocate scaled pic");
 			return NULL;
 		}
 
@@ -314,7 +314,7 @@
 			               GFXR_RES_ID(restype, nr),
 			               state->misc_payload);
 			if (!unscaled_pic) {
-				GFXERROR("Failed to allocate unscaled pic!\n");
+				GFXERROR("Failed to allocate unscaled pic");
 				return NULL;
 			}
 			gfxr_interpreter_clear_pic(state->version, unscaled_pic,

Modified: scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -375,11 +375,11 @@
 
 #ifdef FILL_RECURSIVE_DEBUG
 	if (!fillmagc) {
-		fprintf(stderr, "------------------------------------------------\n");
-		fprintf(stderr, "LineID:   ");
+		error("------------------------------------------------\n");
+		error("LineID:   ");
 		for (i = 0; i < 5; i++)
-			fprintf(stderr, "  %d       ", i);
-		fprintf(stderr, "\n");
+			error("  %d       ", i);
+		error("\n");
 	}
 #endif
 
@@ -481,10 +481,10 @@
 
 #ifdef FILL_RECURSIVE_DEBUG
 		if (!fillmagc && intervals_nr) {
-			fprintf(stderr, "AI L#%03d:", y);
+			error("AI L#%03d:", y);
 			for (int j = 0; j < intervals_nr; j++)
-				fprintf(stderr, "%c[%03d,%03d]", intervals[ivi][j].tag ? ' ' : '-', intervals[ivi][j].xl, intervals[ivi][j].xr);
-			fprintf(stderr, "\n");
+				error("%c[%03d,%03d]", intervals[ivi][j].tag ? ' ' : '-', intervals[ivi][j].xl, intervals[ivi][j].xr);
+			error("\n");
 		}
 #endif
 
@@ -631,7 +631,7 @@
 				break;
 
 			default:
-				fprintf(stderr, "%s L%d: Invalid ellipse fill mode!\n", __FILE__, __LINE__);
+				error("%s L%d: Invalid ellipse fill mode", __FILE__, __LINE__);
 				return;
 
 			}
@@ -968,7 +968,7 @@
 	end.y = ey;
 
 	if (ex >= pic->visual_map->index_xl || ey >= pic->visual_map->index_yl || x < 0 || y < 0) {
-		fprintf(stderr, "While drawing pic0: INVALID LINE %d,%d,%d,%d\n",
+		error("While drawing pic0: INVALID LINE %d,%d,%d,%d\n",
 		        start.x, start.y, end.x, end.y);
 		return;
 	}
@@ -1307,7 +1307,7 @@
 
 	if (bound_x == 1 && bound_y == 1) {
 		/* D'Oh! */
-		GFXWARN("attempt to remove artifacts from unscaled pic!\n");
+		GFXWARN("attempt to remove artifacts from unscaled pic");
 		return;
 	}
 
@@ -1494,12 +1494,12 @@
 			GET_ABS_COORDS(oldx, oldy);
 			while (*(resource + pos) < PIC_OP_FIRST) {
 #if 0
-				fprintf(stderr, "Medium-line: [%04x] from %d,%d, data %02x %02x (dx=%d)", pos, oldx, oldy,
+				error("Medium-line: [%04x] from %d,%d, data %02x %02x (dx=%d)", pos, oldx, oldy,
 				        0xff & resource[pos], 0xff & resource[pos+1], *((signed char *) resource + pos + 1));
 #endif
 				GET_MEDREL_COORDS(oldx, oldy);
 #if 0
-				fprintf(stderr, " to %d,%d\n", x, y);
+				error(" to %d,%d\n", x, y);
 #endif
 				_gfxr_draw_line(pic, oldx, oldy, x, y, color, priority, control, drawenable, line_mode,
 				                PIC_OP_MEDIUM_LINES, sci_titlebar_size);
@@ -1780,7 +1780,7 @@
 				 *if it's not for some reason, we should die
 				 */
 				if (!(view->flags & GFX_PIXMAP_FLAG_EXTERNAL_PALETTE) && !sci1) {
-					sciprintf("gfx_draw_pic0(): can't set a non-static palette for an embedded view!\n");
+					sciprintf("gfx_draw_pic0(): can't set a non-static palette for an embedded view");
 				}
 
 				/* For SCI0, use special color mapping to copy the low
@@ -1832,7 +1832,7 @@
 				if (!pic->internal) {
 					pic->internal = sci_malloc(16 * sizeof(int));
 				} else {
-					GFXERROR("pic->internal is not NULL (%08x); this only occurs with overlaid pics, otherwise it's a bug!\n", pic->internal);
+					GFXERROR("pic->internal is not NULL (%08x); this only occurs with overlaid pics, otherwise it's a bug", pic->internal);
 				}
 
 				pri_table = (int*)pic->internal;
@@ -1854,7 +1854,7 @@
 				if (!pic->internal) {
 					pic->internal = sci_malloc(16 * sizeof(int));
 				} else {
-					GFXERROR("pic->internal is not NULL (%08x); possible memory corruption!\n", pic->internal);
+					GFXERROR("pic->internal is not NULL (%08x); possible memory corruption", pic->internal);
 				}
 
 				pri_table = (int*)pic->internal;
@@ -1980,7 +1980,7 @@
 				break;
 
 			default:
-				GFXERROR("Invalid dither mode %d!\n", dmode);
+				GFXERROR("Invalid dither mode %d", dmode);
 				return;
 			}
 

Modified: scummvm/trunk/engines/sci/gfx/resource/sci_view_1.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/sci_view_1.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/resource/sci_view_1.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -347,7 +347,7 @@
 		return NULL;
 	}
 
-	/*	fprintf(stderr, "View flags are 0x%02x\n", resource[3]);*/
+	/*	error("View flags are 0x%02x\n", resource[3]);*/
 
 	/*
 		for (i = 0; i < V1_MAGICS_NR; i++)

Modified: scummvm/trunk/engines/sci/gfx/sbtree.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/sbtree.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/sbtree.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -25,7 +25,7 @@
 
 /* Static binary lookup tree lookup */
 
-
+#include "common/util.h"
 #include "sci/include/sci_memory.h"
 #include "sci/include/sbtree.h"
 #include <stdlib.h>
@@ -84,14 +84,14 @@
 		table[i].key = NOT_A_KEY;
 
 	if (!table) {
-		fprintf(stderr, "SBTree: Out of memory: Could not allocate %d cells\n", table_size);
+		error("SBTree: Out of memory: Could not allocate %d cells\n", table_size);
 		return NULL;
 	}
 
 	tree = (sbtree_t*)sci_malloc(sizeof(sbtree_t));
 
 	if (!tree) {
-		fprintf(stderr, "SBTree: Could not allocate tree structure\n");
+		error("SBTree: Could not allocate tree structure\n");
 		free(table);
 		return NULL;
 	}
@@ -103,7 +103,7 @@
 	tree->levels = levels;
 	tree->entries_nr = size;
 	if ((tree->min_entry = keys[0]) < 0) {
-		fprintf(stderr, "SBTree: Error: Using negative keys\n");
+		error("SBTree: Error: Using negative keys\n");
 		free(table);
 		free(tree);
 		return NULL;
@@ -118,7 +118,7 @@
 void
 sbtree_free(sbtree_t *tree) {
 	if (!tree) {
-		fprintf(stderr, "SBTree: Attempt to free NULL sbtree\n");
+		error("SBTree: Attempt to free NULL sbtree\n");
 		return;
 	}
 
@@ -188,24 +188,24 @@
 	int l, i;
 	sbcell_t *cells = (sbcell_t *) tree->data;
 
-	fprintf(stderr, "\tTree:\n");
+	error("\tTree:\n");
 	for (l = 0; l <= tree->levels; l++) {
-		fprintf(stderr, "\t  ");
+		error("\t  ");
 		for (i = 0; i < (1 << l); i++) {
 			if (cells->key == NOT_A_KEY)
-				fprintf(stderr, "-- ");
+				error("-- ");
 			else {
 				if (cells->value)
-					fprintf(stderr, "%d+ ", cells->key);
+					error("%d+ ", cells->key);
 				else
-					fprintf(stderr, "%d  ", cells->key);
+					error("%d  ", cells->key);
 			}
 
 			cells = cells + 1;
 		}
-		fprintf(stderr, "\n");
+		error("\n");
 	}
-	fprintf(stderr, "\n");
+	error("\n");
 }
 #endif
 
@@ -223,7 +223,7 @@
 	int *real_value = (int *) value;
 
 	if (!real_value)
-		fprintf(stderr, "foreach_double_func(): key %d mapped to non-value!\n", key);
+		error("foreach_double_func(): key %d mapped to non-value", key);
 	else *real_value *= 2;
 
 	return real_value;
@@ -267,7 +267,7 @@
 
 	for (i = 0; i < nr; i++)
 		if (sbtree_set(tree, data[i], (void *)(data + i))) {
-			fprintf(stderr, "While inserting: %d incorrectly deemed invalid\n", data[i]);
+			error("While inserting: %d incorrectly deemed invalid\n", data[i]);
 			any_error = 1;
 		}
 }
@@ -296,18 +296,18 @@
 				found = 1;
 
 		if (found && !value) {
-			fprintf(stderr, "!%d ", key);
+			error("!%d ", key);
 			++failed;
 		} else if (!found && found) {
-			fprintf(stderr, "?[%d]=%d ", key, *value);
+			error("?[%d]=%d ", key, *value);
 			++failed;
 		}
 	}
 
 	if (failed)
-		fprintf(stderr, "(%d/%d errors)\n", any_error = failed, times);
+		error("(%d/%d errors)\n", any_error = failed, times);
 	else
-		fprintf(stderr, "OK\n");
+		error("OK\n");
 }
 
 
@@ -320,23 +320,23 @@
 	int failure = (value_too_low || value_too_high || (!random && (!value_low || !value_high)));
 
 	if (!failure)
-		fprintf(stderr, "OK\n");
+		error("OK\n");
 	else {
 		any_error = 1;
 
-		fprintf(stderr, "Errors: ");
+		error("Errors: ");
 		if (value_too_low)
-			fprintf(stderr, "too-low=%d ", *value_too_low);
+			error("too-low=%d ", *value_too_low);
 		if (value_too_high)
-			fprintf(stderr, "too-high=%d ", *value_too_high);
+			error("too-high=%d ", *value_too_high);
 
 		if (!random) {
 			if (!value_low)
-				fprintf(stderr, "!low ");
+				error("!low ");
 			if (!value_high)
-				fprintf(stderr, "!high ");
+				error("!high ");
 		}
-		fprintf(stderr, "\n");
+		error("\n");
 	}
 }
 
@@ -351,15 +351,15 @@
 		int *value;
 
 		if ((value = (int *) sbtree_get(tree, key))) {
-			fprintf(stderr, "?[%d]=%d\n", key, *value);
+			error("?[%d]=%d\n", key, *value);
 			++errors;
 		}
 	}
 
 	if (errors)
-		fprintf(stderr, " (%d/%d errors)\n", any_error = errors, count);
+		error(" (%d/%d errors)\n", any_error = errors, count);
 	else
-		fprintf(stderr, "OK\n");
+		error("OK\n");
 }
 
 void
@@ -369,23 +369,23 @@
 
 	any_error = 0;
 
-	fprintf(stderr, "\tEmpty test: \t\t\t");
+	error("\tEmpty test: \t\t\t");
 	test_empty(tree, entries * 2, entries + 1);
 	insert_values(tree, entries, data);
-	fprintf(stderr, "\tBoundary test: \t\t\t");
+	error("\tBoundary test: \t\t\t");
 	test_boundary(tree, max_value, random);
 
 	for (i = 0; i < 3; i++) {
-		fprintf(stderr, tests[i]);
+		error(tests[i]);
 		test_value(tree, entries * 2, entries * 2, entries, data, i);
 	}
 
 	if (!random) {
 		i = data[0];
 		sbtree_foreach(tree, NULL, foreach_double_func);
-		fprintf(stderr, "\tForeach test: \t\t\t");
+		error("\tForeach test: \t\t\t");
 		if (i * 2 != data[0]) {
-			fprintf(stderr, "Error: No effect: %d * 2 != %d\n", i, data[0]);
+			error("Error: No effect: %d * 2 != %d\n", i, data[0]);
 			any_error = 1;
 		} else
 			test_value(tree, entries * 2, entries * 2, entries, data, MODE_LINEAR_DOUBLE);
@@ -406,46 +406,46 @@
 	int tests_nr = TESTS_NR;
 	int test_sizes[TESTS_NR] = {1, 2, 3, 7, 8, 9, 1000, 16383, 16384, 16385, 1000000};
 	int i;
-	fprintf(stderr, "sbtree.c Copyright (C) 2000 Christoph Reichenbach <jameson at linuxgames.com>\n"
+	error("sbtree.c Copyright (C) 2000 Christoph Reichenbach <jameson at linuxgames.com>\n"
 	        "This program is provided WITHOUT WARRANTY of any kind\n"
 	        "Please refer to the file COPYING that should have come with this program\n");
-	fprintf(stderr, "Static Binary Tree testing facility\n");
+	error("Static Binary Tree testing facility\n");
 
 	free(malloc(42)); /* Make sure libefence's Copyright message is print here if we're using it */
 
-	fprintf(stderr, "\nsbtree.c: Running %d tests.\n", tests_nr);
+	error("\nsbtree.c: Running %d tests.\n", tests_nr);
 
 	for (i = 0; i < tests_nr; i++) {
 		int entries = test_sizes[i];
 		sbtree_t *tree;
 		int *data;
 
-		fprintf(stderr, "Test #%d: %d entries\n", i + 1, entries);
+		error("Test #%d: %d entries\n", i + 1, entries);
 
-		fprintf(stderr, "\t%da: Linear values\n", i + 1);
+		error("\t%da: Linear values\n", i + 1);
 		data = generate_linear_forward(entries);
 		tree = sbtree_new(entries, data);
 		run_test(tree, entries, data, 0, entries);
 
-		fprintf(stderr, "\t%db: Reverse linear values\n", i + 1);
+		error("\t%db: Reverse linear values\n", i + 1);
 		data = generate_linear_backward(entries);
 		tree = sbtree_new(entries, data);
 		run_test(tree, entries, data, 0, entries);
 
-		fprintf(stderr, "\t%dc: Dense random values\n", i + 1);
+		error("\t%dc: Dense random values\n", i + 1);
 		data = generate_random(entries, 1 + (entries >> 2));
 		tree = sbtree_new(entries, data);
 		run_test(tree, entries, data, 1, 1 + (entries >> 2));
 
-		fprintf(stderr, "\t%dc: Sparse random values\n", i + 1);
+		error("\t%dc: Sparse random values\n", i + 1);
 		data = generate_random(entries, (entries << 2));
 		tree = sbtree_new(entries, data);
 		run_test(tree, entries, data, 1, entries << 2);
 
-		fprintf(stderr, "Test #%d completed.\n\n", i + 1);
+		error("Test #%d completed.\n\n", i + 1);
 	}
 
-	fprintf(stderr, "Test suite completed.\n");
+	error("Test suite completed.\n");
 	return 0;
 }
 

Modified: scummvm/trunk/engines/sci/gfx/sci_widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/sci_widgets.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/sci_widgets.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -80,14 +80,14 @@
 	gfx_color_t black = s->ega_colors[0];
 
 	if (!status_bar->visual) {
-		GFXERROR("Attempt to change title bar without visual!\n");
+		GFXERROR("Attempt to change title bar without visual");
 		return;
 	}
 
 	state = status_bar->visual->gfx_state;
 
 	if (!state) {
-		GFXERROR("Attempt to change title bar with stateless visual!\n");
+		GFXERROR("Attempt to change title bar with stateless visual");
 		return;
 	}
 
@@ -224,7 +224,7 @@
 
 		if (!(flags & WINDOW_FLAG_NO_DROP_SHADOW)) {
 			if (gfxop_set_color(state, &black, 0, 0, 0, 0x80, bgcolor.priority, -1)) {
-				GFXERROR("Could not get black/semitrans color entry!\n");
+				GFXERROR("Could not get black/semitrans color entry");
 				return NULL;
 			}
 
@@ -242,7 +242,7 @@
 		/* Draw frame */
 
 		if (gfxop_set_color(state, &black, 0, 0, 0, 0, bgcolor.priority, -1)) {
-			GFXERROR("Could not get black color entry!\n");
+			GFXERROR("Could not get black color entry");
 			return NULL;
 		}
 
@@ -461,7 +461,7 @@
 	gfxw_set_id(GFXW(list), ID.segment, ID.offset);
 
 	if (!port->visual) {
-		GFXERROR("Attempting to create icon control for virtual port!\n");
+		GFXERROR("Attempting to create icon control for virtual port");
 		return NULL;
 	}
 

Modified: scummvm/trunk/engines/sci/gfx/widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/widgets.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/gfx/widgets.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -29,7 +29,7 @@
 #undef GFXW_DEBUG_DIRTY /* Enable to debug dirty rectangle propagation (writes to stderr) */
 
 #ifdef GFXW_DEBUG_DIRTY
-#  define DDIRTY fprintf(stderr, "%s:%5d| ", __FILE__, __LINE__); fprintf
+#  define DDIRTY error("%s:%5d| ", __FILE__, __LINE__); fprintf
 #else
 #  define DDIRTY if (0) fprintf
 #endif
@@ -47,7 +47,7 @@
 static void
 _gfxw_debug_add_widget(gfxw_widget_t *widget) {
 	if (debug_widget_pos == GFXW_DEBUG_WIDGETS) {
-		GFXERROR("WIDGET DEBUG: Allocated the maximum number of %d widgets- Aborting!\n", GFXW_DEBUG_WIDGETS);
+		GFXERROR("WIDGET DEBUG: Allocated the maximum number of %d widgets- Aborting", GFXW_DEBUG_WIDGETS);
 		BREAKPOINT();
 	}
 	debug_widgets[debug_widget_pos++] = widget;
@@ -67,12 +67,12 @@
 	}
 
 	if (found > 1) {
-		GFXERROR("While removing widget: Found it %d times!\n", found);
+		GFXERROR("While removing widget: Found it %d times", found);
 		BREAKPOINT();
 	}
 
 	if (found == 0) {
-		GFXERROR("Attempted removal of unregistered widget!\n");
+		GFXERROR("Attempted removal of unregistered widget");
 		BREAKPOINT();
 	}
 }
@@ -199,7 +199,7 @@
 
 		if (text->text_handle) {
 			if (!state) {
-				GFXERROR("Attempt to free text without supplying mode to free it from!\n");
+				GFXERROR("Attempt to free text without supplying mode to free it from");
 				BREAKPOINT();
 			} else {
 				gfxop_free_text(state, text->text_handle);
@@ -217,7 +217,7 @@
   { \
 	  int retval = (_x); \
 	  if (retval == GFX_ERROR) { \
-		  GFXERROR("Error occured while drawing widget!\n"); \
+		  GFXERROR("Error occured while drawing widget"); \
 		  return 1; \
 	  } else if (retval == GFX_FATAL) { \
 		  GFXERROR("Fatal error occured while drawing widget!\nGraphics state invalid; aborting program..."); \
@@ -235,11 +235,11 @@
 /* Assertion for drawing */
 #define DRAW_ASSERT(widget, exp_type) \
   if (!(widget)) { \
-	sciprintf("L%d: NULL widget!\n", __LINE__); \
+	sciprintf("L%d: NULL widget", __LINE__); \
 	return 1; \
   } \
   if (!(widget)->print) { \
-	  sciprintf("L%d: Widget of type %d does not have print function!\n", __LINE__, \
+	  sciprintf("L%d: Widget of type %d does not have print function", __LINE__, \
 		    (widget)->type); \
   } \
   if ((widget)->type != (exp_type)) { \
@@ -324,7 +324,7 @@
 	gfxw_widget_t **seekerp;
 
 	if (!container) {
-		GFXERROR("Attempt to remove widget from NULL container!\n");
+		GFXERROR("Attempt to remove widget from NULL container");
 		BREAKPOINT();
 	}
 
@@ -342,7 +342,7 @@
 		seekerp = &((*seekerp)->next);
 
 	if (!*seekerp) {
-		GFXERROR("Internal error: Attempt to remove widget from container it was not contained in!\n");
+		GFXERROR("Internal error: Attempt to remove widget from container it was not contained in");
 		sciprintf("Widget:");
 		widget->print(GFXW(widget), 1);
 		sciprintf("Container:");
@@ -705,7 +705,7 @@
 	Common::Point offset;
 
 	if (!state) {
-		GFXERROR("Attempt to create view widget with NULL state!\n");
+		GFXERROR("Attempt to create view widget with NULL state");
 		return NULL;
 	}
 
@@ -988,7 +988,7 @@
 	Common::Point offset;
 
 	if (!state) {
-		GFXERROR("Attempt to create view widget with NULL state!\n");
+		GFXERROR("Attempt to create view widget with NULL state");
 		return NULL;
 	}
 
@@ -1657,7 +1657,7 @@
 		return 0;
 
 	if (!GFXW_IS_LIST(widget)) {
-		GFXWARN("_gfxwop_list_equals(): Method called on non-list!\n");
+		GFXWARN("_gfxwop_list_equals(): Method called on non-list");
 		widget->print(widget, 0);
 		sciprintf("\n");
 		return 0;
@@ -1866,9 +1866,9 @@
 static int
 _gfxwop_visual_set_visual(gfxw_widget_t *self, gfxw_visual_t *visual) {
 	if (self != GFXW(visual)) {
-		GFXWARN("Attempt to set a visual's parent visual to something else!\n");
+		GFXWARN("Attempt to set a visual's parent visual to something else");
 	} else {
-		GFXWARN("Attempt to set a visual's parent visual!\n");
+		GFXWARN("Attempt to set a visual's parent visual");
 	}
 	return 1;
 }
@@ -1967,12 +1967,12 @@
 		int ID = port->ID;
 
 		if (ID < 0 || ID >= visual->port_refs_nr) {
-			GFXWARN("Attempt to free port #%d; allowed: [0..%d]!\n", ID, visual->port_refs_nr);
+			GFXWARN("Attempt to free port #%d; allowed: [0..%d]", ID, visual->port_refs_nr);
 			return GFX_ERROR;
 		}
 
 		if (visual->port_refs[ID] != port) {
-			GFXWARN("While freeing port %d: Port is at %p, but port list indicates %p!\n",
+			GFXWARN("While freeing port %d: Port is at %p, but port list indicates %p",
 			        ID, port, visual->port_refs[ID]);
 		} else visual->port_refs[ID] = NULL;
 
@@ -2045,7 +2045,7 @@
 		if (self->port_bg->superarea_of(self->port_bg, &foo)) {
 			gfxw_container_t *parent = self->parent;
 			while (parent) {
-				fprintf(stderr, "Dirtifying parent id %d\n", parent->ID);
+				error("Dirtifying parent id %d\n", parent->ID);
 				parent->flags |= GFXW_FLAG_DIRTY;
 				parent = parent->parent;
 			}

Modified: scummvm/trunk/engines/sci/include/heapmgr.h
===================================================================
--- scummvm/trunk/engines/sci/include/heapmgr.h	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/include/heapmgr.h	2009-02-20 20:39:02 UTC (rev 38621)
@@ -78,8 +78,8 @@
 	ENTRY##_entry_t *e = table->table + index;				\
 										\
 	if (index < 0 || index >= table->max_entry) {				\
-		fprintf(stderr, "heapmgr: Attempt to release"			\
-			" invalid table index %d!\n", index);			\
+		error("heapmgr: Attempt to release"			\
+			" invalid table index %d", index);			\
 		BREAKPOINT();							\
 	}									\
 	CLEANUP_FN(&(e->entry));						\

Modified: scummvm/trunk/engines/sci/include/kdebug.h
===================================================================
--- scummvm/trunk/engines/sci/include/kdebug.h	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/include/kdebug.h	2009-02-20 20:39:02 UTC (rev 38621)
@@ -40,7 +40,6 @@
 #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

Modified: scummvm/trunk/engines/sci/include/resource.h
===================================================================
--- scummvm/trunk/engines/sci/include/resource.h	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/include/resource.h	2009-02-20 20:39:02 UTC (rev 38621)
@@ -295,7 +295,7 @@
 #  endif /* !__i386__ && !__alpha__ */
 #endif
 #ifndef BREAKPOINT
-#  define BREAKPOINT() { fprintf(stderr, "Missed breakpoint in %s, line %d\n", __FILE__, __LINE__); *((int *) NULL) = 42; }
+#  define BREAKPOINT() { error("Missed breakpoint in %s, line %d\n", __FILE__, __LINE__); *((int *) NULL) = 42; }
 #endif  /* !BREAKPOINT() */
 
 #endif

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -121,7 +121,7 @@
 		}
 
 		if (!recovered) {
-			fprintf(stderr, "Script initialization failed. Aborting...\n");
+			error("Script initialization failed. Aborting...\n");
 			return 1;
 		}
 	}
@@ -244,7 +244,7 @@
 
 
 	if (game_init(gamestate)) { /* Initialize */
-		fprintf(stderr, "Game initialization failed: Aborting...\n");
+		error("Game initialization failed: Aborting...\n");
 		// TODO: Add an "init failed" error?
 		return Common::kUnknownError;
 	}
@@ -290,17 +290,17 @@
 	/**** Default config ends */
 
 	if (gfxop_init_default(&gfx_state, &gfx_options, resmgr)) {
-		fprintf(stderr, "Graphics initialization failed. Aborting...\n");
+		error("Graphics initialization failed. Aborting...\n");
 		return Common::kUnknownError;
 	}
 
 	if (game_init_graphics(gamestate)) { /* Init interpreter graphics */
-		fprintf(stderr, "Game initialization failed: Error in GFX subsystem. Aborting...\n");
+		error("Game initialization failed: Error in GFX subsystem. Aborting...\n");
 		return Common::kUnknownError;
 	}
 
 	if (game_init_sound(gamestate, 0)) {
-		fprintf(stderr, "Game initialization failed: Error in sound subsystem. Aborting...\n");
+		error("Game initialization failed: Error in sound subsystem. Aborting...\n");
 		return Common::kUnknownError;
 	}
 

Modified: scummvm/trunk/engines/sci/scicore/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/console.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/scicore/console.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -50,12 +50,12 @@
 	char *buf 	= (char *) sci_malloc(bufsize);
 
 	if (NULL == fmt) {
-		fprintf(stderr, "console.c: sciprintf(): NULL passed for parameter fmt\n");
+		error("console.c: sciprintf(): NULL passed for parameter fmt\n");
 		return -1;
 	}
 
 	if (NULL == buf) {
-		fprintf(stderr, "console.c: sciprintf(): malloc failed for buf\n");
+		error("console.c: sciprintf(): malloc failed for buf\n");
 		return -1;
 	}
 
@@ -116,7 +116,7 @@
 		fclose(con_file);
 
 	if (NULL == filename) {
-		fprintf(stderr, "console.c: open_console_file(): NULL passed for parameter filename\r\n");
+		error("console.c: open_console_file(): NULL passed for parameter filename\r\n");
 	}
 #ifdef WIN32
 	con_file = fopen(filename, "wt");
@@ -125,7 +125,7 @@
 #endif
 
 	if (NULL == con_file)
-		fprintf(stderr, "console.c: open_console_file(): Could not open output file %s\n", filename);
+		error("console.c: open_console_file(): Could not open output file %s\n", filename);
 
 }
 

Modified: scummvm/trunk/engines/sci/scicore/decompress0.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress0.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/scicore/decompress0.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -27,6 +27,7 @@
 ** This is for SCI version 0 style compression.
 */
 
+#include "common/util.h"
 #include "sci/include/sci_memory.h"
 #include "sci/include/sciresource.h"
 
@@ -99,7 +100,7 @@
 				if (token > 0xff) {
 					if (token >= tokenctr) {
 #ifdef _SCI_DECOMPRESS_DEBUG
-						fprintf(stderr, "decrypt1: Bad token %x!\n", token);
+						error("decrypt1: Bad token %x", token);
 #endif
 						/* Well this is really bad  */
 						/* May be it should throw something like SCI_ERROR_DECOMPRESSION_INSANE */
@@ -109,7 +110,7 @@
 #ifdef _SCI_DECOMPRESS_DEBUG
 
 							/* For me this seems a normal situation, It's necessary to handle it*/
-							printf("decrypt1: Trying to write beyond the end of array(len=%d, destctr=%d, tok_len=%d)!\n",
+							printf("decrypt1: Trying to write beyond the end of array(len=%d, destctr=%d, tok_len=%d)",
 							       length, destctr, tokenlastlength);
 #endif
 
@@ -127,7 +128,7 @@
 					tokenlastlength = 1;
 					if (destctr >= length) {
 #ifdef _SCI_DECOMPRESS_DEBUG
-						printf("decrypt1: Try to write single byte beyond end of array!\n");
+						printf("decrypt1: Try to write single byte beyond end of array");
 #endif
 					} else
 						dest[destctr++] = (byte)token;
@@ -301,12 +302,12 @@
 
 
 #ifdef _SCI_DECOMPRESS_DEBUG
-	fprintf(stderr, "Resource %s.%03hi encrypted with method %hi at %.2f%%"
+	error("Resource %s.%03hi encrypted with method %hi at %.2f%%"
 	        " ratio\n",
 	        sci_resource_types[result->type], result->number, compressionMethod,
 	        (result->size == 0) ? -1.0 :
 	        (100.0 * compressedLength / result->size));
-	fprintf(stderr, "  compressedLength = 0x%hx, actualLength=0x%hx\n",
+	error("  compressedLength = 0x%hx, actualLength=0x%hx\n",
 	        compressedLength, result->size);
 #endif
 
@@ -347,8 +348,8 @@
 		break;
 
 	default:
-		fprintf(stderr, "Resource %s.%03hi: Compression method %hi not "
-		        "supported!\n", sci_resource_types[result->type], result->number,
+		error("Resource %s.%03hi: Compression method %hi not "
+		        "supported", sci_resource_types[result->type], result->number,
 		        compressionMethod);
 		free(result->data);
 		result->data = 0; /* So that we know that it didn't work */

Modified: scummvm/trunk/engines/sci/scicore/decompress01.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress01.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/scicore/decompress01.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -25,6 +25,7 @@
 
 /* Reads data from a resource file and stores the result in memory */
 
+#include "common/util.h"
 #include "sci/include/sci_memory.h"
 #include "sci/include/sciresource.h"
 
@@ -425,7 +426,7 @@
 	for (l = 0;l < loopheaders;l++) {
 		if (lh_mask & lb) { /* The loop is _not_ present */
 			if (lh_last == -1) {
-				fprintf(stderr, "Error: While reordering view: Loop not present, but can't re-use last loop!\n");
+				error("Error: While reordering view: Loop not present, but can't re-use last loop");
 				lh_last = 0;
 			}
 			putInt16(lh_ptr, lh_last);
@@ -459,7 +460,7 @@
 	}
 
 	if (celindex < cel_total) {
-		fprintf(stderr, "View decompression generated too few (%d / %d) headers!\n", celindex, cel_total);
+		error("View decompression generated too few (%d / %d) headers", celindex, cel_total);
 		return NULL;
 	}
 
@@ -546,12 +547,12 @@
 
 
 #ifdef _SCI_DECOMPRESS_DEBUG
-	fprintf(stderr, "Resource %s.%03hi encrypted with method SCI01/%hi at %.2f%%"
+	error("Resource %s.%03hi encrypted with method SCI01/%hi at %.2f%%"
 	        " ratio\n",
 	        sci_resource_types[result->type], result->number, compressionMethod,
 	        (result->size == 0) ? -1.0 :
 	        (100.0 * compressedLength / result->size));
-	fprintf(stderr, "  compressedLength = 0x%hx, actualLength=0x%hx\n",
+	error("  compressedLength = 0x%hx, actualLength=0x%hx\n",
 	        compressedLength, result->size);
 #endif
 
@@ -619,8 +620,8 @@
 		break;
 
 	default:
-		fprintf(stderr, "Resource %s.%03hi: Compression method SCI1/%hi not "
-		        "supported!\n", sci_resource_types[result->type], result->number,
+		error("Resource %s.%03hi: Compression method SCI1/%hi not "
+		        "supported", sci_resource_types[result->type], result->number,
 		        compressionMethod);
 		free(result->data);
 		result->data = 0; /* So that we know that it didn't work */

Modified: scummvm/trunk/engines/sci/scicore/decompress1.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress1.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/scicore/decompress1.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -25,6 +25,7 @@
 
 /* Reads data from a resource file and stores the result in memory */
 
+#include "common/util.h"
 #include "sci/include/sci_memory.h"
 #include "sci/include/sciresource.h"
 
@@ -72,7 +73,7 @@
 	int i;
 
 	if (inp->bytepos + morebytes >= inp->length) {
-		fprintf(stderr, "read out-of-bounds with bytepos %d + morebytes %d >= length %d\n",
+		error("read out-of-bounds with bytepos %d + morebytes %d >= length %d\n",
 		        inp->bytepos, morebytes, inp->length);
 		return -SCI_ERROR_DECOMPRESSION_OVERFLOW;
 	}
@@ -98,7 +99,7 @@
 	int i;
 
 	if (inp->bytepos + morebytes >= inp->length) {
-		fprintf(stderr, "read out-of-bounds with bytepos %d + morebytes %d >= length %d\n",
+		error("read out-of-bounds with bytepos %d + morebytes %d >= length %d\n",
 		        inp->bytepos, morebytes, inp->length);
 		return -SCI_ERROR_DECOMPRESSION_OVERFLOW;
 	}
@@ -113,7 +114,7 @@
 	inp->bytepos += morebytes;
 
 	if (DEBUG_DCL_INFLATE)
-		fprintf(stderr, "(%d:%04x)", bits, result);
+		error("(%d:%04x)", bits, result);
 
 	return result;
 }
@@ -126,14 +127,14 @@
 	while (!(tree[pos] & HUFFMAN_LEAF)) {
 		CALLC(bit = getbits(inp, 1));
 		if (DEBUG_DCL_INFLATE)
-			fprintf(stderr, "[%d]:%d->", pos, bit);
+			error("[%d]:%d->", pos, bit);
 		if (bit)
 			pos = tree[pos] & ~(~0 << BRANCH_SHIFT);
 		else
 			pos = tree[pos] >> BRANCH_SHIFT;
 	}
 	if (DEBUG_DCL_INFLATE)
-		fprintf(stderr, "=%02x\n", tree[pos] & 0xffff);
+		error("=%02x\n", tree[pos] & 0xffff);
 	return tree[pos] & 0xffff;
 }
 
@@ -150,28 +151,28 @@
 	CALLC(length_param = getbits(reader, 8));
 
 	if (mode == DCL_ASCII_MODE) {
-		fprintf(stderr, "DCL-INFLATE: Warning: Decompressing ASCII mode (untested)\n");
+		error("DCL-INFLATE: Warning: Decompressing ASCII mode (untested)\n");
 		/*		DEBUG_DCL_INFLATE = 1; */
 	} else if (mode) {
-		fprintf(stderr, "DCL-INFLATE: Error: Encountered mode %02x, expected 00 or 01\n", mode);
+		error("DCL-INFLATE: Error: Encountered mode %02x, expected 00 or 01\n", mode);
 		return 1;
 	}
 
 	if (DEBUG_DCL_INFLATE) {
 		int i;
 		for (i = 0; i < reader->length; i++) {
-			fprintf(stderr, "%02x ", reader->data[i]);
+			error("%02x ", reader->data[i]);
 			if (!((i + 1) & 0x1f))
-				fprintf(stderr, "\n");
+				error("\n");
 		}
 
 
-		fprintf(stderr, "\n---\n");
+		error("\n---\n");
 	}
 
 
 	if (length_param < 3 || length_param > 6)
-		fprintf(stderr, "Warning: Unexpected length_param value %d (expected in [3,6])\n", length_param);
+		error("Warning: Unexpected length_param value %d (expected in [3,6])\n", length_param);
 
 	while (write_pos < length) {
 		CALLC(value = getbits(reader, 1));
@@ -190,7 +191,7 @@
 			}
 
 			if (DEBUG_DCL_INFLATE)
-				fprintf(stderr, " | ");
+				error(" | ");
 
 			CALLC(value = huffman_lookup(reader, distance_tree));
 
@@ -208,15 +209,15 @@
 			++val_distance;
 
 			if (DEBUG_DCL_INFLATE)
-				fprintf(stderr, "\nCOPY(%d from %d)\n", val_length, val_distance);
+				error("\nCOPY(%d from %d)\n", val_length, val_distance);
 
 			if (val_length + write_pos > length) {
-				fprintf(stderr, "DCL-INFLATE Error: Write out of bounds while copying %d bytes\n", val_length);
+				error("DCL-INFLATE Error: Write out of bounds while copying %d bytes\n", val_length);
 				return -SCI_ERROR_DECOMPRESSION_OVERFLOW;
 			}
 
 			if (write_pos < val_distance) {
-				fprintf(stderr, "DCL-INFLATE Error: Attempt to copy from before beginning of input stream\n");
+				error("DCL-INFLATE Error: Attempt to copy from before beginning of input stream\n");
 				return -SCI_ERROR_DECOMPRESSION_INSANE;
 			}
 
@@ -228,8 +229,8 @@
 				if (DEBUG_DCL_INFLATE) {
 					int i;
 					for (i = 0; i < copy_length; i++)
-						fprintf(stderr, "\33[32;31m%02x\33[37;37m ", dest[write_pos + i]);
-					fprintf(stderr, "\n");
+						error("\33[32;31m%02x\33[37;37m ", dest[write_pos + i]);
+					error("\n");
 				}
 
 				val_length -= copy_length;
@@ -247,7 +248,7 @@
 			dest[write_pos++] = value;
 
 			if (DEBUG_DCL_INFLATE)
-				fprintf(stderr, "\33[32;31m%02x \33[37;37m", value);
+				error("\33[32;31m%02x \33[37;37m", value);
 		}
 	}
 
@@ -343,14 +344,14 @@
 
 
 #ifdef _SCI_DECOMPRESS_DEBUG
-	fprintf(stderr, "Resource %i.%s encrypted with method SCI1%c/%hi at %.2f%%"
+	error("Resource %i.%s encrypted with method SCI1%c/%hi at %.2f%%"
 	        " ratio\n",
 	        result->number, sci_resource_type_suffixes[result->type],
 	        early ? 'e' : 'l',
 	        compressionMethod,
 	        (result->size == 0) ? -1.0 :
 	        (100.0 * compressedLength / result->size));
-	fprintf(stderr, "  compressedLength = 0x%hx, actualLength=0x%hx\n",
+	error("  compressedLength = 0x%hx, actualLength=0x%hx\n",
 	        compressedLength, result->size);
 #endif
 
@@ -418,8 +419,8 @@
 		break;
 
 	default:
-		fprintf(stderr, "Resource %s.%03hi: Compression method SCI1/%hi not "
-		        "supported!\n", sci_resource_types[result->type], result->number,
+		error("Resource %s.%03hi: Compression method SCI1/%hi not "
+		        "supported", sci_resource_types[result->type], result->number,
 		        compressionMethod);
 		free(result->data);
 		result->data = 0; /* So that we know that it didn't work */

Modified: scummvm/trunk/engines/sci/scicore/decompress11.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress11.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/scicore/decompress11.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -25,6 +25,7 @@
 
 /* Reads data from a resource file and stores the result in memory */
 
+#include "common/util.h"
 #include "sci/include/sci_memory.h"
 #include "sci/include/sciresource.h"
 
@@ -99,13 +100,13 @@
 	}
 
 #ifdef _SCI_DECOMPRESS_DEBUG
-	fprintf(stderr, "Resource %i.%s encrypted with method SCI1.1/%hi at %.2f%%"
+	error("Resource %i.%s encrypted with method SCI1.1/%hi at %.2f%%"
 	        " ratio\n",
 	        result->number, sci_resource_type_suffixes[result->type],
 	        compressionMethod,
 	        (result->size == 0) ? -1.0 :
 	        (100.0 * compressedLength / result->size));
-	fprintf(stderr, "  compressedLength = 0x%hx, actualLength=0x%hx\n",
+	error("  compressedLength = 0x%hx, actualLength=0x%hx\n",
 	        compressedLength, result->size);
 #endif
 
@@ -140,7 +141,7 @@
 
 	case 3:
 	case 4: /* NYI */
-		fprintf(stderr, "Resource %d.%s: Warning: compression type #%d not yet implemented\n",
+		error("Resource %d.%s: Warning: compression type #%d not yet implemented\n",
 		        result->number, sci_resource_type_suffixes[result->type], compressionMethod);
 		free(result->data);
 		result->data = NULL;
@@ -148,8 +149,8 @@
 		break;
 
 	default:
-		fprintf(stderr, "Resource %d.%s: Compression method SCI1/%hi not "
-		        "supported!\n", result->number, sci_resource_type_suffixes[result->type],
+		error("Resource %d.%s: Compression method SCI1/%hi not "
+		        "supported", result->number, sci_resource_type_suffixes[result->type],
 		        compressionMethod);
 		free(result->data);
 		result->data = NULL; /* So that we know that it didn't work */

Modified: scummvm/trunk/engines/sci/scicore/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource.cpp	2009-02-20 20:33:27 UTC (rev 38620)
+++ scummvm/trunk/engines/sci/scicore/resource.cpp	2009-02-20 20:39:02 UTC (rev 38621)
@@ -522,7 +522,7 @@
 			free(_resources);
 			_resources = NULL;
 		}
-		sciprintf("Resmgr: Could not retrieve a resource list!\n");
+		sciprintf("Resmgr: Could not retrieve a resource list");
 		_scir_free_resource_sources(mgr->_sources);
 		error("FIXME: Move this code to an init() method so that we can perform error handling");
 //		return NULL;
@@ -587,7 +587,7 @@
 			break;
 		default:
 			sciprintf("Resmgr: Warning: While autodetecting: Couldn't"
-			          " determine SCI version!\n");
+			          " determine SCI version");
 		}
 
 	if (!resource_error) {
@@ -678,7 +678,7 @@
 
 	mgr->memory_lru += res->size;
 #if (SCI_VERBOSE_RESMGR > 1)
-	fprintf(stderr, "Adding %s.%03d (%d bytes) to lru control: %d bytes total\n",
+	error("Adding %s.%03d (%d bytes) to lru control: %d bytes total\n",
 	        sci_resource_types[res->type], res->number, res->size,
 	        mgr->memory_lru);
 
@@ -694,7 +694,7 @@
 	resource_t *res = mgr->lru_first;
 
 	while (res) {
-		fprintf(stderr, "\t%s.%03d: %d bytes\n",
+		error("\t%s.%03d: %d bytes\n",
 		        sci_resource_types[res->type], res->number,
 		        res->size);
 		mem += res->size;
@@ -702,7 +702,7 @@
 		res = res->next;
 	}
 
-	fprintf(stderr, "Total: %d entries, %d bytes (mgr says %d)\n",
+	error("Total: %d entries, %d bytes (mgr says %d)\n",
 	        entries, mem, mgr->memory_lru);
 }
 
@@ -712,9 +712,9 @@
 	        && (!last_invulnerable || mgr->lru_first != mgr->lru_last)) {
 		resource_t *goner = mgr->lru_last;
 		if (!goner) {
-			fprintf(stderr, "Internal error: mgr->lru_last is NULL!\n");
-			fprintf(stderr, "LRU-mem= %d\n", mgr->memory_lru);
-			fprintf(stderr, "lru_first = %p\n", (void *)mgr->lru_first);
+			error("Internal error: mgr->lru_last is NULL");
+			error("LRU-mem= %d\n", mgr->memory_lru);
+			error("lru_first = %p\n", (void *)mgr->lru_first);
 			_scir_print_lru_list(mgr);
 		}
 
@@ -782,9 +782,9 @@
 scir_unlock_resource(ResourceManager *mgr, resource_t *res, int resnum, int restype) {
 	if (!res) {
 		if (restype >= ARRAYSIZE(sci_resource_types))
-			sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %03d.%03d!\n", restype, resnum);
+			sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %03d.%03d", restype, resnum);
 		else
-			sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %s.%03d!\n", sci_resource_types[restype], resnum);
+			sciprintf("Resmgr: Warning: Attempt to unlock non-existant resource %s.%03d", sci_resource_types[restype], resnum);

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list