[Scummvm-cvs-logs] SF.net SVN: scummvm:[49578] scummvm/trunk/engines/sci/engine
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Thu Jun 10 17:25:37 CEST 2010
Revision: 49578
http://scummvm.svn.sourceforge.net/scummvm/?rev=49578&view=rev
Author: fingolfin
Date: 2010-06-10 15:25:36 +0000 (Thu, 10 Jun 2010)
Log Message:
-----------
SCI: Cleanup kernel signature code a bit.
* Moved KSIG_SPEC_* from kernel.h to kernel.cpp
* Clarified the comment on KSIG_SPEC_* a bit
* Changed the other KSIG_ #defines into an enum
* Removed KSIG_TERMINATOR and KSIG_SPEC_ARITMETIC (sic)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kernel.cpp
scummvm/trunk/engines/sci/engine/kernel.h
Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp 2010-06-10 15:25:18 UTC (rev 49577)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp 2010-06-10 15:25:36 UTC (rev 49578)
@@ -33,6 +33,26 @@
namespace Sci {
+// Uncompiled kernel signatures are formed from a string of letters.
+// each corresponding to a type of a parameter (see below).
+// Use small letters to indicate end of sum type.
+// Use capital letters for sum types, e.g.
+// "LNoLr" for a function which takes two arguments:
+// (1) list, node or object
+// (2) list or ref
+#define KSIG_SPEC_LIST 'l'
+#define KSIG_SPEC_NODE 'n'
+#define KSIG_SPEC_OBJECT 'o'
+#define KSIG_SPEC_REF 'r' // Said Specs and strings
+#define KSIG_SPEC_ARITHMETIC 'i'
+#define KSIG_SPEC_NULL 'z'
+#define KSIG_SPEC_ANY '.'
+#define KSIG_SPEC_ELLIPSIS '*' // Arbitrarily more TYPED arguments
+
+#define KSIG_SPEC_SUM_DONE ('a' - 'A')
+
+
+
// Default kernel name table
#define SCI_KNAMES_DEFAULT_ENTRIES_NR 0x89
@@ -538,8 +558,7 @@
break;
default:
- error("INTERNAL ERROR when compiling kernel function signature '%s': (%02x) not understood (aka"
- " '%c')\n", *s, c, c);
+ error("ERROR compiling kernel function signature '%s': (%02x / '%c') not understood", *s, c, c);
}
} while (*src && (*src == KSIG_SPEC_ELLIPSIS || (c < 'a' && c != KSIG_SPEC_ANY)));
Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h 2010-06-10 15:25:18 UTC (rev 49577)
+++ scummvm/trunk/engines/sci/engine/kernel.h 2010-06-10 15:25:36 UTC (rev 49578)
@@ -95,36 +95,20 @@
//#define DISABLE_VALIDATIONS // enable to stop validation checks
// ---- Kernel signatures -----------------------------------------------------
-#define KSIG_TERMINATOR 0
-// Uncompiled signatures
-#define KSIG_SPEC_ARITMETIC 'i'
-#define KSIG_SPEC_LIST 'l'
-#define KSIG_SPEC_NODE 'n'
-#define KSIG_SPEC_OBJECT 'o'
-#define KSIG_SPEC_REF 'r' // Said Specs and strings
-#define KSIG_SPEC_ARITHMETIC 'i'
-#define KSIG_SPEC_NULL 'z'
-#define KSIG_SPEC_ANY '.'
-#define KSIG_SPEC_ELLIPSIS '*' // Arbitrarily more TYPED arguments
-#define KSIG_SPEC_SUM_DONE ('a' - 'A') // Use small letters to indicate end of sum type
-/* Use capital letters for sum types, e.g.
-** "LNoLr" for a function which takes two arguments:
-** (1) list, node or object
-** (2) list or ref
-*/
-
// Compiled signatures
-#define KSIG_LIST 0x01
-#define KSIG_NODE 0x02
-#define KSIG_OBJECT 0x04
-#define KSIG_REF 0x08
-#define KSIG_ARITHMETIC 0x10
+enum {
+ KSIG_LIST = 0x01,
+ KSIG_NODE = 0x02,
+ KSIG_OBJECT = 0x04,
+ KSIG_REF = 0x08,
+ KSIG_ARITHMETIC = 0x10,
+ KSIG_NULL = 0x40,
+ KSIG_ANY = 0x5f,
+ KSIG_ELLIPSIS = 0x80
+};
-#define KSIG_NULL 0x40
-#define KSIG_ANY 0x5f
-#define KSIG_ELLIPSIS 0x80
// ----------------------------------------------------------------------------
/* Generic description: */
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