-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Initialize class/struct variables with default values in modules/ #43952
Conversation
665428f
to
51530e2
Compare
31d4ec3
to
4c15f1d
Compare
4c15f1d
to
3d580b4
Compare
3d580b4
to
ba8a41b
Compare
ba8a41b
to
480df8d
Compare
@@ -47,7 +47,7 @@ class TextureBasisU : public Texture { | |||
RID texture; | |||
Size2 tex_size; | |||
|
|||
uint32_t flags; | |||
uint32_t flags = FLAGS_DEFAULT; |
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.
uint32_t flags = FLAGS_DEFAULT; | |
uint32_t flags = FLAGS_DEFAULT; |
modules/bullet/btRayShape.cpp
Outdated
@@ -43,7 +43,6 @@ btRayShape::btRayShape(btScalar length) : | |||
m_shapeAxis(0, 0, 1) { |
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.
This can be moved to the header too.
|
||
editor = nullptr; |
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.
Shouldn't this go in the header? And button
and library_editor
can also be initialized to nullptr
to be safe, even if they then get assigned values here.
k2 = 0.215; | ||
last_ticks = 0; | ||
}; | ||
MobileVRInterface::MobileVRInterface(){}; |
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.
MobileVRInterface::MobileVRInterface(){}; | |
MobileVRInterface::MobileVRInterface() {} |
MobileVRInterface::MobileVRInterface() { | ||
initialized = false; | ||
|
||
// Just set some defaults for these. At some point we need to look at adding a lookup table for common device + headset combos and/or support reading cardboard QR codes |
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.
Would be good to port this comment to the header too.
@@ -41,11 +41,11 @@ class AudioStreamOGGVorbis; | |||
class AudioStreamPlaybackOGGVorbis : public AudioStreamPlaybackResampled { |
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.
You missed AudioStreamOGGVorbis()
which has plenty of stuff to move to the header.
modules/websocket/wsl_peer.h
Outdated
Ref<StreamPeer> conn; | ||
Ref<StreamPeerTCP> tcp; | ||
int id; | ||
int id = 1; | ||
wslay_event_context_ptr ctx; |
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.
wslay_event_context_ptr ctx; | |
wslay_event_context_ptr ctx = nullptr; |
Left a few comments, otherwise should be good to merge, I looked through the whole diff. |
480df8d
to
f7209b4
Compare
Thanks! |
Part of #43636
In future it may also allow to run Memory sanitizer without too big error spam