Skip to content

Commit 0ff66c9

Browse files
authored
refactor: Add override keyword to virtual function overrides in Core code (2) (TheSuperHackers#2603)
1 parent ccd8766 commit 0ff66c9

72 files changed

Lines changed: 244 additions & 271 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Core/GameEngine/Include/Common/ArchiveFileSystem.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ class ArchiveFileSystem : public SubsystemInterface
126126
ArchiveFileSystem();
127127
virtual ~ArchiveFileSystem() override;
128128

129-
virtual void init() = 0;
130-
virtual void update() = 0;
131-
virtual void reset() = 0;
132-
virtual void postProcessLoad() = 0;
129+
virtual void postProcessLoad() override = 0;
133130

134131
// ArchiveFile operations
135132
virtual ArchiveFile* openArchiveFile( const Char *filename ) = 0; ///< Create new or return existing Archive file from file name

Core/GameEngine/Include/Common/GameMemory.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ private: \
619619
// ----------------------------------------------------------------------------
620620
#define MEMORY_POOL_GLUE_WITHOUT_GCMP(ARGCLASS) \
621621
protected: \
622-
virtual ~ARGCLASS(); \
622+
virtual ~ARGCLASS() override; \
623623
public: \
624624
enum ARGCLASS##MagicEnum { ARGCLASS##_GLUE_NOT_IMPLEMENTED = 0 }; \
625625
public: \
@@ -665,7 +665,7 @@ protected: \
665665
ARGCLASS::getClassMemoryPool()->freeBlock(p); \
666666
} \
667667
private: \
668-
virtual MemoryPool *getObjectMemoryPool() \
668+
virtual MemoryPool *getObjectMemoryPool() override \
669669
{ \
670670
return ARGCLASS::getClassMemoryPool(); \
671671
} \
@@ -690,7 +690,7 @@ private: \
690690
// this is the version for an Abstract Base Class, which will never be instantiated...
691691
#define MEMORY_POOL_GLUE_ABC(ARGCLASS) \
692692
protected: \
693-
virtual ~ARGCLASS(); \
693+
virtual ~ARGCLASS() override; \
694694
public: \
695695
enum ARGCLASS##MagicEnum { ARGCLASS##_GLUE_NOT_IMPLEMENTED = 0 }; \
696696
protected: \
@@ -719,7 +719,7 @@ protected: \
719719
DEBUG_CRASH(("this should be impossible to call (abstract base class)")); \
720720
} \
721721
private: \
722-
virtual MemoryPool *getObjectMemoryPool() \
722+
virtual MemoryPool *getObjectMemoryPool() override \
723723
{ \
724724
throw ERROR_BUG; \
725725
return 0; \

Core/GameEngine/Include/Common/LocalFileSystem.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ class LocalFileSystem : public SubsystemInterface
3636
public:
3737
virtual ~LocalFileSystem() override {}
3838

39-
virtual void init() = 0;
40-
virtual void reset() = 0;
41-
virtual void update() = 0;
42-
4339
virtual File * openFile(const Char *filename, Int access = File::NONE, size_t bufferSize = File::BUFFERSIZE) = 0;
4440
virtual Bool doesFileExist(const Char *filename) const = 0;
4541
virtual void getFileListInDirectory(const AsciiString& currentDirectory, const AsciiString& originalDirectory, const AsciiString& searchName, FilenameList &filenameList, Bool searchSubdirectories) const = 0; ///< search the given directory for files matching the searchName (egs. *.ini, *.rep). Possibly search subdirectories.

Core/GameEngine/Include/GameClient/LoadScreen.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class SinglePlayerLoadScreen : public LoadScreen
8282

8383
virtual void init( GameInfo *game ) override; ///< Init the loadscreen
8484
virtual void reset() override; ///< Reset the system
85-
virtual void update()
85+
virtual void update() override
8686
{
8787
DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
8888
};
@@ -132,7 +132,7 @@ class ChallengeLoadScreen : public LoadScreen
132132

133133
virtual void init( GameInfo *game ) override; ///< Init the loadscreen
134134
virtual void reset() override; ///< Reset the system
135-
virtual void update()
135+
virtual void update() override
136136
{
137137
DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
138138
};
@@ -204,7 +204,7 @@ class ShellGameLoadScreen : public LoadScreen
204204

205205
virtual void init( GameInfo *game ) override; ///< Init the loadscreen
206206
virtual void reset() override; ///< Reset the system
207-
virtual void update()
207+
virtual void update() override
208208
{
209209
DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
210210
};
@@ -232,7 +232,7 @@ class MultiPlayerLoadScreen : public LoadScreen
232232

233233
virtual void init( GameInfo *game ) override; ///< Init the loadscreen
234234
virtual void reset() override; ///< Reset the system
235-
virtual void update()
235+
virtual void update() override
236236
{
237237
DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
238238
};
@@ -263,7 +263,7 @@ class GameSpyLoadScreen : public LoadScreen
263263

264264
virtual void init( GameInfo *game ) override; ///< Init the loadscreen
265265
virtual void reset() override; ///< Reset the system
266-
virtual void update()
266+
virtual void update() override
267267
{
268268
DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
269269
};
@@ -301,7 +301,7 @@ class MapTransferLoadScreen : public LoadScreen
301301

302302
virtual void init( GameInfo *game ) override; ///< Init the loadscreen
303303
virtual void reset() override; ///< Reset the system
304-
virtual void update()
304+
virtual void update() override
305305
{
306306
DEBUG_CRASH(("Call update(Int) instead. This update isn't supported"));
307307
};

Core/GameEngine/Include/GameClient/VideoPlayer.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,6 @@ class VideoPlayerInterface : public SubsystemInterface
222222
{
223223

224224
public:
225-
226-
virtual void init() = 0; ///< Initialize video playback
227-
virtual void reset() = 0; ///< Reset video playback
228-
virtual void update() = 0; ///< Services all video tasks. Should be called frequently
229-
230225
virtual void deinit() = 0; ///< Close down player
231226

232227
virtual ~VideoPlayerInterface() override {};

Core/GameEngine/Include/GameNetwork/LANAPI.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ class LANAPIInterface : public SubsystemInterface
6060

6161
virtual ~LANAPIInterface() override { };
6262

63-
virtual void init() = 0; ///< Initialize or re-initialize the instance
64-
virtual void reset() = 0; ///< reset the logic system
65-
virtual void update() = 0; ///< update the world
66-
6763
virtual void setIsActive(Bool isActive ) = 0; ///< Tell TheLAN whether or not the app is active.
6864

6965
// Possible types of chat messages

Core/GameEngine/Include/GameNetwork/LANGameInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class LANGameInfo : public GameInfo
9999

100100
// Convenience functions that interface with the LANPlayer held in the slot list
101101
virtual void resetAccepted() override; ///< Reset the accepted flag on all players
102-
Bool amIHost(); ///< Convenience function - is the local player the game host?
102+
virtual Bool amIHost() const override; ///< Convenience function - is the local player the game host?
103103

104104
/// Get the IP of selected player or return 0
105105
UnsignedInt getIP( int who )

Core/GameEngine/Include/GameNetwork/NetworkInterface.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ class NetworkInterface : public SubsystemInterface
5656

5757
static NetworkInterface * createNetwork();
5858

59-
//---------------------------------------------------------------------------------------
60-
// SubsystemInterface functions
61-
virtual void init() = 0; ///< Initialize the network
62-
virtual void reset() = 0; ///< Re-initialize the network
63-
virtual void update() = 0; ///< Updates the network
6459
virtual void liteupdate() = 0; ///< does a lightweight update for passing messages around.
6560

6661
virtual void setLocalAddress(UnsignedInt ip, UnsignedInt port) = 0; ///< Tell the network what local ip and port to bind to.

Core/GameEngine/Include/GameNetwork/WOLBrowser/WebBrowser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ class WebBrowser :
110110
// IUnknown methods
111111
//---------------------------------------------------------------------------
112112
protected:
113-
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) IUNKNOWN_NOEXCEPT;
114-
ULONG STDMETHODCALLTYPE AddRef() IUNKNOWN_NOEXCEPT;
115-
ULONG STDMETHODCALLTYPE Release() IUNKNOWN_NOEXCEPT;
113+
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) IUNKNOWN_NOEXCEPT override;
114+
ULONG STDMETHODCALLTYPE AddRef() IUNKNOWN_NOEXCEPT override;
115+
ULONG STDMETHODCALLTYPE Release() IUNKNOWN_NOEXCEPT override;
116116

117117
//---------------------------------------------------------------------------
118118
// IBrowserDispatch methods

Core/GameEngine/Source/Common/System/LocalFileSystem.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,3 @@ LocalFileSystem *TheLocalFileSystem = nullptr;
9292
//----------------------------------------------------------------------------
9393
// Public Functions
9494
//----------------------------------------------------------------------------
95-
96-
void LocalFileSystem::init() {
97-
}
98-
99-
void LocalFileSystem::reset() {
100-
}
101-
102-
void LocalFileSystem::update() {
103-
}

0 commit comments

Comments
 (0)