[Scummvm-cvs-logs] CVS: tools descumm.cpp,1.82,1.83 extract.c,1.29,1.30 util.h,1.3,1.4

Max Horn fingolfin at users.sourceforge.net
Sun Nov 9 05:24:26 CET 2003


Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv9590

Modified Files:
	descumm.cpp extract.c util.h 
Log Message:
use error()

Index: descumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/descumm.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- descumm.cpp	11 Oct 2003 20:54:53 -0000	1.82
+++ descumm.cpp	9 Nov 2003 13:23:40 -0000	1.83
@@ -246,8 +246,7 @@
 	}
 
 	if (haltOnError && (s[0] == '?')) {
-		printf("ERROR: %s out of range, was %d\n", s, i);
-		exit(1);
+		error("%s out of range, was %d", s, i);
 	}
 
 	return s;
@@ -620,9 +619,7 @@
 		ExprStack = (char **)malloc(sizeof(char *) * 256);
 
 	if (NumInExprStack >= 256) {
-		printf("ERROR: Expression stack overflow!\n");
-		exit(0);
-
+		error("Expression stack overflow!");
 	}
 	m = NULL;
 	l = strlen(s);
@@ -1495,8 +1492,7 @@
 		break;
 	default:
 		/* Exit, this should never happen, only if my code is buggy */
-		printf("ERROR: Unknown IF code %x", opcode);
-		exit(1);
+		error("Unknown IF code %x", opcode);
 	}
 
 	if (opcode == 0x28 || opcode == 0xA8) {
@@ -1529,8 +1525,7 @@
 			break;
 		default:
 			/* Exit, this should never happen, only if my code is buggy */
-			printf("ERROR: Unknown IF code %x", opcode);
-			exit(1);
+			error("Unknown IF code %x", opcode);
 		}
 
 		get_var_or_byte(tmp2, opcode & 0x40);
@@ -1578,8 +1573,7 @@
 			break;
 		default:
 			/* Exit, this should never happen, only if my code is buggy */
-			printf("ERROR: Unknown IF code %x", opcode);
-			exit(1);
+			error("Unknown IF code %x", opcode);
 		}
 	}
 
@@ -1638,8 +1632,7 @@
 		break;											/* increment & decrement */
 	default:
 		/* Exit, this should never happen, only if my code is buggy */
-		printf("ERROR: Unknown VARSET code %x", opcode);
-		exit(1);
+		error("Unknown VARSET code %x", opcode);
 	}
 
 	buf = strecpy(buf, s);
@@ -2260,8 +2253,7 @@
 		break;
 
 	default:
-		printf("ERROR: Unknown opcode %.2X\n", opcode);
-		exit(1);
+		error("Unknown opcode %.2X", opcode);
 	}
 }
 
@@ -2979,8 +2971,7 @@
 
 	default:
 		if (haltOnError) {
-			printf("ERROR: Unknown opcode %.2X\n", opcode);
-			exit(1);
+			error("Unknown opcode %.2X", opcode);
 		}
 		sprintf(buf, "ERROR: Unknown opcode %.2X!", opcode);
 	}

Index: extract.c
===================================================================
RCS file: /cvsroot/scummvm/tools/extract.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- extract.c	9 Nov 2003 13:17:54 -0000	1.29
+++ extract.c	9 Nov 2003 13:23:40 -0000	1.30
@@ -262,8 +262,7 @@
 	} break;
 
 	default:
-		printf("Unknown chunk : %02x\n", id);
-		exit(-1);
+		error("Unknown chunk : %02x", id);
 		break;
 	}
 }

Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/tools/util.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- util.h	9 Nov 2003 13:17:54 -0000	1.3
+++ util.h	9 Nov 2003 13:23:40 -0000	1.4
@@ -80,7 +80,13 @@
 extern "C" {
 #endif
 
+#if defined(__GNUC__)
+extern void error(const char *s, ...) __attribute__((__noreturn__));
+#elif defined(_MSC_VER)
+extern void _declspec(noreturn) error(const char *s, ...);
+#else
 extern void error(const char *s, ...);
+#endif
 extern void warning(const char *s, ...);
 
 #if defined(__cplusplus)





More information about the Scummvm-git-logs mailing list