diff options
author | Eugene Sandulenko | 2016-07-09 12:28:17 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 458d1e5f78372b39768c21b20b99a6eb498a4029 (patch) | |
tree | a0eeba7abe55d95ff4bf24093a3d4aefec37ef64 /engines | |
parent | caa29882933467f42d3b6235001dc2e37d6e6495 (diff) | |
download | scummvm-rg350-458d1e5f78372b39768c21b20b99a6eb498a4029.tar.gz scummvm-rg350-458d1e5f78372b39768c21b20b99a6eb498a4029.tar.bz2 scummvm-rg350-458d1e5f78372b39768c21b20b99a6eb498a4029.zip |
DIRECTOR: Lingo: Aligned Datum and Symbol union member names
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo-code.cpp | 26 | ||||
-rw-r--r-- | engines/director/lingo/lingo-codegen.cpp | 4 | ||||
-rw-r--r-- | engines/director/lingo/lingo.cpp | 2 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 8 |
4 files changed, 20 insertions, 20 deletions
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index 2f0e554880..a532764b14 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -89,7 +89,7 @@ void Lingo::c_printtop(void) { if (d.u.sym->name) warning("var: %s", d.u.sym->name); else - warning("Nameless var. val: %d", d.u.sym->u.val); + warning("Nameless var. val: %d", d.u.sym->u.i); } break; case STRING: @@ -136,7 +136,7 @@ void Lingo::c_varpush() { d.u.sym = g_lingo->lookupVar(name); if (d.u.sym->type == CASTREF) { d.type = INT; - int val = d.u.sym->u.val; + int val = d.u.sym->u.i; delete d.u.sym; @@ -167,16 +167,16 @@ void Lingo::c_assign() { } if (d1.u.sym->type == STRING) // Free memory if needed - delete d1.u.sym->u.str; + delete d1.u.sym->u.s; if (d2.type == INT) - d1.u.sym->u.val = d2.u.i; + d1.u.sym->u.i = d2.u.i; else if (d2.type == FLOAT) - d1.u.sym->u.fval = d2.u.f; + d1.u.sym->u.f = d2.u.f; else if (d2.type == STRING) - d1.u.sym->u.str = new Common::String(*d2.u.s); + d1.u.sym->u.s = new Common::String(*d2.u.s); - d1.u.sym->type = d2.type; + d1.u.sym->type = d2.type; g_lingo->push(d1); } @@ -209,11 +209,11 @@ void Lingo::c_eval() { d.type = d.u.sym->type; if (d.u.sym->type == INT) - d.u.i = d.u.sym->u.val; + d.u.i = d.u.sym->u.i; else if (d.u.sym->type == FLOAT) - d.u.f = d.u.sym->u.fval; + d.u.f = d.u.sym->u.f; else if (d.u.sym->type == STRING) - d.u.s = new Common::String(*d.u.sym->u.str); + d.u.s = new Common::String(*d.u.sym->u.s); g_lingo->push(d); } @@ -419,7 +419,7 @@ void Lingo::c_repeatwithcode(void) { g_lingo->execute(init); /* condition */ d = g_lingo->pop(); d.toInt(); - counter->u.val = d.u.i; + counter->u.i = d.u.i; counter->type = INT; while (true) { @@ -427,12 +427,12 @@ void Lingo::c_repeatwithcode(void) { if (g_lingo->_returning) break; - counter->u.val += inc; + counter->u.i += inc; g_lingo->execute(finish); /* condition */ d = g_lingo->pop(); d.toInt(); - if (counter->u.val == d.u.i + inc) + if (counter->u.i == d.u.i + inc) break; } diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index 10589b1257..771cfc5320 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -81,7 +81,7 @@ Symbol *Lingo::lookupVar(const char *name, bool create, bool putInGlobalList) { sym = new Symbol; sym->type = CASTREF; - sym->u.val = val; + sym->u.i = val; return sym; } @@ -96,7 +96,7 @@ Symbol *Lingo::lookupVar(const char *name, bool create, bool putInGlobalList) { sym->name = (char *)calloc(strlen(name) + 1, 1); Common::strlcpy(sym->name, name, strlen(name) + 1); sym->type = VOID; - sym->u.val = 0; + sym->u.i = 0; (*_localvars)[name] = sym; diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 1ab0e89dd6..b24c55b57d 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -70,7 +70,7 @@ struct EventHandlerType { Symbol::Symbol() { name = NULL; type = VOID; - u.str = NULL; + u.s = NULL; nargs = 0; global = false; } diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index f6aa565327..5320d880ea 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -81,10 +81,10 @@ struct Symbol { /* symbol table entry */ char *name; int type; union { - int val; /* VAR */ - float fval; /* FLOAT */ - ScriptData *defn; /* FUNCTION, PROCEDURE */ - Common::String *str; /* STRING */ + int i; /* VAR */ + float f; /* FLOAT */ + ScriptData *defn; /* FUNCTION, PROCEDURE */ + Common::String *s; /* STRING */ } u; int nargs; bool global; |