Skip to content

[ZH] Fix level 1 compiler warnings for implicit integer type conversions and uninitialized variables in copy constructors #534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,13 @@ class GlobalData : public SubsystemInterface
GlobalData *newOverride( void ); /** create a new override, copy data from previous
override, and return it */


#if defined(_MSC_VER) && _MSC_VER < 1300
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"uninitialised" is misspelled in third commit title.

GlobalData(const GlobalData& that) { DEBUG_CRASH(("unimplemented")); }
GlobalData& operator=(const GlobalData& that) { DEBUG_CRASH(("unimplemented")); return *this; }
#else
GlobalData(const GlobalData& that) = delete;
GlobalData& operator=(const GlobalData& that) = default;
#endif

};

Expand Down
5 changes: 5 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,15 @@ class ThingTemplate : public Overridable
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(ThingTemplate, "ThingTemplatePool" )

private:

#if defined(_MSC_VER) && _MSC_VER < 1300
ThingTemplate(const ThingTemplate& that) : m_geometryInfo(that.m_geometryInfo)
{
DEBUG_CRASH(("This should never be called\n"));
}
#else
ThingTemplate(const ThingTemplate& that) = delete;
#endif

public:

Expand Down
1 change: 1 addition & 0 deletions GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ Bool GlobalData::setTimeOfDay( TimeOfDay tod )
//-------------------------------------------------------------------------------------------------
GlobalData *GlobalData::newOverride( void )
{
// TheSuperHackers @info This copy is not implemented in VS6 builds
GlobalData *override = NEW GlobalData;

// copy the data from the latest override (TheWritableGlobalData) to the newly created instance
Expand Down
Loading