-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Simplify tmp directory computation for extern controllers #6002
Conversation
…berbotics/webots into fix-extern-controller-tmp-dir
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 to me.
Thank you.
const bool clampNeeded = WbRgb(cr, cg, cb).clampValuesIfNeeded(); | ||
assert(!clampNeeded); |
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 broke the nightly builds, see https://github.com/cyberbotics/webots/actions/runs/4527046581/jobs/7972592389
WbRobot::WbRobot(const WbRobot &other) : WbSolid(other) { | ||
WbRobot::WbRobot(const WbRobot &other) : | ||
WbSolid(other), | ||
mControllerDir(), |
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.
All these initialization lines are useless and should be removed because QString objects are already initialized by 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.
cppcheck triggers an error if they are missing.
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.
Ok. But the cppcheck error/warning is wrong.
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 don't know if using a lot of suppress tags for cppcheck is really the best solution. Is it really that bad to initialize those QString objects?
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 is completely useless to explicitly initialize the strings and all the other Qt objects to default values.
From my point of view it makes the code less readable than before because we have a long list of useless instructions.
I think that cppcheck should help us writing better code, not worse and lately it is not always the case.
We should try to adjust the configuration to try to avoid these false positives.
mInitialSkeletonOrientation(), | ||
mInitialSkeletonPosition(), | ||
mRenderables(), | ||
mMaterialNames(), | ||
mMaterials(), | ||
mSegmentationMaterials(), | ||
mEncodeDepthMaterials(), | ||
mMeshes(), | ||
mBoneTransforms(), | ||
mBonesMap() { |
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.
The newly added initialization lines should be removed because they are useless.
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.
cppcheck triggers an error if they are missing.
@@ -117,7 +117,7 @@ WbReceiver::WbReceiver(WbTokenizer *tokenizer) : WbSolidDevice("Receiver", token | |||
init(); | |||
} | |||
|
|||
WbReceiver::WbReceiver(const WbReceiver &other) : WbSolidDevice(other) { | |||
WbReceiver::WbReceiver(const WbReceiver &other) : WbSolidDevice(other), mTransmissionList(), mWaitingQueue(), mReadyQueue() { |
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.
The newly added initialization instructions are useless and should be removed.
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.
cppcheck triggers an error if they are missing.
@@ -134,7 +134,7 @@ WbLightSensor::WbLightSensor(WbTokenizer *tokenizer) : WbSolidDevice("LightSenso | |||
init(); | |||
} | |||
|
|||
WbLightSensor::WbLightSensor(const WbLightSensor &other) : WbSolidDevice(other) { | |||
WbLightSensor::WbLightSensor(const WbLightSensor &other) : WbSolidDevice(other), mRayList() { |
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 useless to explicitly initialize mRayList
to the default value.
@@ -38,7 +38,7 @@ WbLed::WbLed(WbTokenizer *tokenizer) : WbSolidDevice("LED", tokenizer) { | |||
init(); | |||
} | |||
|
|||
WbLed::WbLed(const WbLed &other) : WbSolidDevice(other) { | |||
WbLed::WbLed(const WbLed &other) : WbSolidDevice(other), mMaterials(), mPbrAppearances(), mLights() { |
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.
here as well, the new initialization instructions are useless.
Also in WbDisplay, WbCharger, WbAbstractCamera,
Fixes #5300.
The
wbu_system_dir()
function is only used to get the tmp dir when using ipc extern controllers. TheWEBOTS_TMPDIR
is not useful and can be discarded in this case. Instead we useWEBOTS_HOME
to determine if we target a snap installation of Webots. If not we default to/tmp
.This PR also updates the
test_sources
to Ubuntu 22 to fix some cppcheck false positives. The clang-format version is locked to 14.0.0.