-
Notifications
You must be signed in to change notification settings - Fork 117
refactor: Verify array size, fix constness of strings lists, and improve order of enum values #1584
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
refactor: Verify array size, fix constness of strings lists, and improve order of enum values #1584
Conversation
|
Generals targets fail compile until replicated. |
84b2077 to
7cc3b7d
Compare
|
Rebased and fixed merge conflicts |
… values of strings lists
7cc3b7d to
ab497c1
Compare
Mauller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall but a few tweaks needed
| }; | ||
|
|
||
| static const char *DistributionTypeNames[]; | ||
| static const char *const DistributionTypeNames[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the GameClientRandomVariable and GameLogicRandomVariable classes should be abstracted and combined into a single class in common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, seems unnecessary to have duplicate implementations. Is beyond the scope of this change however.
GeneralsMD/Code/GameEngine/Source/Common/System/DisabledTypes.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/Common/System/ObjectStatusTypes.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp
Outdated
Show resolved
Hide resolved
Mauller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
|
Replicated in Generals with conflicts |
|
While replicating, the static asserts revealed 2 additional discepancies in Generals arrays: template<>
const char* const ArmorSetFlags::s_bitNameList[] =
{
"VETERAN",
"ELITE",
"HERO",
"PLAYER_UPGRADE",
"WEAK_VERSUS_BASEDEFENSES", // <----- This was missing
NULL
};
static const char *const TheCommandSourceMaskNames[] =
{
"FROM_PLAYER",
"FROM_SCRIPT",
"FROM_AI",
"FROM_DOZER", // <----- This was missing
NULL
};Both are fixed now to make it compile. |
…ove order of enum values (TheSuperHackers#1584)
This change mainly does 3 things:
Logically nothing changes.
TODO