mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 11:04:44 +00:00
WAGE: Handle null strings in toString and improve consistency
This commit is contained in:
parent
f35cb961f2
commit
c6c39d5578
@ -63,13 +63,24 @@ static Common::String toString(const Designed *d) {
|
||||
return d->toString();
|
||||
}
|
||||
|
||||
Common::String Script::Operand::toString() {
|
||||
static Common::String toString(const Common::String *d) {
|
||||
if (!d)
|
||||
return "<NULL>";
|
||||
else
|
||||
return *d;
|
||||
}
|
||||
|
||||
static Common::String toString(int16 val) {
|
||||
return Common::String::format("%d", val);
|
||||
}
|
||||
|
||||
Common::String Script::Operand::toString() const {
|
||||
switch(_type) {
|
||||
case NUMBER:
|
||||
return Common::String::format("%d", _value.number);
|
||||
return Wage::toString(_value.number);
|
||||
case STRING:
|
||||
case TEXT_INPUT:
|
||||
return *_value.string;
|
||||
return Wage::toString(_value.string);
|
||||
case OBJ:
|
||||
return Wage::toString(_value.obj);
|
||||
case CHR:
|
||||
|
@ -119,7 +119,7 @@ private:
|
||||
delete _value.string;
|
||||
}
|
||||
|
||||
Common::String toString();
|
||||
Common::String toString() const;
|
||||
};
|
||||
|
||||
struct ScriptText {
|
||||
|
Loading…
x
Reference in New Issue
Block a user