-
-
Notifications
You must be signed in to change notification settings - Fork 499
Remove usages of ZERO_ON_NEW macro #984
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
Conversation
|
No |
Co-Authored-By: Qais Patankar <[email protected]>
|
Next error: In file included from ../Server/mods/deathmatch/StdInc.h:59:
In file included from ../Server/mods/deathmatch/logic/packets/CEntityAddPacket.h:18:
../Server/mods/deathmatch/logic/packets/../CGame.h:531:54: error: no viable conversion from 'nullptr_t' to 'CCommandLineParser'
CCommandLineParser m_CommandLineParser = nullptr;
^~~~~~~ |
|
There are multiple occurences of ZERO_ON_NEW in PR #760. |
| bool m_bDoPaintballs; | ||
| bool m_bShowInterpolation; | ||
| bool m_bDoPaintballs = 0; | ||
| bool m_bShowInterpolation = 0; |
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.
| bool m_bShowInterpolation = 0; | |
| bool m_bShowInterpolation = false; |
| bool m_bShowSound; | ||
| bool m_bDevelopmentMode = 0; | ||
| bool m_bShowCollision = 0; | ||
| bool m_bShowSound = 0; |
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.
| bool m_bShowSound = 0; | |
| bool m_bShowSound = false; |
| bool m_bShowCollision; | ||
| bool m_bShowSound; | ||
| bool m_bDevelopmentMode = 0; | ||
| bool m_bShowCollision = 0; |
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.
| bool m_bShowCollision = 0; | |
| bool m_bShowCollision = false; |
| bool m_bDevelopmentMode; | ||
| bool m_bShowCollision; | ||
| bool m_bShowSound; | ||
| bool m_bDevelopmentMode = 0; |
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.
| bool m_bDevelopmentMode = 0; | |
| bool m_bDevelopmentMode = false; |
| CVector m_vecLastMimicRot; | ||
| bool m_bDoPaintballs; | ||
| bool m_bShowInterpolation; | ||
| bool m_bDoPaintballs = 0; |
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.
| bool m_bDoPaintballs = 0; | |
| bool m_bDoPaintballs = false; |
| NetServerPlayerID m_PlayerSocket; | ||
| bool m_bIsJoined = false; | ||
| unsigned short m_usBitStreamVersion = 0; | ||
| NetServerPlayerID m_PlayerSocket ; |
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.
| NetServerPlayerID m_PlayerSocket ; | |
| NetServerPlayerID m_PlayerSocket; |
|
I think it would be safer if we could remove ZERO_ON_NEW in an automated way |
|
I just found that clang-tidy can apparently automate that for us: https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.html Getting clang-tidy to work with MTA is slightly complicated (as premake has no support for it), but I've done that before. The only downside to this it that we'd end up with everything in the constructor rather than inline in the headers, but I guess that's fine. I'll see if I can get this going tomorrow. |
Requires testing. I don't have a client available right now, so I can't test that part.