mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-02 17:03:13 +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();
|
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) {
|
switch(_type) {
|
||||||
case NUMBER:
|
case NUMBER:
|
||||||
return Common::String::format("%d", _value.number);
|
return Wage::toString(_value.number);
|
||||||
case STRING:
|
case STRING:
|
||||||
case TEXT_INPUT:
|
case TEXT_INPUT:
|
||||||
return *_value.string;
|
return Wage::toString(_value.string);
|
||||||
case OBJ:
|
case OBJ:
|
||||||
return Wage::toString(_value.obj);
|
return Wage::toString(_value.obj);
|
||||||
case CHR:
|
case CHR:
|
||||||
|
@ -119,7 +119,7 @@ private:
|
|||||||
delete _value.string;
|
delete _value.string;
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::String toString();
|
Common::String toString() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ScriptText {
|
struct ScriptText {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user