aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorAndrei Prykhodko2018-06-30 23:49:27 +0300
committerAndrei Prykhodko2018-06-30 23:49:27 +0300
commit0a6993a09b9efd9cd17243e51aa64522bec78b4e (patch)
tree1344494d5961dc97e6149e8cd3eba543df980a0a /engines
parent22f6c6639381adf3dfad45ba1cf430dd182e6322 (diff)
downloadscummvm-rg350-0a6993a09b9efd9cd17243e51aa64522bec78b4e.tar.gz
scummvm-rg350-0a6993a09b9efd9cd17243e51aa64522bec78b4e.tar.bz2
scummvm-rg350-0a6993a09b9efd9cd17243e51aa64522bec78b4e.zip
PINK: fixed uninitialized fields
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/cursor_mgr.cpp5
-rw-r--r--engines/pink/file.h1
-rw-r--r--engines/pink/objects/actions/action_play_with_sfx.h4
-rw-r--r--engines/pink/objects/actors/lead_actor.cpp7
-rw-r--r--engines/pink/objects/inventory.cpp4
-rw-r--r--engines/pink/objects/pages/game_page.cpp4
-rw-r--r--engines/pink/objects/sequences/seq_timer.cpp3
-rw-r--r--engines/pink/objects/sequences/sequence.h3
-rw-r--r--engines/pink/objects/sequences/sequence_item.h3
-rw-r--r--engines/pink/objects/walk/walk_mgr.cpp3
-rw-r--r--engines/pink/pda_mgr.cpp4
-rw-r--r--engines/pink/pink.cpp10
12 files changed, 33 insertions, 18 deletions
diff --git a/engines/pink/cursor_mgr.cpp b/engines/pink/cursor_mgr.cpp
index d11d3cea07..368d645cfc 100644
--- a/engines/pink/cursor_mgr.cpp
+++ b/engines/pink/cursor_mgr.cpp
@@ -28,8 +28,9 @@
namespace Pink {
CursorMgr::CursorMgr(PinkEngine *game, Page *page)
- : _actor(nullptr), _page(page), _game(game),
- _isPlayingAnimation(0), _firstFrameIndex(0) {}
+ : _actor(nullptr), _page(page), _game(game),
+ _time(0), _isPlayingAnimation(false),
+ _isSecondFrame(false), _firstFrameIndex(0) {}
void CursorMgr::setCursor(uint index, const Common::Point point, const Common::String &itemName) {
switch (index) {
diff --git a/engines/pink/file.h b/engines/pink/file.h
index 611ef31391..92abb60c5c 100644
--- a/engines/pink/file.h
+++ b/engines/pink/file.h
@@ -76,6 +76,7 @@ private:
class BroFile : public Common::File {
public:
+ BroFile() : _timestamp(0) {}
bool open(const Common::String &name);
uint32 getTimestamp() { return _timestamp; }
diff --git a/engines/pink/objects/actions/action_play_with_sfx.h b/engines/pink/objects/actions/action_play_with_sfx.h
index f357c8ddb4..64a19d46cb 100644
--- a/engines/pink/objects/actions/action_play_with_sfx.h
+++ b/engines/pink/objects/actions/action_play_with_sfx.h
@@ -32,6 +32,8 @@ class ActionSfx;
class ActionPlayWithSfx : public ActionPlay {
public:
+ ActionPlayWithSfx()
+ : _isLoop(false) {}
~ActionPlayWithSfx() override;
void deserialize(Archive &archive) override;
@@ -45,7 +47,7 @@ protected:
private:
Array<ActionSfx *> _sfxArray;
- uint32 _isLoop;
+ bool _isLoop;
};
class Page;
diff --git a/engines/pink/objects/actors/lead_actor.cpp b/engines/pink/objects/actors/lead_actor.cpp
index 61d367e786..357d739a40 100644
--- a/engines/pink/objects/actors/lead_actor.cpp
+++ b/engines/pink/objects/actors/lead_actor.cpp
@@ -33,9 +33,10 @@
namespace Pink {
LeadActor::LeadActor()
- : _state(kReady), _nextState(kReady), _isHaveItem(false),
- _recipient(nullptr), _cursorMgr(nullptr), _walkMgr(nullptr),
- _sequencer(nullptr), _audioInfoMgr(this) {}
+ : _state(kReady), _nextState(kUndefined), _stateBeforeInventory(kUndefined),
+ _stateBeforePDA(kUndefined), _isHaveItem(false), _recipient(nullptr),
+ _cursorMgr(nullptr), _walkMgr(nullptr), _sequencer(nullptr),
+ _audioInfoMgr(this) {}
void LeadActor::deserialize(Archive &archive) {
_state = kReady;
diff --git a/engines/pink/objects/inventory.cpp b/engines/pink/objects/inventory.cpp
index b4c1f7db56..c99e6c6d9c 100644
--- a/engines/pink/objects/inventory.cpp
+++ b/engines/pink/objects/inventory.cpp
@@ -33,7 +33,9 @@
namespace Pink {
InventoryMgr::InventoryMgr()
- : _lead(nullptr), _item(nullptr), _isClickedOnItem(false) {}
+ : _lead(nullptr), _window(nullptr), _itemActor(nullptr),
+ _rightArrow(nullptr), _leftArrow(nullptr), _state(kIdle),
+ _isClickedOnItem(false) {}
void InventoryItem::deserialize(Archive &archive) {
NamedObject::deserialize(archive);
diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp
index 1157d96f4e..a45fca7b7f 100644
--- a/engines/pink/objects/pages/game_page.cpp
+++ b/engines/pink/objects/pages/game_page.cpp
@@ -31,8 +31,8 @@
namespace Pink {
GamePage::GamePage()
- : _cursorMgr(nullptr), _walkMgr(nullptr), _sequencer(nullptr),
- _isLoaded(false), _memFile(nullptr) {}
+ : _module(nullptr), _cursorMgr(nullptr), _walkMgr(nullptr),
+ _sequencer(nullptr), _isLoaded(false), _memFile(nullptr) {}
GamePage::~GamePage() {
clear();
diff --git a/engines/pink/objects/sequences/seq_timer.cpp b/engines/pink/objects/sequences/seq_timer.cpp
index c1eff0765f..5342dbff4a 100644
--- a/engines/pink/objects/sequences/seq_timer.cpp
+++ b/engines/pink/objects/sequences/seq_timer.cpp
@@ -32,7 +32,8 @@
namespace Pink {
SeqTimer::SeqTimer()
- : _updatesToMessage(0) {}
+ : _sequencer(nullptr), _updatesToMessage(0), _period(0),
+ _range(0) {}
void SeqTimer::deserialize(Archive &archive) {
_actor = archive.readString();
diff --git a/engines/pink/objects/sequences/sequence.h b/engines/pink/objects/sequences/sequence.h
index 7ebb95ce4c..b07e7508fd 100644
--- a/engines/pink/objects/sequences/sequence.h
+++ b/engines/pink/objects/sequences/sequence.h
@@ -72,6 +72,9 @@ protected:
class SequenceAudio : public Sequence {
public:
+ SequenceAudio()
+ : _leader(nullptr) {}
+
void deserialize(Archive &archive) override;
void toConsole() override;
diff --git a/engines/pink/objects/sequences/sequence_item.h b/engines/pink/objects/sequences/sequence_item.h
index 4005331783..554fd73819 100644
--- a/engines/pink/objects/sequences/sequence_item.h
+++ b/engines/pink/objects/sequences/sequence_item.h
@@ -54,6 +54,9 @@ public:
class SequenceItemLeaderAudio : public SequenceItemLeader {
public:
+ SequenceItemLeaderAudio()
+ : _sample(0) {}
+
void deserialize(Archive &archive) override;
void toConsole() override;
diff --git a/engines/pink/objects/walk/walk_mgr.cpp b/engines/pink/objects/walk/walk_mgr.cpp
index 6bda000eb8..21e8392875 100644
--- a/engines/pink/objects/walk/walk_mgr.cpp
+++ b/engines/pink/objects/walk/walk_mgr.cpp
@@ -29,7 +29,8 @@
namespace Pink {
WalkMgr::WalkMgr()
- : _isWalking(false), _leadActor(nullptr) {}
+ : _isWalking(false), _leadActor(nullptr),
+ _destination(nullptr) {}
WalkMgr::~WalkMgr() {
for (uint i = 0; i < _locations.size(); ++i) {
diff --git a/engines/pink/pda_mgr.cpp b/engines/pink/pda_mgr.cpp
index 49b43cba76..947ebcc573 100644
--- a/engines/pink/pda_mgr.cpp
+++ b/engines/pink/pda_mgr.cpp
@@ -32,8 +32,8 @@ namespace Pink {
static const char * const g_countries[] = {"BRI", "EGY", "BHU", "AUS", "IND", "CHI"};
static const char * const g_domains[] = {"NAT", "CLO", "HIS", "REL", "PLA", "ART", "FOO", "PEO"};
-PDAMgr::PDAMgr(Pink::PinkEngine *game)
- : _game(game), _page(nullptr), _globalPage(nullptr),
+PDAMgr::PDAMgr(PinkEngine *game)
+ : _game(game), _lead(nullptr), _page(nullptr), _globalPage(nullptr),
_cursorMgr(game, nullptr), _countryIndex(0), _domainIndex(0),
_iteration(0), _handFrame(0), _leftHandAction(kLeft1) {}
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index fc135a1477..15dfde9a1d 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -37,10 +37,10 @@
namespace Pink {
-Pink::PinkEngine::PinkEngine(OSystem *system, const ADGameDescription *desc)
- : Engine(system), _console(nullptr), _rnd("pink"),
- _desc(*desc), _bro(nullptr), _module(nullptr),
- _director(), _pdaMgr(this) {
+PinkEngine::PinkEngine(OSystem *system, const ADGameDescription *desc)
+ : Engine(system), _console(nullptr), _rnd("pink"),
+ _desc(*desc), _bro(nullptr), _actor(nullptr),
+ _module(nullptr), _director(), _pdaMgr(this) {
debug("PinkEngine constructed");
DebugMan.addDebugChannel(kPinkDebugGeneral, "general", "General issues");
@@ -53,7 +53,7 @@ Pink::PinkEngine::PinkEngine(OSystem *system, const ADGameDescription *desc)
SearchMan.addSubDirectoryMatching(gameDataDir, "install");
}
-Pink::PinkEngine::~PinkEngine() {
+PinkEngine::~PinkEngine() {
delete _console;
delete _bro;
for (uint i = 0; i < _modules.size(); ++i) {