aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/objects.cpp
diff options
context:
space:
mode:
authorColin Snover2017-12-19 19:27:13 -0600
committerEugene Sandulenko2018-08-18 16:30:05 +0200
commit481b608c51858d0b6afc3cfb461664fc9575c6a0 (patch)
tree984187ecdb5246049f02a7e46aa802739fedd93e /engines/parallaction/objects.cpp
parentbc3c8bd8d251b7a0631e1993e6365719382eacf6 (diff)
downloadscummvm-rg350-481b608c51858d0b6afc3cfb461664fc9575c6a0.tar.gz
scummvm-rg350-481b608c51858d0b6afc3cfb461664fc9575c6a0.tar.bz2
scummvm-rg350-481b608c51858d0b6afc3cfb461664fc9575c6a0.zip
PARALLACTION: Replace use of strdup with Common::String & malloc
Diffstat (limited to 'engines/parallaction/objects.cpp')
-rw-r--r--engines/parallaction/objects.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index a6ca3fcd2b..9bcd344f06 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -36,7 +36,6 @@ Command::Command() {
_valid = false;
_flags = 0;
- _string = 0;
_callable = 0;
_object = 0;
_counterValue = 0;
@@ -44,26 +43,17 @@ Command::Command() {
_zeta1 = 0;
_zeta2 = 0;
_characterId = 0;
- _string2 = 0;
_musicCommand = 0;
_musicParm = 0;
}
-Command::~Command() {
- free(_string);
- free(_string2);
-}
-
-
Animation::Animation() {
gfxobj = NULL;
- _scriptName = 0;
_frame = 0;
_z = 0;
}
Animation::~Animation() {
- free(_scriptName);
if (gfxobj) {
gfxobj->release();
}
@@ -307,16 +297,9 @@ Instruction::Instruction() {
_endif = 0;
// BRA specific
- _text = 0;
- _text2 = 0;
_y = 0;
}
-Instruction::~Instruction() {
- free(_text);
- free(_text2);
-}
-
int16 ScriptVar::getValue() {
if (_flags & kParaImmediate) {
@@ -415,8 +398,9 @@ void Table::addData(const char* s) {
if (!(_used < _size))
error("Table overflow");
- _data[_used++] = strdup(s);
-
+ char *data = (char *)malloc(strlen(s) + 1);
+ strcpy(data, s);
+ _data[_used++] = data;
}
uint16 Table::lookup(const char* s) {