-
Notifications
You must be signed in to change notification settings - Fork 936
Some minor cleanup (warnings and undefined behavior) #92
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
Surpessed warnings for unused parameters (-Wunused-parameter) in NodeDataModel
Q_OBJECT macro removed, as it is already in base class
explicitly deleted copy constructor and assignment operator for classes with pointer members
| , public Serializable | ||
| { | ||
|
|
||
| Q_OBJECT |
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 is wrong. By removing the Q_OBJECT you hide this class from qt meta object generator
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 you are right, my bad.
| PortType _requiredPort; | ||
|
|
||
| Node* _lastHoveredNode = nullptr; | ||
| Node* _lastHoveredNode{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.
What is the difference to the previous version?
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.
In this case not very much, but List initialization should be preferred as it does not allow narrowing.
| NodeDataType DestinationType; | ||
| RegistryItemPtr Model{}; | ||
| NodeDataType SourceType{}; | ||
| NodeDataType DestinationType{}; |
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.
What does it change?
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.
It properly initializes the members, and thus silences compiler warnings.
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 think I mistakenly assumed that std::unique_ptr and a struct of two std::string are properly initialized without special statements, i.e. the default-constructor for smart pointer would initialize it to nullptr and strings will be empty.
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.
But yes, if we would add some int to the NodeDataType struct we would become some garbage without a proper initialization.
|
Hi Bastian, wirst Du diesen Pull-Request zurücksetzen? Grüße, |
|
Hallo Dmitry, Ich hoffe dass die änderungen beim erneuten öffnen mit hinzugefügt werden. Gruß, |
|
Danke für die Korrekturen |
No description provided.