summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Helfferich <[email protected]>2016-04-03 14:08:48 -0500
committerJulian Helfferich <[email protected]>2016-04-03 14:08:48 -0500
commit06321d62a83fc8bb03580247c7957749bba9e53a (patch)
tree2059faba6752c2f29acf81b3f482540ae2e2023c
parent2b09606625ec45b334eed711e0756c8e74cd32ff (diff)
Fix Coverity #76266: Initialize members, make constructor protected
FieldInterface is a purely abstract class used as a base class for KBlocksField. Thus its constructor should be protected meaning that it can be called during the construction of KBlocksField, but calling FieldInterface fi = new FieldInterface() would fail. Also, the member variables are now initialized to their default values maBoard = nullptr, mWidth = 0, and mHeight = 0.
-rw-r--r--FieldInterface.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/FieldInterface.h b/FieldInterface.h
index ffc10b5..b34b9e8 100644
--- a/FieldInterface.h
+++ b/FieldInterface.h
@@ -12,8 +12,10 @@
class FieldInterface
{
+protected:
+ FieldInterface() : maBoard(nullptr), mHeight(0), mWidth(0) {};
+
public:
- FieldInterface() {};
virtual ~FieldInterface() {};
public: