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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon May 18 09:55:13 CEST 2009


Revision: 40675
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40675&view=rev
Author:   thebluegr
Date:     2009-05-18 07:55:13 +0000 (Mon, 18 May 2009)

Log Message:
-----------
Changed errors to be fatal, as most of them are fatal conditions. Some of them have been changed to warnings for now, as they occur in certain games (e.g. SQ4 floppy, SQ4 CD and KQ5 CD)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kdebug.cpp
    scummvm/trunk/engines/sci/engine/kdebug.h
    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/kstring.cpp
    scummvm/trunk/engines/sci/engine/stringfrag.cpp

Modified: scummvm/trunk/engines/sci/engine/kdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kdebug.cpp	2009-05-18 06:34:23 UTC (rev 40674)
+++ scummvm/trunk/engines/sci/engine/kdebug.cpp	2009-05-18 07:55:13 UTC (rev 40675)
@@ -36,10 +36,7 @@
 void _SCIkwarn(EngineState *s, const char *file, int line, int area, const char *format, ...) {
 	va_list args;
 
-	if (area == SCIkERROR_NR)
-		fprintf(stderr, "ERROR: ");
-	else
-		fprintf(stderr, "Warning: ");
+	fprintf(stderr, "Warning: ");
 
 	va_start(args, format);
 	vfprintf(stderr, format, args);

Modified: scummvm/trunk/engines/sci/engine/kdebug.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kdebug.h	2009-05-18 06:34:23 UTC (rev 40674)
+++ scummvm/trunk/engines/sci/engine/kdebug.h	2009-05-18 07:55:13 UTC (rev 40675)
@@ -34,7 +34,6 @@
 
 #define SCIk_DEBUG_MODES 17
 
-#define SCIkERROR_NR -2
 #define SCIkWARNING_NR -1
 #define SCIkFUNCCHK_NR 5
 #define SCIkSOUNDCHK_NR 7
@@ -43,7 +42,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/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-05-18 06:34:23 UTC (rev 40674)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-05-18 07:55:13 UTC (rev 40675)
@@ -241,7 +241,7 @@
 	HunkTable *ht = (HunkTable *)GET_SEGMENT(*s->seg_manager, handle.segment, MEM_OBJ_HUNK);
 
 	if (!ht || !ENTRY_IS_VALID(ht, handle.offset)) {
-		SCIkwarn(SCIkERROR, "Error: kmem() with invalid handle\n");
+		error("Error: kmem() with invalid handle\n");
 		return NULL;
 	}
 
@@ -404,7 +404,7 @@
 	switch (UKPV(0)) {
 	case K_MEMORY_ALLOCATE_CRITICAL :
 		if (!s->seg_manager->allocDynmem(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;
@@ -414,7 +414,7 @@
 		break;
 	case K_MEMORY_FREE :
 		if (s->seg_manager->freeDynmem(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"!\n", PRINT_REG(argv[1]));
 		}
 		break;
 	case K_MEMORY_MEMCPY : {
@@ -439,7 +439,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"!\n", PRINT_REG(argv[1]));
 			return s->r_acc;
 		}
 		if (s->seg_manager->_heap[argv[1].segment]->getType() == MEM_OBJ_LOCALS)
@@ -452,7 +452,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"!\n", PRINT_REG(argv[1]));
 			return s->r_acc;
 		}
 
@@ -460,7 +460,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"!\n", PRINT_REG(argv[2]), PRINT_REG(argv[1]));
 				return s->r_acc;
 				WRITE_LE_UINT16(ref, argv[2].offset); // ???
 			}
@@ -763,12 +763,12 @@
 	void *retval = s->seg_manager->dereference(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!\n", 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!\n", PRINT_REG(pointer));
 		return NULL;
 	}
 	return retval;

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2009-05-18 06:34:23 UTC (rev 40674)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2009-05-18 07:55:13 UTC (rev 40675)
@@ -408,7 +408,8 @@
 		break;
 
 	default:
-		SCIkwarn(SCIkERROR, "Unknown DeviceInfo() sub-command: %d\n", mode);
+		// TODO: Not all sub-commands are handled. E.g. KQ5CD calls sub-command 5
+		warning("Unknown DeviceInfo() sub-command: %d\n", mode);
 		break;
 	}
 
@@ -848,7 +849,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-05-18 06:34:23 UTC (rev 40674)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-05-18 07:55:13 UTC (rev 40675)
@@ -98,7 +98,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 "\"!\n"); \
 			vm_handle_fatal_error(s, __LINE__, __FILE__); \
 		} \
 	}\
@@ -107,7 +107,7 @@
 #define ASSERT(x) { \
 	int val = !!(x); \
 	if (!val) { \
-		SCIkwarn(SCIkERROR, "Fatal error condition on \"" #x "\"!\n"); \
+		error("Fatal error condition on \"" #x "\"!\n"); \
 		BREAKPOINT(); \
 		vm_handle_fatal_error(s, __LINE__, __FILE__); \
 	} \
@@ -226,7 +226,7 @@
 	while (port_nr > 2 && !(s->port->_flags & GFXW_FLAG_IMMUNE_TO_SNAPSHOTS) && (gfxw_widget_matches_snapshot(*ptr, s->port))) {
 		// This shouldn't ever happen, actually, since windows (ports w/ ID > 2) should all be immune
 		GfxPort *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!\n", s->port->_ID);
 		port_nr--;
 		if (newport)
 			s->port = newport;
@@ -240,7 +240,7 @@
 		} while (parent && (gfxw_widget_matches_snapshot(*ptr, parent)));
 
 		if (!parent) {
-			SCIkwarn(SCIkERROR, "Attempted widget mass destruction by a snapshot\n");
+			error("Attempted widget mass destruction by a snapshot\n");
 			BREAKPOINT();
 		}
 
@@ -249,7 +249,7 @@
 
 
 	if (!ptr) {
-		SCIkwarn(SCIkERROR, "Attempt to restore invalid snaphot with handle %04x!\n", handle);
+		error("Attempt to restore invalid snaphot with handle %04x!\n", handle);
 		return;
 	}
 
@@ -269,7 +269,7 @@
 	else if (color < s->gfx_state->gfxResMan->getColorCount())
 		return s->gfx_state->gfxResMan->getColor(color);
 	else {
-		SCIkwarn(SCIkERROR, "Color index %d out of bounds for pic %d (%d max)", color, s->gfx_state->pic_nr, s->gfx_state->gfxResMan->getColorCount());
+		error("Color index %d out of bounds for pic %d (%d max)", color, s->gfx_state->pic_nr, s->gfx_state->gfxResMan->getColorCount());
 		BREAKPOINT();
 		return PaletteEntry(0,0,0); 
 	}
@@ -343,7 +343,7 @@
 		break;
 	}
 	default :
-		SCIkwarn(SCIkERROR, "kSetCursor: Unhandled case: %d arguments given!\n", argc);
+		error("kSetCursor: Unhandled case: %d arguments given!\n", argc);
 		break;
 	}
 	return s->r_acc;
@@ -698,7 +698,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;
@@ -886,7 +886,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);
@@ -904,7 +904,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);
@@ -916,7 +916,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;
 	}
 
@@ -935,7 +935,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;
 	}
 
@@ -1815,7 +1815,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?
@@ -1852,7 +1852,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) == 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!\n", widget->_ID, widget->_subID);
 							BREAKPOINT();
 						}
 
@@ -1970,7 +1970,7 @@
 	GfxDynView *widget;
 
 	if (!*widget_list) {
-		SCIkwarn(SCIkERROR, "make_view_list with widget_list == ()\n");
+		error("make_view_list with widget_list == ()\n");
 		BREAKPOINT();
 	};
 
@@ -1979,7 +1979,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!\n");
 		BREAKPOINT();
 	}
 
@@ -2295,7 +2295,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) {
@@ -2359,7 +2359,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;
 		}
 
@@ -2388,7 +2388,7 @@
 		break;
 	}
 	default :
-		SCIkwarn(SCIkERROR, "SetPort was called with %d parameters\n", argc);
+		error("SetPort was called with %d parameters\n", argc);
 		break;
 	}
 
@@ -2406,13 +2406,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;
 	}
 
@@ -2434,7 +2434,7 @@
 
 	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;
 	}
 
@@ -2595,7 +2595,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'!\n");
 		return;
 	}
 
@@ -3162,7 +3162,7 @@
 	}
 
 	if (!text) {
-		SCIkdebug(SCIkERROR, "Display with invalid reference "PREG"!\n", PRINT_REG(textp));
+		error("Display with invalid reference "PREG"!\n", PRINT_REG(textp));
 		return NULL_REG;
 	}
 
@@ -3286,7 +3286,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!\n");
 		return NULL_REG;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/klists.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/klists.cpp	2009-05-18 06:34:23 UTC (rev 40674)
+++ scummvm/trunk/engines/sci/engine/klists.cpp	2009-05-18 07:55:13 UTC (rev 40675)
@@ -38,7 +38,7 @@
 		// seem to have any apparent ill-effects, though, so it's been changed to non-fatal, for now
 		//sciprintf("%s, L%d: Attempt to use non-node "PREG" as list node\n", __FILE__, __LINE__, PRINT_REG(addr));
 		//script_debug_flag = script_error_flag = 1;
-		SCIkwarn(SCIkERROR, "%s, L%d: Attempt to use non-node "PREG" as list node\n", __FILE__, __LINE__, PRINT_REG(addr));
+		warning("%s, L%d: Attempt to use non-node "PREG" as list node\n", __FILE__, __LINE__, PRINT_REG(addr));
 		return NULL;
 	}
 
@@ -150,12 +150,13 @@
 	List *l = LOOKUP_LIST(argv[0]);
 
 	if (!l) {
-		SCIkwarn(SCIkERROR, "Attempt to dispose non-list at "PREG"!\n", PRINT_REG(argv[0]));
+		// FIXME: This should be an error, but it's turned to a warning for now
+		warning("Attempt to dispose non-list at "PREG"!\n", 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!\n", PRINT_REG(argv[0]));
 
 /*	if (!IS_NULL_REG(l->first)) {
 		reg_t n_addr = l->first;
@@ -202,7 +203,7 @@
 	List *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!\n", PRINT_REG(argv[0]));
 
 	if (l)
 		return l->first;
@@ -214,7 +215,7 @@
 	List *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!\n", PRINT_REG(argv[0]));
 
 	if (l)
 		return l->last;
@@ -226,7 +227,7 @@
 	List *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!\n", PRINT_REG(argv[0]));
 
 	return make_reg(0, ((l) ? IS_NULL_REG(l->first) : 0));
 }
@@ -237,10 +238,11 @@
 
 	SCIkdebug(SCIkNODES, "Adding node "PREG" to end of list "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
 
+	// FIXME: This should be an error, but it's turned to a warning for now
 	if (!new_n)
-		SCIkwarn(SCIkERROR, "Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
+		warning("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!\n", PRINT_REG(listbase));
 
 	new_n->succ = l->first;
 	new_n->pred = NULL_REG;
@@ -260,10 +262,11 @@
 
 	SCIkdebug(SCIkNODES, "Adding node "PREG" to end of list "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
 
+	// FIXME: This should be an error, but it's turned to a warning for now
 	if (!new_n)
-		SCIkwarn(SCIkERROR, "Attempt to add non-node ("PREG") to list at "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
+		warning("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!\n", PRINT_REG(listbase));
 
 	new_n->succ = NULL_REG;
 	new_n->pred = l->last;
@@ -280,7 +283,7 @@
 reg_t kNextNode(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	Node *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!\n", PRINT_REG(argv[0]));
 		script_error_flag = script_debug_flag = 0;
 		return NULL_REG;
 	}
@@ -291,7 +294,7 @@
 reg_t kPrevNode(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	Node *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!\n", PRINT_REG(argv[0]));
 
 	return n->pred;
 }
@@ -299,7 +302,7 @@
 reg_t kNodeValue(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	Node *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!\n", PRINT_REG(argv[0]));
 		script_debug_flag = script_error_flag = 0;
 		return NULL_REG;
 	}
@@ -318,10 +321,11 @@
 	Node *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!\n", PRINT_REG(argv[0]));
 
+	// FIXME: This should be an error, but it's turned to a warning for now
 	if (!newnode) {
-		SCIkwarn(SCIkERROR, "New 'node' "PREG" is not a node!\n", argv[1], argv[2]);
+		warning("New 'node' "PREG" is not a node!\n", argv[1], argv[2]);
 		return NULL_REG;
 	}
 
@@ -364,7 +368,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!\n", 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-05-18 06:34:23 UTC (rev 40674)
+++ scummvm/trunk/engines/sci/engine/kmovement.cpp	2009-05-18 07:55:13 UTC (rev 40675)
@@ -426,7 +426,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;
 	}
 
@@ -435,7 +435,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", PRINT_REG(client), PRINT_REG(avoider));
 		return NULL_REG;
 	}
@@ -466,7 +466,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", PRINT_REG(client), PRINT_REG(avoider));
 				return NULL_REG;
 			}
@@ -500,7 +500,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", 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-05-18 06:34:23 UTC (rev 40674)
+++ scummvm/trunk/engines/sci/engine/kscripts.cpp	2009-05-18 07:55:13 UTC (rev 40675)
@@ -74,7 +74,7 @@
 	slc_type = lookup_selector(s, object, selector_id, NULL, &address);
 
 	if (slc_type == kSelectorNone) {
-		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->_selectorNames[selector_id].c_str(), PRINT_REG(object), fname, line);
 		if (noinvalid == 0)
 			KERNEL_OOPS("Not recoverable: VM was halted\n");
@@ -163,7 +163,7 @@
 	Clone *clone_obj; // same as Object*
 
 	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;
 	}
 
@@ -172,7 +172,7 @@
 	clone_obj = s->seg_manager->alloc_Clone(&clone_addr);
 
 	if (!clone_obj) {
-		SCIkwarn(SCIkERROR, "Cloning "PREG" failed-- internal error!\n", PRINT_REG(parent_addr));
+		error("Cloning "PREG" failed-- internal error!\n", PRINT_REG(parent_addr));
 		return NULL_REG;
 	}
 
@@ -198,7 +198,7 @@
 	uint16 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;
 	}
@@ -246,12 +246,13 @@
 	scr = s->seg_manager->getScript(scriptid);
 
 	if (!scr->exports_nr) {
-		SCIkdebug(SCIkERROR, "Script 0x%x does not have a dispatch table\n", script);
+		// FIXME: Is this fatal? This occurs in SQ4CD
+		warning("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/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-05-18 06:34:23 UTC (rev 40674)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-05-18 07:55:13 UTC (rev 40675)
@@ -34,7 +34,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;\
 	}
 
@@ -51,7 +51,7 @@
 		textres = s->resmgr->findResource(kResourceTypeText, 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 */
 		}
 
@@ -65,7 +65,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;
 		}
 
@@ -211,7 +211,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!\n",
 					         script, synonyms_nr);
 					/* We used to reset the corrupted value here. I really don't think it's appropriate.
 					 * Lars */
@@ -706,7 +706,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/stringfrag.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/stringfrag.cpp	2009-05-18 06:34:23 UTC (rev 40674)
+++ scummvm/trunk/engines/sci/engine/stringfrag.cpp	2009-05-18 07:55:13 UTC (rev 40675)
@@ -112,14 +112,14 @@
 	int result = 0;
 
 	if (buffer == NULL) {
-//	SCIkwarn(SCIkERROR, "Error: Invalid stringfrag handle");
+//	error("Error: Invalid stringfrag handle");
 		return 0;
 	}
 
 	while ((buffer->offset & 0xff00) != 0 &&
 	       (buffer->offset & 0x00ff) != 0) {
 		if (buffer->segment != STRINGFRAG_SEGMENT) {
-//	    SCIkwarn(SCIkERROR, "Error: Invalid stringfrag handle");
+//	    error("Error: Invalid stringfrag handle");
 			return 0;
 		}
 
@@ -128,7 +128,7 @@
 	}
 
 	if (buffer->segment != STRINGFRAG_SEGMENT) {
-		SCIkwarn(SCIkERROR, "Error: Invalid stringfrag handle");
+		error("Error: Invalid stringfrag handle");
 		return 0;
 	}
 


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