diff options
author | Eugene Sandulenko | 2016-07-09 17:11:33 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 8084989605853dd23e265a1f649e36611bdbfd99 (patch) | |
tree | 22d65d1f271190fe3354d6dc553b879e5f2e98a4 /engines/director/lingo/lingo.cpp | |
parent | bb8fd6a8990f8364fc6411ba98ec4716429c98d8 (diff) | |
download | scummvm-rg350-8084989605853dd23e265a1f649e36611bdbfd99.tar.gz scummvm-rg350-8084989605853dd23e265a1f649e36611bdbfd99.tar.bz2 scummvm-rg350-8084989605853dd23e265a1f649e36611bdbfd99.zip |
DIRECTOR: Lingo: Implemented chars() function and added more debug for type printing
Diffstat (limited to 'engines/director/lingo/lingo.cpp')
-rw-r--r-- | engines/director/lingo/lingo.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index fec6b645ea..9ec89ff0af 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -188,7 +188,7 @@ int Datum::toInt() { type = INT; break; default: - warning("Incorrect operation toInt() for type: %d", type); + warning("Incorrect operation toInt() for type: %s", type2str()); } return u.i; @@ -204,7 +204,7 @@ float Datum::toFloat() { // no-op break; default: - warning("Incorrect operation toFloat() for type: %d", type); + warning("Incorrect operation toFloat() for type: %s", type2str()); } return u.f; @@ -223,7 +223,7 @@ Common::String *Datum::toString() { delete s; s = u.s; default: - warning("Incorrect operation toInt() for type: %d", type); + warning("Incorrect operation toInt() for type: %s", type2str()); } u.s = s; @@ -232,4 +232,22 @@ Common::String *Datum::toString() { return u.s; } +const char *Datum::type2str() { + static char res[20]; + + switch (type) { + case INT: + return "INT"; + case FLOAT: + return "FLOAT"; + case STRING: + return "STRING"; + case CASTREF: + return "CASTREF"; + default: + snprintf(res, 20, "-- (%d) --", type); + return res; + } +} + } // End of namespace Director |