mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 12:00:35 +08:00
CI: enable clang-tidy bugprone-assignment-in-if-condition (#26580)
* docs: auto-sync metadata [skip ci] Co-Authored-By: PX4 BuildBot <bot@px4.io> CI: enable clang-tidy bugprone-assignment-in-if-condition Signed-off-by: kuralme <kuralme@protonmail.com> initialize and immediate assignments made one line Signed-off-by: kuralme <kuralme@protonmail.com> * two more initialization fix Signed-off-by: kuralme <kuralme@protonmail.com> --------- Signed-off-by: kuralme <kuralme@protonmail.com> Co-authored-by: PX4BuildBot <bot@px4.io>
This commit is contained in:
@@ -1120,7 +1120,9 @@ void SimulatorMavlink::run()
|
||||
|
||||
if (_ip == InternetProtocol::UDP) {
|
||||
|
||||
if ((_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
|
||||
_fd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
|
||||
if (_fd < 0) {
|
||||
PX4_ERR("Creating UDP socket failed: %s", strerror(errno));
|
||||
return;
|
||||
}
|
||||
@@ -1153,7 +1155,9 @@ void SimulatorMavlink::run()
|
||||
PX4_INFO("Waiting for simulator to accept connection on TCP port %u", _port);
|
||||
|
||||
while (true) {
|
||||
if ((_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
||||
_fd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
||||
if (_fd < 0) {
|
||||
PX4_ERR("Creating TCP socket failed: %s", strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user