Skip to content

Commit 070199f

Browse files
author
Bart Roossien
committed
[ZH] Fix compiler warnings for uninitialised variables in copy constructors (TheSuperHackers#534)
1 parent 809a2d7 commit 070199f

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,13 @@ class GlobalData : public SubsystemInterface
531531
GlobalData *newOverride( void ); /** create a new override, copy data from previous
532532
override, and return it */
533533

534-
534+
#if defined(_MSC_VER) && _MSC_VER < 1300
535535
GlobalData(const GlobalData& that) { DEBUG_CRASH(("unimplemented")); }
536536
GlobalData& operator=(const GlobalData& that) { DEBUG_CRASH(("unimplemented")); return *this; }
537+
#else
538+
GlobalData(const GlobalData& that) = delete;
539+
GlobalData& operator=(const GlobalData& that) = default;
540+
#endif
537541

538542
};
539543

GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h

+5
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,15 @@ class ThingTemplate : public Overridable
351351
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(ThingTemplate, "ThingTemplatePool" )
352352

353353
private:
354+
355+
#if defined(_MSC_VER) && _MSC_VER < 1300
354356
ThingTemplate(const ThingTemplate& that) : m_geometryInfo(that.m_geometryInfo)
355357
{
356358
DEBUG_CRASH(("This should never be called\n"));
357359
}
360+
#else
361+
ThingTemplate(const ThingTemplate& that) = delete;
362+
#endif
358363

359364
public:
360365

GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,7 @@ Bool GlobalData::setTimeOfDay( TimeOfDay tod )
11291129
//-------------------------------------------------------------------------------------------------
11301130
GlobalData *GlobalData::newOverride( void )
11311131
{
1132+
// TheSuperHackers @info This copy is not implemented in VS6 builds
11321133
GlobalData *override = NEW GlobalData;
11331134

11341135
// copy the data from the latest override (TheWritableGlobalData) to the newly created instance

0 commit comments

Comments
 (0)