Port sc7 to C++.

This commit is contained in:
David Anderson 2014-08-22 00:04:48 -07:00
parent afd6009fda
commit 142fbaafdd
3 changed files with 7 additions and 2 deletions

View File

@ -88,7 +88,7 @@ binary.sources += [
'sc4.c', 'sc4.c',
'sc5.c', 'sc5.c',
'sc6.c', 'sc6.c',
'sc7.c', 'sc7.cpp',
'scexpand.cpp', 'scexpand.cpp',
'sci18n.cpp', 'sci18n.cpp',
'sclist.cpp', 'sclist.cpp',

View File

@ -41,12 +41,17 @@ unsigned char sequences_table[][2] = {
/*-*SCPACK end of pair table, do not change or remove this line */ /*-*SCPACK end of pair table, do not change or remove this line */
#define seqsize(o,p) (opcodes(o)+opargs(p)) #define seqsize(o,p) (opcodes(o)+opargs(p))
typedef struct {
const char *find;
const char *replace;
int savesize; /* number of bytes saved (in bytecode) */
} PRE_SEQUENCE;
typedef struct { typedef struct {
char *find; char *find;
char *replace; char *replace;
int savesize; /* number of bytes saved (in bytecode) */ int savesize; /* number of bytes saved (in bytecode) */
} SEQUENCE; } SEQUENCE;
static SEQUENCE sequences_cmp[] = { static PRE_SEQUENCE sequences_cmp[] = {
/* A very common sequence in four varieties /* A very common sequence in four varieties
* load.s.pri n1 load.s.pri n2 * load.s.pri n1 load.s.pri n2
* push.pri load.s.alt n1 * push.pri load.s.alt n1